ankitsultana commented on code in PR #16204:
URL: https://github.com/apache/pinot/pull/16204#discussion_r2167825852
##########
pinot-query-planner/src/test/resources/queries/PhysicalOptimizerPlans.json:
##########
@@ -1,4 +1,154 @@
{
+ "physical_opt_chained_subqueries": {
+ "queries": [
+ {
+ "description": "Sub-query with group-by with no agg calls and a limit",
+ "sql": "SET usePhysicalOptimizer=true; EXPLAIN PLAN FOR WITH tmp AS
(SELECT DISTINCT col1, col2, ts FROM a LIMIT 100) SELECT col1, col2, RANK()
OVER (PARTITION BY col2 ORDER BY ts DESC) AS rnk FROM tmp ORDER BY col2, rnk
DESC",
+ "output": [
+ "Execution Plan",
+ "\nPhysicalExchange(exchangeStrategy=[SINGLETON_EXCHANGE])",
+ "\n PhysicalSort(sort0=[$1], sort1=[$2], dir0=[ASC], dir1=[DESC])",
+ "\n PhysicalProject(col1=[$0], col2=[$1], $2=[$3])",
+ "\n PhysicalWindow(window#0=[window(partition {1} order by [2
DESC] aggs [RANK()])])",
+ "\n PhysicalSort(sort0=[$2], dir0=[DESC])",
+ "\n PhysicalSort(fetch=[100])",
+ "\n
PhysicalExchange(exchangeStrategy=[SINGLETON_EXCHANGE])",
+ "\n PhysicalSort(fetch=[100])",
+ "\n PhysicalAggregate(group=[{0, 1, 2}],
aggType=[FINAL], limit=[100])",
+ "\n
PhysicalExchange(exchangeStrategy=[PARTITIONING_EXCHANGE], distKeys=[[0, 1,
2]])",
+ "\n PhysicalAggregate(group=[{0, 1, 7}],
aggType=[LEAF], limit=[100])",
Review Comment:
Shows effectiveness of auto-enabling group-trim for group-by queries with no
agg calls.
--
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]