From 41a213a9048471a1284c3f5c81fbeb134bcdd5e1 Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 26 Apr 2022 16:57:08 +0800 Subject: [PATCH] scalar api change --- .../libs/function/inc => include/libs/function}/tudf.h | 0 source/dnode/qnode/src/qnode.c | 8 +++++--- source/libs/scalar/src/scalar.c | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) rename {source/libs/function/inc => include/libs/function}/tudf.h (100%) diff --git a/source/libs/function/inc/tudf.h b/include/libs/function/tudf.h similarity index 100% rename from source/libs/function/inc/tudf.h rename to include/libs/function/tudf.h diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c index 907fddaec2..7a226a4c6b 100644 --- a/source/dnode/qnode/src/qnode.c +++ b/source/dnode/qnode/src/qnode.c @@ -17,7 +17,7 @@ #include "qndInt.h" #include "query.h" #include "qworker.h" -//#include "tudf.h" +#include "libs/function/function.h" SQnode *qndOpen(const SQnodeOpt *pOption) { SQnode *pQnode = taosMemoryCalloc(1, sizeof(SQnode)); @@ -26,7 +26,9 @@ SQnode *qndOpen(const SQnodeOpt *pOption) { return NULL; } - //udfcOpen(); + if (udfcOpen() != 0) { + qError("qnode can not open udfc"); + } if (qWorkerInit(NODE_TYPE_QNODE, pQnode->qndId, NULL, (void **)&pQnode->pQuery, &pOption->msgCb)) { taosMemoryFreeClear(pQnode); @@ -40,7 +42,7 @@ SQnode *qndOpen(const SQnodeOpt *pOption) { void qndClose(SQnode *pQnode) { qWorkerDestroy((void **)&pQnode->pQuery); - //udfcClose(); + udfcClose(); taosMemoryFree(pQnode); } diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index 820a4894b5..3b91c36ab4 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -7,6 +7,7 @@ #include "tcommon.h" #include "tdatablock.h" #include "scalar.h" +#include "tudf.h" int32_t scalarGetOperatorParamNum(EOperatorType type) { if (OP_TYPE_IS_NULL == type || OP_TYPE_IS_NOT_NULL == type || OP_TYPE_IS_TRUE == type || OP_TYPE_IS_NOT_TRUE == type @@ -336,14 +337,12 @@ int32_t sclExecFunction(SFunctionNode *node, SScalarCtx *ctx, SScalarParam *outp SCL_ERR_RET(sclInitParamList(¶ms, node->pParameterList, ctx, ¶mNum, &rowNum)); if (fmIsUserDefinedFunc(node->funcId)) { -#if 0 UdfcFuncHandle udfHandle = NULL; SCL_ERR_JRET(setupUdf(node->functionName, &udfHandle)); code = callUdfScalarFunc(udfHandle, params, paramNum, output); teardownUdf(udfHandle); SCL_ERR_JRET(code); -#endif } else { SScalarFuncExecFuncs ffpSet = {0}; code = fmGetScalarFuncExecFuncs(node->funcId, &ffpSet); -- GitLab