Jackie-Jiang opened a new pull request, #14645:
URL: https://github.com/apache/pinot/pull/14645

   Introduce `is_leaf_return_final_result` as an agg option, which leverages 
the query option `serverReturnFinalResultKeyUnpartitioned` introduced in #13208 
to reduce the data transferred for aggregation group-by.
   When this option is set to true, LEAF aggregate will directly send final 
result to the FINAL aggregate. This is particular useful for DISTINCT_COUNT 
family aggregate when aggregated values are partitioned.
   
   E.g.
   ```
   SELECT /*+ aggOptions(is_leaf_return_final_result='true') */ {tbl1}.name, 
COUNT(*), SUM({tbl1}.num), COUNT(DISTINCT {tbl1}.num) FROM {tbl1} /*+ 
tableOptions(partition_function='hashcode', partition_key='num', 
partition_size='4', partition_parallelism='2') */ GROUP BY {tbl1}.name
   ```
   ```
   SELECT /*+ aggOptions(is_leaf_return_final_result='true') */ {tbl1}.name, 
SUM({tbl2}.num), COUNT(DISTINCT {tbl2}.num) FROM {tbl1} /*+ 
tableOptions(partition_function='hashcode', partition_key='num', 
partition_size='4') */ JOIN {tbl2} /*+ 
tableOptions(partition_function='hashcode', partition_key='num', 
partition_size='4') */ ON {tbl1}.num = {tbl2}.num GROUP BY {tbl1}.name
   ```


-- 
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