Summary:
Original commit: 989279f2c305f16e5d15497679d31688b9a5bce3 / D55509
Ulike the other supported aggregate functions, for AVG two functions are
pushed down: SUM and COUNT, and they return two respective results to be
combined separately. If the AGG function found no values during the scan
in DocDB, the both values are NULL. The NULL values are not combined,
but nonetheless, the index of the current value in the tuple should be
incremented one extra time, so subsequent target aggregate function
could properly access their respective values.
This diff fixes a bug which prevented proper increment of the index of
the current value in the tuple if the AVG function received NULL.
Backport-through: 2024.2
Test Plan: ./yb_build.sh --java-test TestPgRegressAggregates
Reviewers: fizaa, mtakahara
Reviewed By: mtakahara
Subscribers: jason, yql
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D55709