diff --git a/source/libs/function/inc/builtinsimpl.h b/source/libs/function/inc/builtinsimpl.h index 34fa5e841728b867f0dc814353b6e82c0b3be0bd..f3f426347f0793fc6f74a7080caa8a221f8fe4f9 100644 --- a/source/libs/function/inc/builtinsimpl.h +++ b/source/libs/function/inc/builtinsimpl.h @@ -74,6 +74,7 @@ bool percentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultI int32_t percentileFunction(SqlFunctionCtx *pCtx); int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); +int32_t getApercentileMaxSize(); bool getApercentileFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); bool apercentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo); int32_t apercentileFunction(SqlFunctionCtx *pCtx); diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 5f58c7b6e3076bebd149a61efe97e4cd2814c6ac..828ae631d6666f15371ef5c1491d6a6e4f85819d 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1149,8 +1149,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .finalizeFunc = avgFinalize, .invertFunc = avgInvertFunction, .combineFunc = avgCombine, - .pPartialFunc = "avgPartial", - .pMergeFunc = "avgMerge" }, { .name = "percentile", @@ -1254,8 +1252,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .processFunc = firstFunction, .finalizeFunc = firstLastFinalize, .combineFunc = firstCombine, - .pPartialFunc = "first", - .pMergeFunc = "first" }, { .name = "last", @@ -1267,8 +1263,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .processFunc = lastFunction, .finalizeFunc = firstLastFinalize, .combineFunc = lastCombine, - .pPartialFunc = "last", - .pMergeFunc = "last" }, { .name = "twa", diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 21847f5de1462b00180537063cd1076dee3e2fc5..13d3e943372336f55296c4441513456f17a88e70 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1953,6 +1953,12 @@ bool getApercentileFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { return true; } +int32_t getApercentileMaxSize() { + int32_t bytesHist = (int32_t)(sizeof(SAPercentileInfo) + sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); + int32_t bytesDigest = (int32_t)(sizeof(SAPercentileInfo) + TDIGEST_SIZE(COMPRESSION)); + return TMAX(bytesHist, bytesDigest); +} + static int8_t getApercentileAlgo(char *algoStr) { int8_t algoType; if (strcasecmp(algoStr, "default") == 0) {