Jimexist commented on a change in pull request #334:
URL: https://github.com/apache/arrow-datafusion/pull/334#discussion_r635675124



##########
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:
       also fun thing to notice:
   
   ```
   [postgres] # explain analyze select c1, sum(c3) over (partition by c1 order 
by c3), avg(c3) over (partition by c1 order by c3 desc) from test;
                                                           QUERY PLAN
   
--------------------------------------------------------------------------------------------------------------------------
    WindowAgg  (cost=11.64..13.64 rows=100 width=44) (actual time=1.287..1.373 
rows=100 loops=1)
      ->  Sort  (cost=11.64..11.89 rows=100 width=36) (actual time=1.281..1.292 
rows=100 loops=1)
            Sort Key: c1, c3
            Sort Method: quicksort  Memory: 31kB
            ->  WindowAgg  (cost=6.32..8.32 rows=100 width=36) (actual 
time=1.051..1.174 rows=100 loops=1)
                  ->  Sort  (cost=6.32..6.57 rows=100 width=4) (actual 
time=0.221..0.231 rows=100 loops=1)
                        Sort Key: c1, c3 DESC
                        Sort Method: quicksort  Memory: 29kB
                        ->  Seq Scan on test  (cost=0.00..3.00 rows=100 
width=4) (actual time=0.010..0.028 rows=100 loops=1)
    Planning Time: 0.087 ms
    Execution Time: 1.437 ms
   (11 rows)
   ```




-- 
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]


Reply via email to