[td-10564] refactor

This commit is contained in:
Haojun Liao 2021-11-09 11:17:37 +08:00
parent a7058d818a
commit 3c8a25aa10
2 changed files with 14 additions and 2 deletions

View File

@ -168,4 +168,14 @@ TEST(testCase, displayPlan) {
generateLogicplan("select count(*) from `t.1abc` group by a"); generateLogicplan("select count(*) from `t.1abc` group by a");
generateLogicplan("select count(*) from `t.1abc` interval(10s, 5s) sliding(7s)"); generateLogicplan("select count(*) from `t.1abc` interval(10s, 5s) sliding(7s)");
generateLogicplan("select count(*),sum(a),avg(b),min(a+b) from `t.1abc`"); generateLogicplan("select count(*),sum(a),avg(b),min(a+b) from `t.1abc`");
// order by + group by column + limit offset + fill
// join
// union
} }

View File

@ -154,6 +154,8 @@ static SQueryPlanNode* createQueryNode(int32_t type, const char* name, SQueryPla
memcpy(pNode->pExtInfo, pExtInfo, sizeof(SLimit)); memcpy(pNode->pExtInfo, pExtInfo, sizeof(SLimit));
break; break;
} }
default:
assert(0);
} }
return pNode; return pNode;
@ -257,14 +259,14 @@ static SQueryPlanNode* doCreateQueryPlanForOneTableImpl(SQueryStmtInfo* pQueryIn
} }
} }
// group by column not by tag
if (numOfGroupCols != 0) { if (numOfGroupCols != 0) {
pNode = createQueryNode(QNODE_GROUPBY, "Groupby", &pNode, 1, NULL, 0, info, &pQueryInfo->groupbyExpr); pNode = createQueryNode(QNODE_GROUPBY, "Groupby", &pNode, 1, NULL, 0, info, &pQueryInfo->groupbyExpr);
} }
if (pQueryInfo->havingFieldNum > 0) { if (pQueryInfo->havingFieldNum > 0) {
// int32_t numOfExpr = (int32_t)taosArrayGetSize(pQueryInfo->exprList1); // int32_t numOfExpr = (int32_t)taosArrayGetSize(pQueryInfo->exprList1);
// pNode = createQueryNode(QNODE_PROJECT, "Projection", &pNode, 1, pQueryInfo->exprList1->pData, numOfExpr, info, // pNode = createQueryNode(QNODE_PROJECT, "Projection", &pNode, 1, pQueryInfo->exprList1->pData, numOfExpr, info, NULL);
// NULL);
} }
if (pQueryInfo->fillType != TSDB_FILL_NONE) { if (pQueryInfo->fillType != TSDB_FILL_NONE) {