diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index d1a3334aa28aae2730161991a3e40d913a396496..e3dab4750c456fe7c028cfe2ea1d5e531a5695b2 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -5012,7 +5012,7 @@ static void histogram_function(SQLFunctionCtx *pCtx) { if (pRes->normalized) { for (int32_t b = 0; b < pRes->numOfBins; ++b) { - pRes->orderedBins[b].count_norm = pRes->orderedBins[b].count / totalElems; + pRes->orderedBins[b].count_norm = pRes->orderedBins[b].count / (double)totalElems; } }