gianm commented on PR #16326:
URL: https://github.com/apache/druid/pull/16326#issuecomment-2405857106

   > `COUNT` in SQL initializes to `null`, not `0` as expected, because the 
null-agg-frame is written with the combining aggregators. The combining 
aggregator of `count` is `longSum`, which initializes to `null`.
   
   Oops, in looking into this more, I misunderstood the problem. It was 
actually not this. The null-agg-frame is written with the regular aggregators, 
not the combining ones. The _real_ problem is an off-by-one in updating the 
`resultRow`, which is fixed in the latest push.
   
   In the case where the query has `granularity: ALL` but also has `intervals: 
[]`, the result row includes `__time` (as a result of changes in #10968). I 
pushed a change to account for this: check for `__time` in the result row 
signature, and if it's there:
   
   - Set it to `0L` (it's going to be ignored anyway)
   - Copy the aggregation results starting from 
`getResultRowAggregatorStart()`, not position `0`. This was the off-by-one that 
caused the test failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to