feat: support partition by expression and aggregate function output together

This commit is contained in:
Xiaoyu Wang 2022-06-25 10:29:44 +08:00
parent e187f42902
commit 16ee8eeb28
2 changed files with 8 additions and 2 deletions

View File

@ -348,8 +348,8 @@ static SPhysiNode* makePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode
return NULL; return NULL;
} }
pPhysiNode->pLimit = pLogicNode->pLimit; TSWAP(pPhysiNode->pLimit, pLogicNode->pLimit);
pPhysiNode->pSlimit = pLogicNode->pSlimit; TSWAP(pPhysiNode->pSlimit, pLogicNode->pSlimit);
int32_t code = createDataBlockDesc(pCxt, pLogicNode->pTargets, &pPhysiNode->pOutputDataBlockDesc); int32_t code = createDataBlockDesc(pCxt, pLogicNode->pTargets, &pPhysiNode->pOutputDataBlockDesc);
if (TSDB_CODE_SUCCESS != code) { if (TSDB_CODE_SUCCESS != code) {

View File

@ -40,3 +40,9 @@ TEST_F(PlanDistinctTest, withOrderBy) {
run("select distinct c1 + 10 a from t1 order by a"); run("select distinct c1 + 10 a from t1 order by a");
} }
TEST_F(PlanDistinctTest, withLimit) {
useDb("root", "test");
run("SELECT DISTINCT c1 FROM t1 LIMIT 3");
}