[td-3188]
This commit is contained in:
parent
18cb7b36fc
commit
0d8dcc2972
|
@ -1073,7 +1073,6 @@ static void doExecuteFinalMerge(SSqlCmd *pCmd, SLocalMerger *pLocalMerge, bool n
|
|||
}
|
||||
|
||||
pCtx->currentStage = MERGE_STAGE;
|
||||
|
||||
if (needInit) {
|
||||
aAggs[pCtx->functionId].init(pCtx, pCtx->resultInfo);
|
||||
}
|
||||
|
|
|
@ -782,8 +782,14 @@ static void doApplyFunctions(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* pCtx
|
|||
}
|
||||
|
||||
if (functionNeedToExecute(pRuntimeEnv, &pCtx[k], functionId)) {
|
||||
// aAggs[functionId].xFunction(&pCtx[k]);
|
||||
if (functionId < 0) {
|
||||
// load the script and exec, pRuntimeEnv->pUdfInfo
|
||||
|
||||
} else {
|
||||
aAggs[functionId].xFunction(&pCtx[k]);
|
||||
}
|
||||
}
|
||||
|
||||
// restore it
|
||||
pCtx[k].preAggVals.isSet = hasPrev;
|
||||
|
@ -1009,19 +1015,31 @@ static void doAggregateImpl(SOperatorInfo* pOperator, TSKEY startTs, SQLFunction
|
|||
int32_t functionId = pCtx[k].functionId;
|
||||
if (functionNeedToExecute(pRuntimeEnv, &pCtx[k], functionId)) {
|
||||
pCtx[k].startTs = startTs;// this can be set during create the struct
|
||||
// aAggs[functionId].xFunction(&pCtx[k]);
|
||||
if (functionId < 0) {
|
||||
// load the script and exec, pRuntimeEnv->pUdfInfo
|
||||
|
||||
} else {
|
||||
aAggs[functionId].xFunction(&pCtx[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void arithmeticApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx *pCtx, int32_t numOfOutput) {
|
||||
SQuery *pQuery = pRuntimeEnv->pQuery;
|
||||
|
||||
for (int32_t k = 0; k < numOfOutput; ++k) {
|
||||
pCtx[k].startTs = pQuery->window.skey;
|
||||
|
||||
if (pCtx[k].functionId < 0) {
|
||||
// load the script and exec, pRuntimeEnv->pUdfInfo
|
||||
|
||||
} else {
|
||||
aAggs[pCtx[k].functionId].xFunction(&pCtx[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void doTimeWindowInterpolation(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo, SArray* pDataBlock, TSKEY prevTs,
|
||||
int32_t prevRowIndex, TSKEY curTs, int32_t curRowIndex, TSKEY windowKey, int32_t type) {
|
||||
|
@ -2480,11 +2498,16 @@ static uint32_t doFilterByBlockTimeWindow(STableScanInfo* pTableScanInfo, SSData
|
|||
int32_t colId = pTableScanInfo->pExpr[i].base.colInfo.colId;
|
||||
|
||||
// group by + first/last should not apply the first/last block filter
|
||||
if (functionId < 0) {
|
||||
status |= BLK_DATA_ALL_NEEDED;
|
||||
return status;
|
||||
} else {
|
||||
status |= aAggs[functionId].dataReqFunc(&pTableScanInfo->pCtx[i], &pBlock->info.window, colId);
|
||||
if ((status & BLK_DATA_ALL_NEEDED) == BLK_DATA_ALL_NEEDED) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -3060,7 +3083,7 @@ void initCtxOutputBuffer(SQLFunctionCtx* pCtx, int32_t size) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pCtx[j].functionId < 0) { // udf initialize
|
||||
if (pCtx[j].functionId < 0) { // todo udf initialization
|
||||
|
||||
} else {
|
||||
aAggs[pCtx[j].functionId].init(&pCtx[j], pCtx[j].resultInfo);
|
||||
|
|
Loading…
Reference in New Issue