fix: make udfinfo temporary

This commit is contained in:
slzhou 2023-02-14 17:14:41 +08:00
parent 2e266771b1
commit 6b09b72a63
2 changed files with 5 additions and 8 deletions

View File

@ -73,6 +73,7 @@ typedef struct SUdfDataBlock {
SUdfColumn **udfCols;
} SUdfDataBlock;
// TODO: deprecate SUdfInterBuf.numOfResult or add isInitial to SUdfInterBuf
typedef struct SUdfInterBuf {
int32_t bufLen;
char *buf;
@ -260,11 +261,9 @@ typedef int32_t (*TUdfAggMergeFunc)(SUdfInterBuf *inputBuf1, SUdfInterBuf *input
typedef int32_t (*TUdfAggFinishFunc)(SUdfInterBuf *buf, SUdfInterBuf *resultData);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TODO: capacity for path and
// define macro for name and path len or use dynamic allocation/shared with SUdf.
typedef struct SUdfInfo {
char name[65];
char *name;
int8_t funcType;
int8_t scriptType;
@ -272,11 +271,9 @@ typedef struct SUdfInfo {
int32_t outputLen;
int32_t bufSize;
char path[512];
char *path;
} SUdfInfo;
// TODO: deprecate SUdfInterBuf.numOfResult or add isInitial to SUdfInterBuf
typedef int32_t (*TScriptUdfScalarProcFunc)(SUdfDataBlock *block, SUdfColumn *resultCol, void *udfCtx);
typedef int32_t (*TScriptUdfAggStartFunc)(SUdfInterBuf *buf, void *udfCtx);

View File

@ -414,10 +414,10 @@ void udfdProcessRequest(uv_work_t *req) {
void convertUdf2UdfInfo(SUdf *udf, SUdfInfo *udfInfo) {
udfInfo->bufSize = udf->bufSize;
udfInfo->funcType = udf->funcType;
strncpy(udfInfo->name, udf->name, strlen(udf->name));
udfInfo->name = udf->name;
udfInfo->outputLen = udf->outputLen;
udfInfo->outputType = udf->outputType;
strncpy(udfInfo->path, udf->path, strlen(udf->path));
udfInfo->path = udf->path;
udfInfo->scriptType = udf->scriptType;
}