[CARBONDATA-4330] Incremental Dataload of Average aggregate in MV
Why is this PR needed?
Currently, whenever MV is created with average aggregate, a full
refresh is done meaning it reloads the whole MV for any newly
added segments. This will slow down the loading. With incremental
data load, only the segments that are newly added can be loaded to the MV.
What changes were proposed in this PR?
If avg is present, rewrite the query with the sum and count of the
columns to create MV and use them to derive avg.
Refer: https://docs.google.com/document/d/1kPEMCX50FLZcmyzm6kcIQtUH9KXWDIqh-Hco7NkTp80/edit
Does this PR introduce any user interface change?
No
Is any new testcase added?
Yes
This closes #4257