Is sum(null)=0 is good specification? in timelion

Hi,

I found an issue in sum of NULL in timelion.
avg:NULLVALUE =NULL
max:NULLVALUE = NULL
but
sum:NULLVALUE = 0

Is it good specification? I was trying to make out NULL or 0, but unable to do it using sum.

Thanks in advance.

Hi @alfyukio,

Yes sum of null returning 0 is expected behaviour by design. The sum of an empty set is well defined (0) while the average and max aren't when you have no data.

You can see a similar discussion here: https://github.com/elastic/elasticsearch/issues/31887.

Mike.

Hi @mikecote,

Thanks. I should have looked at the issue:31887.
If it is by design. OK.

Yukio

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.