提交 12f4bc3c 编写于 作者: G Ganlin Zhao

refactor

上级 384f2262
...@@ -74,6 +74,7 @@ bool percentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultI ...@@ -74,6 +74,7 @@ bool percentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultI
int32_t percentileFunction(SqlFunctionCtx *pCtx); int32_t percentileFunction(SqlFunctionCtx *pCtx);
int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock);
int32_t getApercentileMaxSize();
bool getApercentileFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); bool getApercentileFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv);
bool apercentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo); bool apercentileFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo);
int32_t apercentileFunction(SqlFunctionCtx *pCtx); int32_t apercentileFunction(SqlFunctionCtx *pCtx);
......
...@@ -1149,8 +1149,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -1149,8 +1149,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.finalizeFunc = avgFinalize, .finalizeFunc = avgFinalize,
.invertFunc = avgInvertFunction, .invertFunc = avgInvertFunction,
.combineFunc = avgCombine, .combineFunc = avgCombine,
.pPartialFunc = "avgPartial",
.pMergeFunc = "avgMerge"
}, },
{ {
.name = "percentile", .name = "percentile",
...@@ -1254,8 +1252,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -1254,8 +1252,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.processFunc = firstFunction, .processFunc = firstFunction,
.finalizeFunc = firstLastFinalize, .finalizeFunc = firstLastFinalize,
.combineFunc = firstCombine, .combineFunc = firstCombine,
.pPartialFunc = "first",
.pMergeFunc = "first"
}, },
{ {
.name = "last", .name = "last",
...@@ -1267,8 +1263,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -1267,8 +1263,6 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.processFunc = lastFunction, .processFunc = lastFunction,
.finalizeFunc = firstLastFinalize, .finalizeFunc = firstLastFinalize,
.combineFunc = lastCombine, .combineFunc = lastCombine,
.pPartialFunc = "last",
.pMergeFunc = "last"
}, },
{ {
.name = "twa", .name = "twa",
......
...@@ -1953,6 +1953,12 @@ bool getApercentileFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { ...@@ -1953,6 +1953,12 @@ bool getApercentileFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
return true; 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) { static int8_t getApercentileAlgo(char *algoStr) {
int8_t algoType; int8_t algoType;
if (strcasecmp(algoStr, "default") == 0) { if (strcasecmp(algoStr, "default") == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册