agg proc func parameter change
This commit is contained in:
parent
0119054b0b
commit
ba5123ad24
|
@ -140,7 +140,7 @@ typedef int32_t (*TUdfFreeUdfColumnFunc)(SUdfColumn* column);
|
|||
typedef int32_t (*TUdfScalarProcFunc)(SUdfDataBlock* block, SUdfColumn *resultCol);
|
||||
|
||||
typedef int32_t (*TUdfAggStartFunc)(SUdfInterBuf *buf);
|
||||
typedef int32_t (*TUdfAggProcessFunc)(SUdfDataBlock* block, SUdfInterBuf *interBuf);
|
||||
typedef int32_t (*TUdfAggProcessFunc)(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInterBuf *newInterBuf);
|
||||
typedef int32_t (*TUdfAggFinishFunc)(SUdfInterBuf* buf, SUdfInterBuf *resultData);
|
||||
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ void udfdProcessRequest(uv_work_t *req) {
|
|||
SUdfInterBuf outBuf = {.buf = taosMemoryMalloc(udf->bufSize),
|
||||
.bufLen= udf->bufSize,
|
||||
.numOfResult = 0};
|
||||
udf->aggProcFunc(&input, &outBuf);
|
||||
udf->aggProcFunc(&input, &call->interBuf, &outBuf);
|
||||
subRsp->resultBuf = outBuf;
|
||||
|
||||
break;
|
||||
|
|
|
@ -24,7 +24,7 @@ int32_t udf2_start(SUdfInterBuf *buf) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf) {
|
||||
int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInterBuf *newInterBuf) {
|
||||
int64_t sumSquares = *(int64_t*)interBuf->buf;
|
||||
for (int32_t i = 0; i < block->numOfCols; ++i) {
|
||||
for (int32_t j = 0; j < block->numOfRows; ++i) {
|
||||
|
@ -35,10 +35,10 @@ int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf) {
|
|||
}
|
||||
}
|
||||
|
||||
*(int64_t*)interBuf = sumSquares;
|
||||
interBuf->bufLen = sizeof(int64_t);
|
||||
*(int64_t*)newInterBuf = sumSquares;
|
||||
newInterBuf->bufLen = sizeof(int64_t);
|
||||
//TODO: if all null value, numOfResult = 0;
|
||||
interBuf->numOfResult = 1;
|
||||
newInterBuf->numOfResult = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue