bziobrowski opened a new pull request, #14990:
URL: https://github.com/apache/pinot/pull/14990
PR adds `pinot.broker.enable.group.trim` broker configuration setting which
allows enabling `is_enable_group_trim` hint for all queries, which in turn
enables V1-style trimming in leaf nodes and v2-style trimming in intermediate
nodes.
This default value is overridden with value passed in hint.
Examples:
- if `pinot.broker.enable.group.trim=true` then
```sql
set explainAskingServers=true;
explain plan for
select i, j, count(*) as cnt
from testTable
group by i, j
order by i asc, j asc
limit 3
```
uses group trimming and ought to return plan containing (collations & limit
are the important piece):
```
...
LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[3])
PinotLogicalAggregate(group=[{0, 1}], agg#0=[COUNT($2)], aggType=[FINAL],
collations=[[0, 1]], limit=[3])
PinotLogicalExchange(distribution=[hash[0, 1]])
...
```
- if we explicitly disable group trimming with hint, e.g.
```sql
set explainAskingServers=true;
explain plan for
select /*+ aggOptions(is_enable_group_trim='false') */ i, j, count(*) as
cnt
from testTable
group by i, j
order by i asc, j asc
limit 3
```
then execution plan doesn't show collations & limit in PinotLogicalAggregate
```
...
LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[3])
PinotLogicalAggregate(group=[{0, 1}], agg#0=[COUNT($2)], aggType=[FINAL])
PinotLogicalExchange(distribution=[hash[0, 1]])
...
```
which means that trimming is disabled.
See
https://docs.pinot.apache.org/users/user-guide-query/query-syntax/grouping-algorithm
for details on grouping algorithm.
--
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]