enh(query): add new api.
This commit is contained in:
parent
45d379473f
commit
0f92fb02f9
|
@ -868,7 +868,7 @@ int32_t encodeOperator(SOperatorInfo* ops, char** data, int32_t *length);
|
||||||
* length: the length of data
|
* length: the length of data
|
||||||
* return: result code, 0 means success
|
* return: result code, 0 means success
|
||||||
*/
|
*/
|
||||||
int32_t decodeOperator(SOperatorInfo* ops, char* data, int32_t length);
|
int32_t decodeOperator(SOperatorInfo* ops, const char* data, int32_t length);
|
||||||
|
|
||||||
void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status);
|
void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status);
|
||||||
int32_t createExecTaskInfoImpl(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
|
int32_t createExecTaskInfoImpl(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
|
||||||
|
|
|
@ -219,4 +219,20 @@ int32_t qGetExplainExecInfo(qTaskInfo_t tinfo, int32_t *resNum, SExplainExecInfo
|
||||||
return getOperatorExplainExecInfo(pTaskInfo->pRoot, pRes, &capacity, resNum);
|
return getOperatorExplainExecInfo(pTaskInfo->pRoot, pRes, &capacity, resNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t qSerializeTaskStatus(SExecTaskInfo* pTaskInfo, char** pOutput, int32_t* len) {
|
||||||
|
if (pTaskInfo->pRoot == NULL) {
|
||||||
|
return TSDB_CODE_INVALID_PARA;
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodeOperator(pTaskInfo->pRoot, pOutput, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t qDeserializeTaskStatus(SExecTaskInfo* pTaskInfo, const char* pInput, int32_t len) {
|
||||||
|
if (pTaskInfo == NULL || pInput == NULL || len == 0) {
|
||||||
|
return TSDB_CODE_INVALID_PARA;
|
||||||
|
}
|
||||||
|
|
||||||
|
return decodeOperator(pTaskInfo->pRoot, pInput, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4515,15 +4515,17 @@ int32_t encodeOperator(SOperatorInfo* ops, char** result, int32_t* length) {
|
||||||
return TDB_CODE_SUCCESS;
|
return TDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t decodeOperator(SOperatorInfo* ops, char* result, int32_t length) {
|
int32_t decodeOperator(SOperatorInfo* ops, const char* result, int32_t length) {
|
||||||
int32_t code = TDB_CODE_SUCCESS;
|
int32_t code = TDB_CODE_SUCCESS;
|
||||||
if (ops->fpSet.decodeResultRow) {
|
if (ops->fpSet.decodeResultRow) {
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
return TSDB_CODE_TSC_INVALID_INPUT;
|
return TSDB_CODE_TSC_INVALID_INPUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(length == *(int32_t*)result);
|
ASSERT(length == *(int32_t*)result);
|
||||||
char* data = result + sizeof(int32_t);
|
|
||||||
code = ops->fpSet.decodeResultRow(ops, data);
|
const char* data = result + sizeof(int32_t);
|
||||||
|
code = ops->fpSet.decodeResultRow(ops, (char*) data);
|
||||||
if (code != TDB_CODE_SUCCESS) {
|
if (code != TDB_CODE_SUCCESS) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue