diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index f1f60cb8e5e39d5c55eac192bca799a04a17b59f..60ad3ba451361fcb0f00c61f03e16ed7999cc0ac 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -209,6 +209,7 @@ typedef enum EFuncDataRequired { } EFuncDataRequired; EFuncDataRequired fmFuncDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWindow); +EFuncDataRequired fmFuncDynDataRequired(int32_t funcId, void* pRes, STimeWindow* pTimeWindow); int32_t fmGetFuncExecFuncs(int32_t funcId, SFuncExecFuncs* pFpSet); int32_t fmGetScalarFuncExecFuncs(int32_t funcId, SScalarFuncExecFuncs* pFpSet); diff --git a/source/libs/function/inc/builtins.h b/source/libs/function/inc/builtins.h index 256500ff8ce00e16fe0356da8fa1d7ce279e34ab..f5efcd520620c97e2dcec72e4a3c494124d23ff4 100644 --- a/source/libs/function/inc/builtins.h +++ b/source/libs/function/inc/builtins.h @@ -25,6 +25,7 @@ extern "C" { typedef int32_t (*FTranslateFunc)(SFunctionNode* pFunc, char* pErrBuf, int32_t len); typedef EFuncDataRequired (*FFuncDataRequired)(SFunctionNode* pFunc, STimeWindow* pTimeWindow); typedef int32_t (*FCreateMergeFuncParameters)(SNodeList* pRawParameters, SNode* pPartialRes, SNodeList** pParameters); +typedef EFuncDataRequired (*FFuncDynDataRequired)(void* pRes, STimeWindow* pTimeWindow); typedef struct SBuiltinFuncDefinition { const char* name; @@ -32,6 +33,7 @@ typedef struct SBuiltinFuncDefinition { uint64_t classification; FTranslateFunc translateFunc; FFuncDataRequired dataRequiredFunc; + FFuncDynDataRequired dynDataRequiredFunc; FExecGetEnv getEnvFunc; FExecInit initFunc; FExecProcess processFunc; diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index c173522683c7403950d915a9d1fa2d82eb828d1f..020fd648e1e7a404c980a9576d5a6a73ac52487f 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -103,6 +103,13 @@ EFuncDataRequired fmFuncDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWin return funcMgtBuiltins[pFunc->funcId].dataRequiredFunc(pFunc, pTimeWindow); } +EFuncDataRequired fmFuncDynDataRequired(int32_t funcId, void* pRes, STimeWindow* pTimeWindow) { + if (fmIsUserDefinedFunc(funcId) || funcId < 0 || funcId >= funcMgtBuiltinsNum) { + return TSDB_CODE_FAILED; + } + return funcMgtBuiltins[funcId].dynDataRequiredFunc(pRes, pTimeWindow); +} + int32_t fmGetFuncExecFuncs(int32_t funcId, SFuncExecFuncs* pFpSet) { if (fmIsUserDefinedFunc(funcId) || funcId < 0 || funcId >= funcMgtBuiltinsNum) { return TSDB_CODE_FAILED;