提交 6a1814b5 编写于 作者: H Haojun Liao

[td-10564] refactor query logic plan generator.

上级 0108d6da
...@@ -251,7 +251,6 @@ static SQueryPlanNode* doCreateQueryPlanForOneTable(SQueryStmtInfo* pQueryInfo, ...@@ -251,7 +251,6 @@ static SQueryPlanNode* doCreateQueryPlanForOneTable(SQueryStmtInfo* pQueryInfo,
SArray* tableCols) { SArray* tableCols) {
char name[TSDB_TABLE_FNAME_LEN] = {0}; char name[TSDB_TABLE_FNAME_LEN] = {0};
tstrncpy(name, pTableMetaInfo->name.tname, TSDB_TABLE_FNAME_LEN); tstrncpy(name, pTableMetaInfo->name.tname, TSDB_TABLE_FNAME_LEN);
// tNameExtractFullName(&pTableMetaInfo->name, name);
SQueryTableInfo info = {.tableName = strdup(name), .uid = pTableMetaInfo->pTableMeta->uid,}; SQueryTableInfo info = {.tableName = strdup(name), .uid = pTableMetaInfo->pTableMeta->uid,};
...@@ -354,12 +353,6 @@ static void doDestroyQueryNode(SQueryPlanNode* pQueryNode) { ...@@ -354,12 +353,6 @@ static void doDestroyQueryNode(SQueryPlanNode* pQueryNode) {
tfree(pQueryNode); tfree(pQueryNode);
} }
bool hasAliasName(SExprInfo* pExpr) {
assert(pExpr != NULL);
return true;
// return strncmp(pExpr->base.token, pExpr->base., tListLen(pExpr->base.aliasName)) != 0;
}
static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level, int32_t totalLen) { static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level, int32_t totalLen) {
if (level > 0) { if (level > 0) {
sprintf(buf + totalLen, "%*c", level, ' '); sprintf(buf + totalLen, "%*c", level, ' ');
...@@ -409,13 +402,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level, ...@@ -409,13 +402,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level,
SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i); SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i);
SSqlExpr* pExpr = &pExprInfo->base; SSqlExpr* pExpr = &pExprInfo->base;
// if (hasAliasName(&pQueryNode->pExpr[i])) { len += sprintf(buf + len,"%s [%s #%d]", pExpr->token, pExpr->resSchema.name, pExpr->resSchema.colId);
len1 = sprintf(buf + len,"[%s #%s]", pExpr->token, pExpr->resSchema.name);
// } else {
// len1 = sprintf(buf + len,"[%s]", pExpr->token);
// }
len += len1;
if (i < pQueryNode->numOfOutput - 1) { if (i < pQueryNode->numOfOutput - 1) {
len1 = sprintf(buf + len, ", "); len1 = sprintf(buf + len, ", ");
len += len1; len += len1;
...@@ -432,13 +419,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level, ...@@ -432,13 +419,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level,
SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i); SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i);
SSqlExpr* pExpr = &pExprInfo->base; SSqlExpr* pExpr = &pExprInfo->base;
if (hasAliasName(pExprInfo)) { len += sprintf(buf + len,"%s [%s #%d]", pExpr->token, pExpr->resSchema.name, pExpr->resSchema.colId);
len1 = sprintf(buf + len,"[%s #%s]", pExpr->token, pExpr->resSchema.name);
} else {
len1 = sprintf(buf + len,"[%s]", pExpr->token);
}
len += len1;
if (i < pQueryNode->numOfOutput - 1) { if (i < pQueryNode->numOfOutput - 1) {
len1 = sprintf(buf + len,", "); len1 = sprintf(buf + len,", ");
len += len1; len += len1;
...@@ -464,12 +445,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level, ...@@ -464,12 +445,7 @@ static int32_t doPrintPlan(char* buf, SQueryPlanNode* pQueryNode, int32_t level,
SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i); SExprInfo* pExprInfo = taosArrayGetP(pQueryNode->pExpr, i);
SSqlExpr* pExpr = &pExprInfo->base; SSqlExpr* pExpr = &pExprInfo->base;
len1 = sprintf(buf + len,"%s [%s #%d]", pExpr->token, pExpr->resSchema.name, pExpr->resSchema.colId);
if (hasAliasName(pExprInfo)) {
len1 = sprintf(buf + len,"[%s #%s]", pExpr->token, pExpr->resSchema.name);
} else {
len1 = sprintf(buf + len,"[%s]", pExpr->token);
}
len += len1; len += len1;
if (i < pQueryNode->numOfOutput - 1) { if (i < pQueryNode->numOfOutput - 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册