fix: unitest error
This commit is contained in:
parent
bdb7e95582
commit
e792c1a986
|
@ -232,6 +232,15 @@ bool fmIsInterpFunc(int32_t funcId) {
|
|||
|
||||
bool fmIsInterpPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_INTERP_PC_FUNC); }
|
||||
|
||||
bool fmIsForecastFunc(int32_t funcId) {
|
||||
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
|
||||
return false;
|
||||
}
|
||||
return FUNCTION_TYPE_FORECAST == funcMgtBuiltins[funcId].type;
|
||||
}
|
||||
|
||||
bool fmIsForecastPseudoColumnFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORECAST_PC_FUNC); }
|
||||
|
||||
bool fmIsLastRowFunc(int32_t funcId) {
|
||||
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
|
||||
return false;
|
||||
|
|
|
@ -1367,6 +1367,25 @@ _err:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createAnomalyWindowNode(SAstCreateContext* pCxt, SNode* pExpr, const SToken* pFuncOpt) {
|
||||
SAnomalyWindowNode* pAnomaly = NULL;
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_ANOMALY_WINDOW, (SNode**)&pAnomaly);
|
||||
CHECK_MAKE_NODE(pAnomaly);
|
||||
pAnomaly->pCol = createPrimaryKeyCol(pCxt, NULL);
|
||||
CHECK_MAKE_NODE(pAnomaly->pCol);
|
||||
pAnomaly->pExpr = pExpr;
|
||||
if (pFuncOpt == NULL) {
|
||||
tstrncpy(pAnomaly->anomalyOpt, "algo=iqr", TSDB_ANAL_ALGO_OPTION_LEN);
|
||||
} else {
|
||||
(void)trimString(pFuncOpt->z, pFuncOpt->n, pAnomaly->anomalyOpt, sizeof(pAnomaly->anomalyOpt));
|
||||
}
|
||||
return (SNode*)pAnomaly;
|
||||
_err:
|
||||
nodesDestroyNode((SNode*)pAnomaly);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding,
|
||||
SNode* pFill) {
|
||||
SIntervalWindowNode* interval = NULL;
|
||||
|
@ -2997,6 +3016,47 @@ _err:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createCreateAnodeStmt(SAstCreateContext* pCxt, const SToken* pUrl) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
SCreateAnodeStmt* pStmt = NULL;
|
||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_CREATE_ANODE_STMT, (SNode**)&pStmt);
|
||||
CHECK_MAKE_NODE(pStmt);
|
||||
(void)trimString(pUrl->z, pUrl->n, pStmt->url, sizeof(pStmt->url));
|
||||
return (SNode*)pStmt;
|
||||
_err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createDropAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
SUpdateAnodeStmt* pStmt = NULL;
|
||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_DROP_ANODE_STMT, (SNode**)&pStmt);
|
||||
CHECK_MAKE_NODE(pStmt);
|
||||
if (NULL != pAnode) {
|
||||
pStmt->anodeId = taosStr2Int32(pAnode->z, NULL, 10);
|
||||
} else {
|
||||
pStmt->anodeId = -1;
|
||||
}
|
||||
return (SNode*)pStmt;
|
||||
_err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createUpdateAnodeStmt(SAstCreateContext* pCxt, const SToken* pAnode, bool updateAll) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
SUpdateAnodeStmt* pStmt = NULL;
|
||||
pCxt->errCode = nodesMakeNode(QUERY_NODE_UPDATE_ANODE_STMT, (SNode**)&pStmt);
|
||||
CHECK_MAKE_NODE(pStmt);
|
||||
if (NULL != pAnode) {
|
||||
pStmt->anodeId = taosStr2Int32(pAnode->z, NULL, 10);
|
||||
} else {
|
||||
pStmt->anodeId = -1;
|
||||
}
|
||||
return (SNode*)pStmt;
|
||||
_err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* createEncryptKeyStmt(SAstCreateContext* pCxt, const SToken* pValue) {
|
||||
SToken config;
|
||||
config.type = TK_NK_STRING;
|
||||
|
|
|
@ -185,6 +185,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
|
|||
return "%s is not supported in system table query";
|
||||
case TSDB_CODE_PAR_INVALID_INTERP_CLAUSE:
|
||||
return "Invalid usage of RANGE clause, EVERY clause or FILL clause";
|
||||
case TSDB_CODE_PAR_INVALID_FORECAST_CLAUSE:
|
||||
return "Invalid usage of forecast clause";
|
||||
case TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN:
|
||||
return "No valid function in window query";
|
||||
case TSDB_CODE_PAR_INVALID_OPTR_USAGE:
|
||||
|
|
|
@ -2380,6 +2380,8 @@ static bool sortPriKeyOptHasUnsupportedPkFunc(SLogicNode* pLogicNode, EOrder sor
|
|||
case QUERY_NODE_LOGIC_PLAN_INTERP_FUNC:
|
||||
pFuncList = ((SInterpFuncLogicNode*)pLogicNode)->pFuncs;
|
||||
break;
|
||||
case QUERY_NODE_LOGIC_PLAN_FORECAST_FUNC:
|
||||
pFuncList = ((SForecastFuncLogicNode*)pLogicNode)->pFuncs;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue