提交 100d3230 编写于 作者: D dapan1121

feature/qnode

上级 6982f2b7
...@@ -174,7 +174,7 @@ bool tIsValidSchema(struct SSchema* pSchema, int32_t numOfCols, int32_ ...@@ -174,7 +174,7 @@ bool tIsValidSchema(struct SSchema* pSchema, int32_t numOfCols, int32_
int32_t queryCreateTableMetaFromMsg(STableMetaRsp* msg, bool isSuperTable, STableMeta** pMeta); int32_t queryCreateTableMetaFromMsg(STableMetaRsp* msg, bool isSuperTable, STableMeta** pMeta);
char *jobTaskStatusStr(int32_t status); char *jobTaskStatusStr(int32_t status);
int32_t qAppendTaskExplainResRows(void **pRowCtx, struct SSubplan *plan, void *pExecTree, int32_t level); int32_t qAppendTaskExplainResRows(void **pRowCtx, void *plan, void *pExecTree, int32_t level);
int32_t qGetExplainRspFromRowCtx(void *ctx, SRetrieveTableRsp **pRsp); int32_t qGetExplainRspFromRowCtx(void *ctx, SRetrieveTableRsp **pRsp);
void qFreeExplainRowCtx(void *ctx); void qFreeExplainRowCtx(void *ctx);
......
...@@ -478,11 +478,13 @@ _return: ...@@ -478,11 +478,13 @@ _return:
QRY_RET(code); QRY_RET(code);
} }
int32_t qAppendTaskExplainResRows(void **pRowCtx, struct SSubplan *plan, void *pExecTree, int32_t level) { int32_t qAppendTaskExplainResRows(void **pRowCtx, void *plan, void *pExecTree, int32_t level) {
SExplainResNode *node = NULL; SExplainResNode *node = NULL;
int32_t code = 0; int32_t code = 0;
struct SSubplan *pPlan = (struct SSubplan *)plan;
SExplainRowCtx *ctx = (SExplainRowCtx *)*pRowCtx;
QRY_ERR_RET(qGenerateExplainResNodeTree(plan, pExecTree, &node)); QRY_ERR_RET(qGenerateExplainResNodeTree(pPlan, pExecTree, &node));
if (NULL == *pRowCtx) { if (NULL == *pRowCtx) {
*pRowCtx = taosMemoryCalloc(1, sizeof(SExplainRowCtx)); *pRowCtx = taosMemoryCalloc(1, sizeof(SExplainRowCtx));
...@@ -491,24 +493,25 @@ int32_t qAppendTaskExplainResRows(void **pRowCtx, struct SSubplan *plan, void *p ...@@ -491,24 +493,25 @@ int32_t qAppendTaskExplainResRows(void **pRowCtx, struct SSubplan *plan, void *p
QRY_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY); QRY_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY);
} }
ctx = (SExplainRowCtx *)*pRowCtx;
SArray *rows = taosArrayInit(10, sizeof(SQueryExplainRowInfo)); SArray *rows = taosArrayInit(10, sizeof(SQueryExplainRowInfo));
if (NULL == rows) { if (NULL == rows) {
qError("taosArrayInit SQueryExplainRowInfo failed"); qError("taosArrayInit SQueryExplainRowInfo failed");
QRY_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY); QRY_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY);
} }
(*pRowCtx)->rows = rows; ctx->rows = rows;
} }
QRY_ERR_JRET(qGenerateExplainResRowsFromNode(node, *pRowCtx, level)); QRY_ERR_JRET(qGenerateExplainResRowsFromNode(node, ctx, level));
_return: _return:
qFreeExplainResTree(node); qFreeExplainResTree(node);
if (code) { if (code) {
taosArrayDestroy((*pRowCtx)->rows); qFreeExplainRowCtx(*pRowCtx);
taosMemoryFree(*pRowCtx);
*pRowCtx = NULL; *pRowCtx = NULL;
} }
......
...@@ -527,7 +527,7 @@ int32_t schValidateAndBuildJobExplain(SQueryPlan *pDag, SSchJob *pJob) { ...@@ -527,7 +527,7 @@ int32_t schValidateAndBuildJobExplain(SQueryPlan *pDag, SSchJob *pJob) {
SSchExplainGroup group = {.nodeNum = 1, .plan = plan}; SSchExplainGroup group = {.nodeNum = 1, .plan = plan};
if (0 != taosHashPut(groupHash, &plan->id.groupId, sizeof(plan->id.groupId), &group, sizeof(group))) { if (0 != taosHashPut(groupHash, &plan->id.groupId, sizeof(plan->id.groupId), &group, sizeof(group))) {
SCH_TASK_ELOG("taosHashPut to explainGroupHash failed, taskIdx:%d", n); SCH_JOB_ELOG("taosHashPut to explainGroupHash failed, taskIdx:%d", n);
SCH_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY); SCH_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册