alamb commented on code in PR #15084:
URL: https://github.com/apache/datafusion/pull/15084#discussion_r1986064733
##########
datafusion/sqllogictest/test_files/explain_tree.slt:
##########
@@ -519,6 +519,36 @@ physical_plan
17)│ format: arrow │
18)└───────────────────────────┘
+
+# Query with window agg.
+query TT
+explain select count(*) over() from table1;
+----
+logical_plan
+01)Projection: count(Int64(1)) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED
FOLLOWING AS count(*) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+02)--WindowAggr: windowExpr=[[count(Int64(1)) ROWS BETWEEN UNBOUNDED PRECEDING
AND UNBOUNDED FOLLOWING]]
+03)----TableScan: table1 projection=[]
+physical_plan
+01)┌───────────────────────────┐
+02)│ ProjectionExec │
+03)└─────────────┬─────────────┘
+04)┌─────────────┴─────────────┐
Review Comment:
Can you
1. update this test to use two expressions that share the same window
definition? For exmaple
```sql
select
count(*) over(),
row_number() over ()
from table1
```
2. Add a query that has two different window definitions? For example
```sql
select
rank() over(ORDER BY int_col DESC),
row_number() over (ORDER BY int_col ASC)
from table1
```
##########
datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:
##########
@@ -253,8 +253,15 @@ impl DisplayAs for BoundedWindowAggExec {
write!(f, "wdw=[{}], mode=[{:?}]", g.join(", "), mode)?;
}
DisplayFormatType::TreeRender => {
- // TODO: collect info
- write!(f, "")?;
+ let g: Vec<String> = self
Review Comment:
I think it might look better if we added one list of window expressions and
then printed the window
```
expr=count()
window = OVER ORDER BY ...
```
Not sure if this is possible. We can also explore it in a follow on PR (no
need to change here)
--
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]