提交 103418bf 编写于 作者: X Xiaoyu Wang

fix: some problems of udf and 'create table'

上级 14e9fa35
...@@ -46,7 +46,7 @@ typedef struct SExprNode { ...@@ -46,7 +46,7 @@ typedef struct SExprNode {
ENodeType type; ENodeType type;
SDataType resType; SDataType resType;
char aliasName[TSDB_COL_NAME_LEN]; char aliasName[TSDB_COL_NAME_LEN];
SNodeList* pAssociationList; SArray* pAssociation;
} SExprNode; } SExprNode;
typedef enum EColumnType { typedef enum EColumnType {
...@@ -81,7 +81,6 @@ typedef struct SValueNode { ...@@ -81,7 +81,6 @@ typedef struct SValueNode {
char* literal; char* literal;
bool isDuration; bool isDuration;
bool translate; bool translate;
bool genByCalc;
int16_t placeholderNo; int16_t placeholderNo;
union { union {
bool b; bool b;
......
...@@ -120,7 +120,7 @@ const char *taos_errstr(TAOS_RES *res) { ...@@ -120,7 +120,7 @@ const char *taos_errstr(TAOS_RES *res) {
return (const char *)tstrerror(terrno); return (const char *)tstrerror(terrno);
} }
if (strlen(pRequest->msgBuf) > 0 || pRequest->code == TSDB_CODE_RPC_FQDN_ERROR) { if (NULL != pRequest->msgBuf && (strlen(pRequest->msgBuf) > 0 || pRequest->code == TSDB_CODE_RPC_FQDN_ERROR)) {
return pRequest->msgBuf; return pRequest->msgBuf;
} else { } else {
return (const char *)tstrerror(pRequest->code); return (const char *)tstrerror(pRequest->code);
......
...@@ -1663,7 +1663,7 @@ static int32_t jsonToColumnNode(const SJson* pJson, void* pObj) { ...@@ -1663,7 +1663,7 @@ static int32_t jsonToColumnNode(const SJson* pJson, void* pObj) {
return code; return code;
} }
static const char* jkValueGenByCalc = "GenByCalc"; static const char* jkValueLiteralSize = "LiteralSize";
static const char* jkValueLiteral = "Literal"; static const char* jkValueLiteral = "Literal";
static const char* jkValueDuration = "Duration"; static const char* jkValueDuration = "Duration";
static const char* jkValueTranslate = "Translate"; static const char* jkValueTranslate = "Translate";
...@@ -1717,9 +1717,9 @@ static int32_t valueNodeToJson(const void* pObj, SJson* pJson) { ...@@ -1717,9 +1717,9 @@ static int32_t valueNodeToJson(const void* pObj, SJson* pJson) {
int32_t code = exprNodeToJson(pObj, pJson); int32_t code = exprNodeToJson(pObj, pJson);
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
code = tjsonAddBoolToObject(pJson, jkValueGenByCalc, pNode->genByCalc); code = tjsonAddIntegerToObject(pJson, jkValueLiteralSize, NULL != pNode->literal ? strlen(pNode->literal) : 0);
} }
if (TSDB_CODE_SUCCESS == code && !pNode->genByCalc) { if (TSDB_CODE_SUCCESS == code && NULL != pNode->literal) {
code = tjsonAddStringToObject(pJson, jkValueLiteral, pNode->literal); code = tjsonAddStringToObject(pJson, jkValueLiteral, pNode->literal);
} }
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
...@@ -1789,10 +1789,11 @@ static int32_t jsonToValueNode(const SJson* pJson, void* pObj) { ...@@ -1789,10 +1789,11 @@ static int32_t jsonToValueNode(const SJson* pJson, void* pObj) {
SValueNode* pNode = (SValueNode*)pObj; SValueNode* pNode = (SValueNode*)pObj;
int32_t code = jsonToExprNode(pJson, pObj); int32_t code = jsonToExprNode(pJson, pObj);
int32_t literalSize = 0;
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
code = tjsonGetBoolValue(pJson, jkValueGenByCalc, &pNode->genByCalc); code = tjsonGetIntValue(pJson, jkValueLiteralSize, &literalSize);
} }
if (TSDB_CODE_SUCCESS == code && !pNode->genByCalc) { if (TSDB_CODE_SUCCESS == code && literalSize > 0) {
code = tjsonDupStringValue(pJson, jkValueLiteral, &pNode->literal); code = tjsonDupStringValue(pJson, jkValueLiteral, &pNode->literal);
} }
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
......
...@@ -24,109 +24,37 @@ typedef struct SCalcConstContext { ...@@ -24,109 +24,37 @@ typedef struct SCalcConstContext {
int32_t code; int32_t code;
} SCalcConstContext; } SCalcConstContext;
static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt); static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subquery);
static EDealRes doCalcConst(SNode** pNode, SCalcConstContext* pCxt) { static int32_t calcConstSubquery(SCalcConstContext* pCxt, STempTableNode* pTempTable) {
SNode* pNew = NULL; return calcConstQuery(pCxt, pTempTable->pSubquery, true);
pCxt->code = scalarCalculateConstants(*pNode, &pNew);
if (TSDB_CODE_SUCCESS != pCxt->code) {
return DEAL_RES_ERROR;
}
((SValueNode*)pNew)->genByCalc = true;
((SValueNode*)pNew)->translate = true;
*pNode = pNew;
return DEAL_RES_CONTINUE;
}
static bool isTimestampCol(SNode* pNode) {
if (NULL == pNode) {
return false;
}
return (QUERY_NODE_COLUMN == nodeType(pNode) && TSDB_DATA_TYPE_TIMESTAMP == ((SExprNode*)pNode)->resType.type);
}
static EDealRes stringToTimestamp(SCalcConstContext* pCxt, uint8_t precision, SValueNode* pVal) {
switch (pVal->node.resType.type) {
case TSDB_DATA_TYPE_VARCHAR:
case TSDB_DATA_TYPE_NCHAR:
case TSDB_DATA_TYPE_VARBINARY: {
int64_t val = 0;
if (TSDB_CODE_SUCCESS != convertStringToTimestamp(pVal->node.resType.type, pVal->datum.p, precision, &val)) {
pCxt->code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCORRECT_TIMESTAMP_VAL, varDataVal(pVal->datum.p));
return DEAL_RES_ERROR;
}
pVal->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP;
pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes;
taosMemoryFreeClear(pVal->datum.p);
pVal->datum.i = val;
break;
}
default:
break;
}
return DEAL_RES_CONTINUE;
} }
static EDealRes calcConstOperator(SOperatorNode** pNode, void* pContext) { static int32_t calcConstNode(SNode** pNode) {
SCalcConstContext* pCxt = pContext; if (NULL == *pNode) {
SOperatorNode* pOp = *pNode; return TSDB_CODE_SUCCESS;
if (QUERY_NODE_VALUE == nodeType(pOp->pLeft) && (NULL == pOp->pRight || QUERY_NODE_VALUE == nodeType(pOp->pRight))) {
return doCalcConst((SNode**)pNode, pCxt);
}
if (isTimestampCol(pOp->pLeft) && (NULL == pOp->pRight || QUERY_NODE_VALUE == nodeType(pOp->pRight))) {
return stringToTimestamp(pCxt, ((SColumnNode*)pOp->pLeft)->node.resType.precision, (SValueNode*)pOp->pRight);
} else if (isTimestampCol(pOp->pRight) && QUERY_NODE_VALUE == nodeType(pOp->pLeft)) {
return stringToTimestamp(pCxt, ((SColumnNode*)pOp->pRight)->node.resType.precision, (SValueNode*)pOp->pLeft);
} }
return DEAL_RES_CONTINUE;
}
static EDealRes calcConstFunction(SFunctionNode** pNode, void* pContext) { SNode* pNew = NULL;
SFunctionNode* pFunc = *pNode; int32_t code = scalarCalculateConstants(*pNode, &pNew);
if (!fmIsScalarFunc(pFunc->funcId) || fmIsUserDefinedFunc(pFunc->funcId)) { if (TSDB_CODE_SUCCESS == code) {
return DEAL_RES_CONTINUE; *pNode = pNew;
}
SNode* pParam = NULL;
FOREACH(pParam, pFunc->pParameterList) {
if (QUERY_NODE_VALUE != nodeType(pParam)) {
return DEAL_RES_CONTINUE;
}
} }
return doCalcConst((SNode**)pNode, (SCalcConstContext*)pContext); return code;
} }
static EDealRes calcConstLogicCond(SLogicConditionNode** pNode, void* pContext) { static int32_t calcConstList(SNodeList* pList) {
SLogicConditionNode* pCond = *pNode; SNode* pNode = NULL;
SNode* pParam = NULL; FOREACH(pNode, pList) {
FOREACH(pParam, pCond->pParameterList) { SNode* pNew = NULL;
// todo calc "true and c1 > 10" int32_t code = scalarCalculateConstants(pNode, &pNew);
if (QUERY_NODE_VALUE != nodeType(pParam)) { if (TSDB_CODE_SUCCESS == code) {
return DEAL_RES_CONTINUE; REPLACE_NODE(pNew);
} else {
return code;
} }
} }
return doCalcConst((SNode**)pNode, (SCalcConstContext*)pContext); return TSDB_CODE_SUCCESS;
}
static EDealRes calcConstSubquery(STempTableNode** pNode, void* pContext) {
SCalcConstContext* pCxt = pContext;
pCxt->code = calcConstQuery(pCxt, (*pNode)->pSubquery);
return (TSDB_CODE_SUCCESS == pCxt->code ? DEAL_RES_CONTINUE : DEAL_RES_ERROR);
}
static EDealRes calcConst(SNode** pNode, void* pContext) {
switch (nodeType(*pNode)) {
case QUERY_NODE_OPERATOR:
return calcConstOperator((SOperatorNode**)pNode, pContext);
case QUERY_NODE_FUNCTION:
return calcConstFunction((SFunctionNode**)pNode, pContext);
case QUERY_NODE_LOGIC_CONDITION:
return calcConstLogicCond((SLogicConditionNode**)pNode, pContext);
case QUERY_NODE_TEMP_TABLE:
return calcConstSubquery((STempTableNode**)pNode, pContext);
default:
break;
}
return DEAL_RES_CONTINUE;
} }
static bool isCondition(const SNode* pNode) { static bool isCondition(const SNode* pNode) {
...@@ -174,18 +102,41 @@ static int32_t rewriteCondition(SCalcConstContext* pCxt, SNode** pNode) { ...@@ -174,18 +102,41 @@ static int32_t rewriteCondition(SCalcConstContext* pCxt, SNode** pNode) {
return pCxt->code; return pCxt->code;
} }
static int32_t calcConstCondition(SCalcConstContext* pCxt, SNode** pNode) {
int32_t code = rewriteCondition(pCxt, pNode);
if (TSDB_CODE_SUCCESS == code) {
code = calcConstNode(pNode);
}
return code;
}
static int32_t rewriteConditionForFromTable(SCalcConstContext* pCxt, SNode* pTable) { static int32_t rewriteConditionForFromTable(SCalcConstContext* pCxt, SNode* pTable) {
if (QUERY_NODE_JOIN_TABLE == nodeType(pTable)) { int32_t code = TSDB_CODE_SUCCESS;
SJoinTableNode* pJoin = (SJoinTableNode*)pTable; switch (nodeType(pTable)) {
pCxt->code = rewriteConditionForFromTable(pCxt, pJoin->pLeft); case QUERY_NODE_TEMP_TABLE: {
if (TSDB_CODE_SUCCESS == pCxt->code) { code = calcConstSubquery(pCxt, (STempTableNode*)pTable);
pCxt->code = rewriteConditionForFromTable(pCxt, pJoin->pRight); break;
}
if (TSDB_CODE_SUCCESS == pCxt->code && NULL != pJoin->pOnCond) {
pCxt->code = rewriteCondition(pCxt, &pJoin->pOnCond);
} }
case QUERY_NODE_JOIN_TABLE: {
SJoinTableNode* pJoin = (SJoinTableNode*)pTable;
code = rewriteConditionForFromTable(pCxt, pJoin->pLeft);
if (TSDB_CODE_SUCCESS == code) {
code = rewriteConditionForFromTable(pCxt, pJoin->pRight);
}
if (TSDB_CODE_SUCCESS == code && NULL != pJoin->pOnCond) {
code = calcConstCondition(pCxt, &pJoin->pOnCond);
}
// todo empty table
break;
}
default:
break;
} }
return pCxt->code; return code;
}
static int32_t calcConstFromTable(SCalcConstContext* pCxt, SSelectStmt* pSelect) {
return rewriteConditionForFromTable(pCxt, pSelect->pFromTable);
} }
static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) { static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) {
...@@ -200,77 +151,133 @@ static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) { ...@@ -200,77 +151,133 @@ static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) {
} }
} }
static int32_t calcConstFromTable(SCalcConstContext* pCxt, SSelectStmt* pSelect) { static int32_t calcConstSelectCondition(SCalcConstContext* pCxt, SSelectStmt* pSelect, SNode** pCond) {
pCxt->code = rewriteConditionForFromTable(pCxt, pSelect->pFromTable);
if (TSDB_CODE_SUCCESS == pCxt->code) {
nodesRewriteExprPostOrder(&pSelect->pFromTable, calcConst, pCxt);
}
return pCxt->code;
}
static int32_t calcConstCondition(SCalcConstContext* pCxt, SSelectStmt* pSelect, SNode** pCond) {
if (NULL == *pCond) { if (NULL == *pCond) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
pCxt->code = rewriteCondition(pCxt, pCond); int32_t code = rewriteCondition(pCxt, pCond);
if (TSDB_CODE_SUCCESS == pCxt->code) { if (TSDB_CODE_SUCCESS == code) {
nodesRewriteExprPostOrder(pCond, calcConst, pCxt); code = calcConstNode(pCond);
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { if (TSDB_CODE_SUCCESS == code) {
rewriteConstCondition(pSelect, pCond); rewriteConstCondition(pSelect, pCond);
} }
return pCxt->code; return code;
} }
static int32_t calcConstSelect(SCalcConstContext* pCxt, SSelectStmt* pSelect) { static int32_t calcConstProject(SNode* pProject, SNode** pNew) {
nodesRewriteExprsPostOrder(pSelect->pProjectionList, calcConst, pCxt); SArray* pAssociation = NULL;
if (TSDB_CODE_SUCCESS == pCxt->code) { if (NULL != ((SExprNode*)pProject)->pAssociation) {
pCxt->code = calcConstFromTable(pCxt, pSelect); pAssociation == taosArrayDup(((SExprNode*)pProject)->pAssociation);
if (NULL == pAssociation) {
return TSDB_CODE_OUT_OF_MEMORY;
}
} }
if (TSDB_CODE_SUCCESS == pCxt->code) {
pCxt->code = calcConstCondition(pCxt, pSelect, &pSelect->pWhere); int32_t code = scalarCalculateConstants(pProject, pNew);
if (TSDB_CODE_SUCCESS == code && QUERY_NODE_VALUE == nodeType(pNew) && NULL != pAssociation) {
int32_t size = taosArrayGetSize(pAssociation);
for (int32_t i = 0; i < size; ++i) {
SNode** pCol = taosArrayGet(pAssociation, i);
*pCol = nodesCloneNode(pNew);
if (NULL == *pCol) {
return TSDB_CODE_OUT_OF_MEMORY;
}
}
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { return code;
nodesRewriteExprsPostOrder(pSelect->pPartitionByList, calcConst, pCxt); }
static int32_t calcConstProjections(SCalcConstContext* pCxt, SNodeList* pProjections, bool subquery) {
SNode* pProj = NULL;
WHERE_EACH(pProj, pProjections) {
if (subquery && NULL == ((SExprNode*)pProj)->pAssociation) {
ERASE_NODE(pProjections);
continue;
}
SNode* pNew = NULL;
int32_t code = calcConstProject(pProj, &pNew);
if (TSDB_CODE_SUCCESS == code) {
REPLACE_NODE(pNew);
} else {
return code;
}
WHERE_NEXT;
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { return TSDB_CODE_SUCCESS;
nodesRewriteExprPostOrder(&pSelect->pWindow, calcConst, pCxt); }
static int32_t calcConstSelect(SCalcConstContext* pCxt, SSelectStmt* pSelect, bool subquery) {
int32_t code = calcConstProjections(pCxt, pSelect->pProjectionList, subquery);
if (TSDB_CODE_SUCCESS == code) {
code = calcConstFromTable(pCxt, pSelect);
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { if (TSDB_CODE_SUCCESS == code) {
nodesRewriteExprsPostOrder(pSelect->pGroupByList, calcConst, pCxt); code = calcConstSelectCondition(pCxt, pSelect, &pSelect->pWhere);
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { if (TSDB_CODE_SUCCESS == code) {
pCxt->code = calcConstCondition(pCxt, pSelect, &pSelect->pHaving); code = calcConstList(pSelect->pPartitionByList);
} }
if (TSDB_CODE_SUCCESS == pCxt->code) { if (TSDB_CODE_SUCCESS == code) {
nodesRewriteExprsPostOrder(pSelect->pOrderByList, calcConst, pCxt); code = calcConstNode(&pSelect->pWindow);
} }
return pCxt->code; if (TSDB_CODE_SUCCESS == code) {
code = calcConstList(pSelect->pGroupByList);
}
if (TSDB_CODE_SUCCESS == code) {
code = calcConstSelectCondition(pCxt, pSelect, &pSelect->pHaving);
}
if (TSDB_CODE_SUCCESS == code) {
code = calcConstList(pSelect->pOrderByList);
}
return code;
} }
static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt) { static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subquery) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pStmt)) { switch (nodeType(pStmt)) {
case QUERY_NODE_SELECT_STMT: case QUERY_NODE_SELECT_STMT:
return calcConstSelect(pCxt, (SSelectStmt*)pStmt); code = calcConstSelect(pCxt, (SSelectStmt*)pStmt, subquery);
break;
case QUERY_NODE_EXPLAIN_STMT: case QUERY_NODE_EXPLAIN_STMT:
return calcConstQuery(pCxt, ((SExplainStmt*)pStmt)->pQuery); code = calcConstQuery(pCxt, ((SExplainStmt*)pStmt)->pQuery, subquery);
break;
case QUERY_NODE_SET_OPERATOR: {
SSetOperator* pSetOp = (SSetOperator*)pStmt;
code = calcConstQuery(pCxt, pSetOp->pLeft, subquery);
if (TSDB_CODE_SUCCESS == code) {
code = calcConstQuery(pCxt, pSetOp->pRight, subquery);
}
break;
}
default: default:
break; break;
} }
return TSDB_CODE_SUCCESS; return code;
} }
static bool isEmptyResultQuery(SNode* pStmt) { static bool isEmptyResultQuery(SNode* pStmt) {
bool isEmptyResult = false;
switch (nodeType(pStmt)) { switch (nodeType(pStmt)) {
case QUERY_NODE_SELECT_STMT: case QUERY_NODE_SELECT_STMT:
return ((SSelectStmt*)pStmt)->isEmptyResult; isEmptyResult = ((SSelectStmt*)pStmt)->isEmptyResult;
break;
case QUERY_NODE_EXPLAIN_STMT: case QUERY_NODE_EXPLAIN_STMT:
return isEmptyResultQuery(((SExplainStmt*)pStmt)->pQuery); isEmptyResult = isEmptyResultQuery(((SExplainStmt*)pStmt)->pQuery);
break;
case QUERY_NODE_SET_OPERATOR: {
SSetOperator* pSetOp = (SSetOperator*)pStmt;
isEmptyResult = isEmptyResultQuery(pSetOp->pLeft);
if (isEmptyResult) {
isEmptyResult = isEmptyResultQuery(pSetOp->pRight);
}
break;
}
default: default:
break; break;
} }
return false; return isEmptyResult;
} }
int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) { int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) {
...@@ -280,9 +287,9 @@ int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) { ...@@ -280,9 +287,9 @@ int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery) {
.msgBuf.len = pParseCxt->msgLen, .msgBuf.len = pParseCxt->msgLen,
.code = TSDB_CODE_SUCCESS .code = TSDB_CODE_SUCCESS
}; };
int32_t code = calcConstQuery(&cxt, pQuery->pRoot); int32_t code = calcConstQuery(&cxt, pQuery->pRoot, false);
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code && isEmptyResultQuery(pQuery->pRoot)) {
pQuery->execMode = isEmptyResultQuery(pQuery->pRoot) ? QUERY_EXEC_MODE_EMPTY_RESULT : pQuery->execMode; pQuery->execMode = QUERY_EXEC_MODE_EMPTY_RESULT;
} }
return code; return code;
} }
...@@ -306,7 +306,10 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p ...@@ -306,7 +306,10 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p
static void setColumnInfoByExpr(const STableNode* pTable, SExprNode* pExpr, SColumnNode* pCol) { static void setColumnInfoByExpr(const STableNode* pTable, SExprNode* pExpr, SColumnNode* pCol) {
pCol->pProjectRef = (SNode*)pExpr; pCol->pProjectRef = (SNode*)pExpr;
nodesListAppend(pExpr->pAssociationList, (SNode*)pCol); if (NULL == pExpr->pAssociation) {
pExpr->pAssociation = taosArrayInit(TARRAY_MIN_SIZE, POINTER_BYTES);
}
taosArrayPush(pExpr->pAssociation, &pCol);
if (NULL != pTable) { if (NULL != pTable) {
strcpy(pCol->tableAlias, pTable->tableAlias); strcpy(pCol->tableAlias, pTable->tableAlias);
} else if (QUERY_NODE_COLUMN == nodeType(pExpr)) { } else if (QUERY_NODE_COLUMN == nodeType(pExpr)) {
......
...@@ -511,6 +511,8 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) { ...@@ -511,6 +511,8 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
return DEAL_RES_ERROR; return DEAL_RES_ERROR;
} }
res->translate = true;
if (colDataIsNull_s(output.columnData, 0)) { if (colDataIsNull_s(output.columnData, 0)) {
res->node.resType.type = TSDB_DATA_TYPE_NULL; res->node.resType.type = TSDB_DATA_TYPE_NULL;
} else { } else {
...@@ -553,6 +555,7 @@ EDealRes sclRewriteLogic(SNode** pNode, SScalarCtx *ctx) { ...@@ -553,6 +555,7 @@ EDealRes sclRewriteLogic(SNode** pNode, SScalarCtx *ctx) {
} }
res->node.resType = node->node.resType; res->node.resType = node->node.resType;
res->translate = true;
int32_t type = output.columnData->info.type; int32_t type = output.columnData->info.type;
if (IS_VAR_DATA_TYPE(type)) { if (IS_VAR_DATA_TYPE(type)) {
...@@ -595,6 +598,7 @@ EDealRes sclRewriteOperator(SNode** pNode, SScalarCtx *ctx) { ...@@ -595,6 +598,7 @@ EDealRes sclRewriteOperator(SNode** pNode, SScalarCtx *ctx) {
} }
res->node.resType = node->node.resType; res->node.resType = node->node.resType;
res->translate = true;
int32_t type = output.columnData->info.type; int32_t type = output.columnData->info.type;
if (IS_VAR_DATA_TYPE(type)) { // todo refactor if (IS_VAR_DATA_TYPE(type)) { // todo refactor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册