somandal commented on code in PR #10228:
URL: https://github.com/apache/pinot/pull/10228#discussion_r1099597597
##########
pinot-query-planner/src/test/resources/queries/WindowFunction.json:
##########
@@ -0,0 +1,1245 @@
+{
+ "window_function_planning_tests": {
Review Comment:
Here's an example plan of an `OVER(PARTITION BY a.col1 ...)` with a filter
on `a.col1`:
```
{
"description": "multiple OVER(PARTITION BY)s on the same key select
col and filter",
"sql": "EXPLAIN PLAN FOR SELECT a.col1, AVG(a.col3) OVER(PARTITION
BY a.col1), COUNT(a.col1) OVER(PARTITION BY a.col1) FROM a WHERE a.col3 > 42
AND a.col1 IN ('vader', 'chewbacca', 'yoda')",
"output": [
"Execution Plan",
"\nLogicalProject(col1=[$1], EXPR$1=[CAST(/($2, $3)):INTEGER NOT
NULL], EXPR$2=[$4])",
"\n LogicalWindow(window#0=[window(partition {1} aggs [SUM($0),
COUNT($0), COUNT($1)])])",
"\n LogicalExchange(distribution=[hash[1]])",
"\n LogicalProject(col3=[$1], col1=[$2])",
"\n LogicalFilter(condition=[AND(>($1, 42), OR(=($2,
'chewbacca':VARCHAR(9)), =($2, 'vader':VARCHAR(9)), =($2,
'yoda':VARCHAR(9))))])",
"\n LogicalTableScan(table=[[a]])",
"\n"
]
},
```
Based on the above the Filter is already pushed down to the leaf node
without adding an explicit rule for that. Does this answer your question?
--
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]