From 3c8a25aa106329a139aa64c1f3eee3bc9825dbce Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 9 Nov 2021 11:17:37 +0800 Subject: [PATCH] [td-10564] refactor --- source/libs/parser/test/plannerTest.cpp | 10 ++++++++++ source/libs/planner/src/planner.c | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/libs/parser/test/plannerTest.cpp b/source/libs/parser/test/plannerTest.cpp index 5d3a6a42a6..89e4166070 100644 --- a/source/libs/parser/test/plannerTest.cpp +++ b/source/libs/parser/test/plannerTest.cpp @@ -168,4 +168,14 @@ TEST(testCase, displayPlan) { generateLogicplan("select count(*) from `t.1abc` group by a"); generateLogicplan("select count(*) from `t.1abc` interval(10s, 5s) sliding(7s)"); generateLogicplan("select count(*),sum(a),avg(b),min(a+b) from `t.1abc`"); + + // order by + group by column + limit offset + fill + + + // join + + + // union + + } \ No newline at end of file diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index 0621a90798..00693892e9 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -154,6 +154,8 @@ static SQueryPlanNode* createQueryNode(int32_t type, const char* name, SQueryPla memcpy(pNode->pExtInfo, pExtInfo, sizeof(SLimit)); break; } + default: + assert(0); } return pNode; @@ -257,14 +259,14 @@ static SQueryPlanNode* doCreateQueryPlanForOneTableImpl(SQueryStmtInfo* pQueryIn } } + // group by column not by tag if (numOfGroupCols != 0) { pNode = createQueryNode(QNODE_GROUPBY, "Groupby", &pNode, 1, NULL, 0, info, &pQueryInfo->groupbyExpr); } if (pQueryInfo->havingFieldNum > 0) { // int32_t numOfExpr = (int32_t)taosArrayGetSize(pQueryInfo->exprList1); -// pNode = createQueryNode(QNODE_PROJECT, "Projection", &pNode, 1, pQueryInfo->exprList1->pData, numOfExpr, info, -// NULL); +// pNode = createQueryNode(QNODE_PROJECT, "Projection", &pNode, 1, pQueryInfo->exprList1->pData, numOfExpr, info, NULL); } if (pQueryInfo->fillType != TSDB_FILL_NONE) { -- GitLab