File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
tests/test_parser/test_base_sql Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1186,3 +1186,23 @@ def test_table_double_quote(self):
1186
1186
1187
1187
ast = parse_sql (sql )
1188
1188
assert str (ast ) == str (expected_ast )
1189
+
1190
+ def test_window_function_mindsdb (self ):
1191
+
1192
+ # modifier
1193
+ query = "select SUM(col0) OVER (partition by col1 order by col2 rows between unbounded preceding and current row) from table1 "
1194
+ expected_ast = Select (
1195
+ targets = [
1196
+ WindowFunction (
1197
+ function = Function (op = 'sum' , args = [Identifier ('col0' )]),
1198
+ partition = [Identifier ('col1' )],
1199
+ order_by = [OrderBy (field = Identifier ('col2' ))],
1200
+ modifier = 'rows BETWEEN unbounded preceding AND current row'
1201
+ )
1202
+ ],
1203
+ from_table = Identifier ('table1' )
1204
+ )
1205
+ ast = parse_sql (query )
1206
+ assert str (ast ) == str (expected_ast )
1207
+ assert ast .to_tree () == expected_ast .to_tree ()
1208
+
You can’t perform that action at this time.
0 commit comments