fix(query): fix count/hyperloglog return additional row in group by
when queryPolicy is set to 3.
This commit is contained in:
parent
b55af6372c
commit
7bd98ec700
|
@ -545,6 +545,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect,
|
||||||
pAgg->hasLastRow = pSelect->hasLastRowFunc;
|
pAgg->hasLastRow = pSelect->hasLastRowFunc;
|
||||||
pAgg->hasLast = pSelect->hasLastFunc;
|
pAgg->hasLast = pSelect->hasLastFunc;
|
||||||
pAgg->hasTimeLineFunc = pSelect->hasTimeLineFunc;
|
pAgg->hasTimeLineFunc = pSelect->hasTimeLineFunc;
|
||||||
|
pAgg->hasGroupKeyOptimized = false;
|
||||||
pAgg->onlyHasKeepOrderFunc = pSelect->onlyHasKeepOrderFunc;
|
pAgg->onlyHasKeepOrderFunc = pSelect->onlyHasKeepOrderFunc;
|
||||||
pAgg->node.groupAction = getGroupAction(pCxt, pSelect);
|
pAgg->node.groupAction = getGroupAction(pCxt, pSelect);
|
||||||
pAgg->node.requireDataOrder = getRequireDataOrder(pAgg->hasTimeLineFunc, pSelect);
|
pAgg->node.requireDataOrder = getRequireDataOrder(pAgg->hasTimeLineFunc, pSelect);
|
||||||
|
|
|
@ -1570,6 +1570,7 @@ static int32_t partTagsOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSub
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NODES_DESTORY_LIST(pAgg->pGroupKeys);
|
NODES_DESTORY_LIST(pAgg->pGroupKeys);
|
||||||
|
pAgg->hasGroupKeyOptimized = true;
|
||||||
if (TSDB_CODE_SUCCESS == code && start >= 0) {
|
if (TSDB_CODE_SUCCESS == code && start >= 0) {
|
||||||
code = partTagsRewriteGroupTagsToFuncs(pScan->pGroupTags, start, pAgg);
|
code = partTagsRewriteGroupTagsToFuncs(pScan->pGroupTags, start, pAgg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -872,6 +872,7 @@ static int32_t createAggPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren,
|
||||||
}
|
}
|
||||||
|
|
||||||
pAgg->mergeDataBlock = (GROUP_ACTION_KEEP == pAggLogicNode->node.groupAction ? false : true);
|
pAgg->mergeDataBlock = (GROUP_ACTION_KEEP == pAggLogicNode->node.groupAction ? false : true);
|
||||||
|
pAgg->groupKeyOptimized = pAggLogicNode->hasGroupKeyOptimized;
|
||||||
|
|
||||||
SNodeList* pPrecalcExprs = NULL;
|
SNodeList* pPrecalcExprs = NULL;
|
||||||
SNodeList* pGroupKeys = NULL;
|
SNodeList* pGroupKeys = NULL;
|
||||||
|
|
Loading…
Reference in New Issue