Merge pull request #7402 from taosdata/hotfix/td-6086

[TD-6086]<fix>:num of tags taken from output cols instead of groupby …
This commit is contained in:
dapan1121 2021-08-17 08:37:33 +08:00 committed by GitHub
commit f7db06ea30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -396,7 +396,16 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
if (pQueryInfo->fillType != TSDB_FILL_NONE) {
SFillColInfo* pFillCol = createFillColInfo(pQueryInfo);
pReducer->pFillInfo = taosCreateFillInfo(pQueryInfo->order.order, revisedSTime, pQueryInfo->groupbyExpr.numOfGroupCols,
// support sql like: select selective_function, tag1... where ... group by tag3... fill(not fill none)
// the group by expr columns and select tags are different
int32_t numOfCols = tscNumOfFields(pQueryInfo);
int32_t numOfTags = 0;
for (int32_t i = 0; i < numOfCols; ++i) {
if (TSDB_COL_IS_TAG(pFillCol[i].flag)) {
numOfTags++;
}
}
pReducer->pFillInfo = taosCreateFillInfo(pQueryInfo->order.order, revisedSTime, numOfTags,
4096, (int32_t)pQueryInfo->fieldsInfo.numOfOutput, pQueryInfo->interval.sliding, pQueryInfo->interval.slidingUnit,
tinfo.precision, pQueryInfo->fillType, pFillCol, pSql);
}