fix: set udf column meta in udfd instead of udf
This commit is contained in:
parent
029444e1c2
commit
844a083033
|
@ -580,7 +580,10 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
|
||||||
switch (call->callType) {
|
switch (call->callType) {
|
||||||
case TSDB_UDF_CALL_SCALA_PROC: {
|
case TSDB_UDF_CALL_SCALA_PROC: {
|
||||||
SUdfColumn output = {0};
|
SUdfColumn output = {0};
|
||||||
|
output.colMeta.bytes = udf->outputLen;
|
||||||
|
output.colMeta.type = udf->outputType;
|
||||||
|
output.colMeta.precision = 0;
|
||||||
|
output.colMeta.scale = 0;
|
||||||
SUdfDataBlock input = {0};
|
SUdfDataBlock input = {0};
|
||||||
convertDataBlockToUdfDataBlock(&call->block, &input);
|
convertDataBlockToUdfDataBlock(&call->block, &input);
|
||||||
code = udf->scriptPlugin->udfScalarProcFunc(&input, &output, udf->scriptUdfCtx);
|
code = udf->scriptPlugin->udfScalarProcFunc(&input, &output, udf->scriptUdfCtx);
|
||||||
|
|
|
@ -14,11 +14,6 @@ DLL_EXPORT int32_t udf1_init() { return 0; }
|
||||||
DLL_EXPORT int32_t udf1_destroy() { return 0; }
|
DLL_EXPORT int32_t udf1_destroy() { return 0; }
|
||||||
|
|
||||||
DLL_EXPORT int32_t udf1(SUdfDataBlock *block, SUdfColumn *resultCol) {
|
DLL_EXPORT int32_t udf1(SUdfDataBlock *block, SUdfColumn *resultCol) {
|
||||||
SUdfColumnMeta *meta = &resultCol->colMeta;
|
|
||||||
meta->bytes = 4;
|
|
||||||
meta->type = TSDB_DATA_TYPE_INT;
|
|
||||||
meta->scale = 0;
|
|
||||||
meta->precision = 0;
|
|
||||||
|
|
||||||
SUdfColumnData *resultData = &resultCol->colData;
|
SUdfColumnData *resultData = &resultCol->colData;
|
||||||
resultData->numOfRows = block->numOfRows;
|
resultData->numOfRows = block->numOfRows;
|
||||||
|
|
Loading…
Reference in New Issue