fix bugs
This commit is contained in:
parent
9ccc3fb853
commit
ea05f8af12
|
@ -1463,7 +1463,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
.classification = FUNC_MGT_AGG_FUNC,
|
.classification = FUNC_MGT_AGG_FUNC,
|
||||||
.translateFunc = translateHistogramMerge,
|
.translateFunc = translateHistogramMerge,
|
||||||
.getEnvFunc = getHistogramFuncEnv,
|
.getEnvFunc = getHistogramFuncEnv,
|
||||||
.initFunc = histogramFunctionSetup,
|
.initFunc = functionSetup,
|
||||||
.processFunc = histogramFunctionMerge,
|
.processFunc = histogramFunctionMerge,
|
||||||
.finalizeFunc = histogramFinalize
|
.finalizeFunc = histogramFinalize
|
||||||
},
|
},
|
||||||
|
|
|
@ -3345,11 +3345,12 @@ int32_t histogramFunctionMerge(SqlFunctionCtx *pCtx) {
|
||||||
pInfo->numOfBins = pInputInfo->numOfBins;
|
pInfo->numOfBins = pInputInfo->numOfBins;
|
||||||
pInfo->totalCount += pInputInfo->totalCount;
|
pInfo->totalCount += pInputInfo->totalCount;
|
||||||
for (int32_t k = 0; k < pInfo->numOfBins; ++k) {
|
for (int32_t k = 0; k < pInfo->numOfBins; ++k) {
|
||||||
|
pInfo->bins[k].lower = pInputInfo->bins[k].lower;
|
||||||
|
pInfo->bins[k].upper = pInputInfo->bins[k].upper;
|
||||||
pInfo->bins[k].count += pInputInfo->bins[k].count;
|
pInfo->bins[k].count += pInputInfo->bins[k].count;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_VAL(GET_RES_INFO(pCtx), 1, 1);
|
SET_VAL(GET_RES_INFO(pCtx), pInfo->numOfBins, pInfo->numOfBins);
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3404,7 +3405,7 @@ int32_t histogramPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
|
||||||
colDataAppend(pCol, pBlock->info.rows, res, false);
|
colDataAppend(pCol, pBlock->info.rows, res, false);
|
||||||
|
|
||||||
taosMemoryFree(res);
|
taosMemoryFree(res);
|
||||||
return pResInfo->numOfRes;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getHLLFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
|
bool getHLLFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
|
||||||
|
|
Loading…
Reference in New Issue