Hi team, Currently in pinot, when performing sum ...
# troubleshooting
a
Hi team, Currently in pinot, when performing sum or avg on a BIG_DECIMAL column, the result is returned as double, even though the source data is of BIG_DECIMAL type. This leads to the output being displayed in exponential format after a certain precision. While there is a sumprecision function available for sum to maintain big decimal output, there is no equivalent function for avg to return the result as big decimal instead of double. Why was the sumprecision function introduced rather than supporting big_decimal as a result type for aggregations on big_decimal columns? In Trino/Presto the output of aggregate functions is as expected without exponential format. Example: input: 1234567890.1234567 output: 1.2345678901234567E9 expected output: 1234567890.1234567
y
We can add an equivalent
AvgPrecision
aggregation function too. Initially, Pinot didn't support polymorphic aggregation functions, which we've recently started adding support for. However, we might not automatically use
SumPrecision
for summing
BIG_DECIMAL
columns because the performance would be worse with
BigDecimal
based computation instead of using doubles.
👍 1