fix: data load required

This commit is contained in:
factosea 2025-01-14 17:04:07 +08:00
parent c7aa9f01f4
commit 11d34f728a
1 changed files with 27 additions and 0 deletions

View File

@ -771,7 +771,34 @@ bool getSumFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
return true; return true;
} }
static bool funcNotSupportStringSma(SFunctionNode* pFunc) {
SNode* pParam;
switch (pFunc->funcType) {
case FUNCTION_TYPE_MAX:
case FUNCTION_TYPE_MIN:
case FUNCTION_TYPE_SUM:
case FUNCTION_TYPE_AVG:
case FUNCTION_TYPE_AVG_PARTIAL:
case FUNCTION_TYPE_PERCENTILE:
case FUNCTION_TYPE_SPREAD:
case FUNCTION_TYPE_SPREAD_PARTIAL:
case FUNCTION_TYPE_SPREAD_MERGE:
case FUNCTION_TYPE_TWA:
pParam = nodesListGetNode(pFunc->pParameterList, 0);
if (pParam && nodesIsExprNode(pParam) && (IS_VAR_DATA_TYPE(((SExprNode*)pParam)->resType.type))) {
return true;
}
break;
default:
break;
}
return false;
}
EFuncDataRequired statisDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWindow) { EFuncDataRequired statisDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWindow) {
if(funcNotSupportStringSma(pFunc)) {
return FUNC_DATA_REQUIRED_DATA_LOAD;
}
return FUNC_DATA_REQUIRED_SMA_LOAD; return FUNC_DATA_REQUIRED_SMA_LOAD;
} }