You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add window expression part 1 - logical and physical planning, structure, to/from proto, and explain, for empty over clause only (#334)
* add window expr
* fix unused imports
* fix clippy
* fix unit test
* Update datafusion/src/logical_plan/builder.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* Update datafusion/src/logical_plan/builder.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* Update datafusion/src/physical_plan/window_functions.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* Update datafusion/src/physical_plan/window_functions.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* adding more built-in functions
* adding filter by todo
* enrich unit test
* update
* add more tests
* fix test
* fix unit test
* fix error
* fix unit test
* fix unit test
* use upper case
* fix unit test
* comment out test
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Copy file name to clipboardExpand all lines: ballista/rust/core/proto/ballista.proto
+79-1Lines changed: 79 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,6 @@ message LogicalExprNode {
39
39
40
40
ScalarValueliteral=3;
41
41
42
-
43
42
// binary expressions
44
43
BinaryExprNodebinary_expr=4;
45
44
@@ -60,6 +59,9 @@ message LogicalExprNode {
60
59
boolwildcard=15;
61
60
ScalarFunctionNodescalar_function=16;
62
61
TryCastNodetry_cast=17;
62
+
63
+
// window expressions
64
+
WindowExprNodewindow_expr=18;
63
65
}
64
66
}
65
67
@@ -151,6 +153,29 @@ message AggregateExprNode {
151
153
LogicalExprNodeexpr=2;
152
154
}
153
155
156
+
enumBuiltInWindowFunction {
157
+
ROW_NUMBER=0;
158
+
RANK=1;
159
+
DENSE_RANK=2;
160
+
PERCENT_RANK=3;
161
+
CUME_DIST=4;
162
+
NTILE=5;
163
+
LAG=6;
164
+
LEAD=7;
165
+
FIRST_VALUE=8;
166
+
LAST_VALUE=9;
167
+
NTH_VALUE=10;
168
+
}
169
+
170
+
messageWindowExprNode {
171
+
oneofwindow_function {
172
+
AggregateFunctionaggr_function=1;
173
+
BuiltInWindowFunctionbuilt_in_function=2;
174
+
// udaf = 3
175
+
}
176
+
LogicalExprNodeexpr=4;
177
+
}
178
+
154
179
messageBetweenNode {
155
180
LogicalExprNodeexpr=1;
156
181
boolnegated=2;
@@ -200,6 +225,7 @@ message LogicalPlanNode {
200
225
EmptyRelationNodeempty_relation=10;
201
226
CreateExternalTableNodecreate_external_table=11;
202
227
ExplainNodeexplain=12;
228
+
WindowNodewindow=13;
203
229
}
204
230
}
205
231
@@ -288,6 +314,50 @@ message AggregateNode {
288
314
repeatedLogicalExprNodeaggr_expr=3;
289
315
}
290
316
317
+
messageWindowNode {
318
+
LogicalPlanNodeinput=1;
319
+
repeatedLogicalExprNodewindow_expr=2;
320
+
repeatedLogicalExprNodepartition_by_expr=3;
321
+
repeatedLogicalExprNodeorder_by_expr=4;
322
+
// "optional" keyword is stable in protoc 3.15 but prost is still on 3.14 (see https://github.com/danburkert/prost/issues/430)
323
+
// this syntax is ugly but is binary compatible with the "optional" keyword (see https://stackoverflow.com/questions/42622015/how-to-define-an-optional-field-in-protobuf-3)
324
+
oneofwindow_frame {
325
+
WindowFrameframe=5;
326
+
}
327
+
// TODO add filter by expr
328
+
}
329
+
330
+
enumWindowFrameUnits {
331
+
ROWS=0;
332
+
RANGE=1;
333
+
GROUPS=2;
334
+
}
335
+
336
+
messageWindowFrame {
337
+
WindowFrameUnitswindow_frame_units=1;
338
+
WindowFrameBoundstart_bound=2;
339
+
// "optional" keyword is stable in protoc 3.15 but prost is still on 3.14 (see https://github.com/danburkert/prost/issues/430)
340
+
// this syntax is ugly but is binary compatible with the "optional" keyword (see https://stackoverflow.com/questions/42622015/how-to-define-an-optional-field-in-protobuf-3)
341
+
oneofend_bound {
342
+
WindowFrameBoundbound=3;
343
+
}
344
+
}
345
+
346
+
enumWindowFrameBoundType {
347
+
CURRENT_ROW=0;
348
+
PRECEDING=1;
349
+
FOLLOWING=2;
350
+
}
351
+
352
+
messageWindowFrameBound {
353
+
WindowFrameBoundTypewindow_frame_bound_type=1;
354
+
// "optional" keyword is stable in protoc 3.15 but prost is still on 3.14 (see https://github.com/danburkert/prost/issues/430)
355
+
// this syntax is ugly but is binary compatible with the "optional" keyword (see https://stackoverflow.com/questions/42622015/how-to-define-an-optional-field-in-protobuf-3)
0 commit comments