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

feature/qnode

上级 6982f2b7
......@@ -174,7 +174,7 @@ bool tIsValidSchema(struct SSchema* pSchema, int32_t numOfCols, int32_
int32_t queryCreateTableMetaFromMsg(STableMetaRsp* msg, bool isSuperTable, STableMeta** pMeta);
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);
void qFreeExplainRowCtx(void *ctx);
......
......@@ -478,11 +478,13 @@ _return:
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;
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) {
*pRowCtx = taosMemoryCalloc(1, sizeof(SExplainRowCtx));
......@@ -491,24 +493,25 @@ int32_t qAppendTaskExplainResRows(void **pRowCtx, struct SSubplan *plan, void *p
QRY_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY);
}
ctx = (SExplainRowCtx *)*pRowCtx;
SArray *rows = taosArrayInit(10, sizeof(SQueryExplainRowInfo));
if (NULL == rows) {
qError("taosArrayInit SQueryExplainRowInfo failed");
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:
qFreeExplainResTree(node);
if (code) {
taosArrayDestroy((*pRowCtx)->rows);
taosMemoryFree(*pRowCtx);
qFreeExplainRowCtx(*pRowCtx);
*pRowCtx = NULL;
}
......
......@@ -527,7 +527,7 @@ int32_t schValidateAndBuildJobExplain(SQueryPlan *pDag, SSchJob *pJob) {
SSchExplainGroup group = {.nodeNum = 1, .plan = plan};
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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册