未验证 提交 c0d5f517 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #9181 from taosdata/feature/3.0_wxy

TD-12193 json to physical plan
......@@ -128,6 +128,7 @@ typedef struct SSubplan {
} SSubplan;
typedef struct SQueryDag {
uint64_t queryId;
SArray *pSubplans; // Element is SArray*, and nested element is SSubplan. The execution level of subplan, starting from 0.
} SQueryDag;
......@@ -136,7 +137,7 @@ typedef struct SQueryDag {
*/
int32_t qCreateQueryDag(const struct SQueryStmtInfo* pQueryInfo, struct SEpSet* pQnode, struct SQueryDag** pDag);
int32_t qSetSuplanExecutionNode(SSubplan* subplan, SArray* nodes);
int32_t qSetSubplanExecutionNode(SSubplan* subplan, SArray* eps);
int32_t qExplainQuery(const struct SQueryStmtInfo* pQueryInfo, struct SEpSet* pQnode, char** str);
......@@ -147,12 +148,14 @@ int32_t qSubPlanToString(const SSubplan* subplan, char** str);
int32_t qStringToSubplan(const char* str, SSubplan** subplan);
void qDestroySubplan(SSubplan* pSubplan);
/**
* Destroy the physical plan.
* @param pQueryPhyNode
* @return
*/
void qDestroyQueryDag(struct SQueryDag* pDag);
void qDestroyQueryDag(SQueryDag* pDag);
#ifdef __cplusplus
}
......
......@@ -116,6 +116,8 @@ void destroyQueryPlan(struct SQueryPlanNode* pQueryNode);
*/
void* destroyQueryPhyPlan(struct SPhyNode* pQueryPhyNode);
int32_t opNameToOpType(const char* name);
#ifdef __cplusplus
}
#endif
......
......@@ -179,7 +179,7 @@ static SPhyNode* createPhyNode(SPlanContext* pCxt, SQueryPlanNode* pPlanNode) {
assert(false);
}
if (pPlanNode->pChildren != NULL && taosArrayGetSize(pPlanNode->pChildren) > 0) {
node->pChildren = taosArrayInit(4, POINTER_BYTES);
node->pChildren = taosArrayInit(TARRAY_MIN_SIZE, POINTER_BYTES);
size_t size = taosArrayGetSize(pPlanNode->pChildren);
for(int32_t i = 0; i < size; ++i) {
SPhyNode* child = createPhyNode(pCxt, taosArrayGet(pPlanNode->pChildren, i));
......@@ -215,3 +215,12 @@ int32_t createDag(SQueryPlanNode* pQueryNode, struct SCatalog* pCatalog, SQueryD
*pDag = context.pDag;
return TSDB_CODE_SUCCESS;
}
int32_t opNameToOpType(const char* name) {
for (int32_t i = 1; i < sizeof(gOpName) / sizeof(gOpName[0]); ++i) {
if (strcmp(name, gOpName[i])) {
return i;
}
}
return OP_Unknown;
}
......@@ -16,6 +16,10 @@
#include "parser.h"
#include "plannerInt.h"
void qDestroySubplan(SSubplan* pSubplan) {
// todo
}
void qDestroyQueryDag(struct SQueryDag* pDag) {
// todo
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册