Jimexist commented on a change in pull request #334:
URL: https://github.com/apache/arrow-datafusion/pull/334#discussion_r635673607
##########
File path: ballista/rust/core/proto/ballista.proto
##########
@@ -151,6 +153,25 @@ message AggregateExprNode {
LogicalExprNode expr = 2;
}
+enum BuiltInWindowFunction {
+ ROW_NUMBER = 0;
+ RANK = 1;
+ DENSE_RANK = 2;
+ LAG = 3;
+ LEAD = 4;
+ FIRST_VALUE = 5;
+ LAST_VALUE = 6;
+}
+
+message WindowExprNode {
+ oneof window_function {
+ AggregateFunction aggr_function = 1;
Review comment:
```
[postgres] # explain select c1, count(c3) over (partition by c1 order by c3)
from test;
QUERY PLAN
------------------------------------------------------------------
WindowAgg (cost=6.32..8.32 rows=100 width=12)
-> Sort (cost=6.32..6.57 rows=100 width=4)
Sort Key: c1, c3
-> Seq Scan on test (cost=0.00..3.00 rows=100 width=4)
(4 rows)
```
```
[postgres] # explain select c1, first_value(c3) over (partition by c1 order
by c3) from test;
QUERY PLAN
------------------------------------------------------------------
WindowAgg (cost=6.32..8.32 rows=100 width=6)
-> Sort (cost=6.32..6.57 rows=100 width=4)
Sort Key: c1, c3
-> Seq Scan on test (cost=0.00..3.00 rows=100 width=4)
(4 rows)
```
IMO only the second time we'll really need to sort by `c3`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]