[td-428]
This commit is contained in:
parent
086a3a4a79
commit
6e0556d540
|
@ -189,7 +189,7 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
|||
|
||||
/*
|
||||
* In following cases, return false for non ordered project query on super table
|
||||
* 1. failed to get metermeta from server; 2. not a super table; 3. limitation is 0;
|
||||
* 1. failed to get tableMeta from server; 2. not a super table; 3. limitation is 0;
|
||||
* 4. show queries, instead of a select query
|
||||
*/
|
||||
size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo);
|
||||
|
@ -198,11 +198,6 @@ bool tscIsProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// only query on tag, a project query
|
||||
if (tscQueryTags(pQueryInfo)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < numOfExprs; ++i) {
|
||||
int32_t functionId = tscSqlExprGet(pQueryInfo, i)->functionId;
|
||||
if (functionId != TSDB_FUNC_PRJ && functionId != TSDB_FUNC_TAGPRJ && functionId != TSDB_FUNC_TAG &&
|
||||
|
@ -221,7 +216,7 @@ bool tscNonOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableI
|
|||
}
|
||||
|
||||
// order by columnIndex exists, not a non-ordered projection query
|
||||
return pQueryInfo->order.orderColId < 0 && pQueryInfo->order.orderColId != TSDB_TBNAME_COLUMN_INDEX;
|
||||
return pQueryInfo->order.orderColId < 0;
|
||||
}
|
||||
|
||||
bool tscOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex) {
|
||||
|
|
|
@ -789,11 +789,10 @@ static char *getDataBlock(SQueryRuntimeEnv *pRuntimeEnv, SArithmeticSupport *sas
|
|||
sas->data = calloc(pQuery->numOfCols, POINTER_BYTES);
|
||||
|
||||
// here the pQuery->colList and sas->colList are identical
|
||||
int32_t numOfCols = taosArrayGetSize(pDataBlock);
|
||||
for (int32_t i = 0; i < pQuery->numOfCols; ++i) {
|
||||
SColumnInfo *pColMsg = &pQuery->colList[i];
|
||||
|
||||
int32_t numOfCols = taosArrayGetSize(pDataBlock);
|
||||
|
||||
dataBlock = NULL;
|
||||
for (int32_t k = 0; k < numOfCols; ++k) { //todo refactor
|
||||
SColumnInfoData *p = taosArrayGet(pDataBlock, k);
|
||||
|
@ -2102,7 +2101,8 @@ static void ensureOutputBuffer(SQueryRuntimeEnv* pRuntimeEnv, SDataBlockInfo* pB
|
|||
|
||||
for (int32_t i = 0; i < pQuery->numOfOutput; ++i) {
|
||||
int32_t bytes = pQuery->pSelectExpr[i].bytes;
|
||||
|
||||
assert(bytes > 0 && newSize > 0);
|
||||
|
||||
char *tmp = realloc(pQuery->sdata[i], bytes * newSize + sizeof(tFilePage));
|
||||
if (tmp == NULL) { // todo handle the oom
|
||||
assert(0);
|
||||
|
@ -5501,7 +5501,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
|
|||
}
|
||||
|
||||
// set the output buffer capacity
|
||||
pQuery->rec.capacity = 2;
|
||||
pQuery->rec.capacity = 4096;
|
||||
pQuery->rec.threshold = 4000;
|
||||
|
||||
for (int32_t col = 0; col < pQuery->numOfOutput; ++col) {
|
||||
|
|
|
@ -311,7 +311,7 @@ void calc_fn_i32_i32_sub(void *left, void *right, int32_t numLeft, int32_t numRi
|
|||
if (numLeft == numRight) {
|
||||
for (; i >= 0 && i < numRight; i += step, pOutput += 1) {
|
||||
if (isNull((char *)&(pLeft[i]), TSDB_DATA_TYPE_INT) || isNull((char *)&(pRight[i]), TSDB_DATA_TYPE_INT)) {
|
||||
setNull((char *)&(pOutput[i]), TSDB_DATA_TYPE_DOUBLE, tDataTypeDesc[TSDB_DATA_TYPE_DOUBLE].nSize);
|
||||
setNull((char *)(pOutput), TSDB_DATA_TYPE_DOUBLE, tDataTypeDesc[TSDB_DATA_TYPE_DOUBLE].nSize);
|
||||
continue;
|
||||
}
|
||||
*pOutput = (double)pLeft[i] - pRight[i];
|
||||
|
|
Loading…
Reference in New Issue