:wave: Hi Team, just wanted to see if we could pre...
# troubleshooting
s
👋 Hi Team, just wanted to see if we could prevent pinot returning
-Infinity
when taking
avg
on an empty column and return 0 instead.
m
I am guessing you defined the column as a dimension? You can do one of of the following things: • Define it as metric - this will change the default null value to 0. OR • Specify default null value as 0 in schema for this column OR • Enable native null support
s
I see thank you for the response. For our implementation, we are trying to take an avg of a a column that is in a json index. Would there be any options to define null value as 0 in the query?
Actually, I believe Pinot is returning
-Infinity
as it is trying to take an avg on empty rows. For example,
Copy code
select avg(json_extract_scalar(column1, '$.my_awesome_json_column', 'Double', 0)) from my_cool_table
When there is no data in
my_cool_table
it is returning
-Infinitiy