mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
Support for INTERVAL inside window frames (#655)
* Add support to for INTERVAL inside window queries * Remove the unnecessary ancillary struct Interval * Convert Window Frame Bound to Expr * remove unnecessary changes * remove unnecessary changes Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
This commit is contained in:
parent
cacdf3305f
commit
427bec4ccc
3 changed files with 11 additions and 5 deletions
|
@ -2940,13 +2940,17 @@ fn parse_window_functions() {
|
|||
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), \
|
||||
avg(bar) OVER (ORDER BY a \
|
||||
RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING), \
|
||||
sum(bar) OVER (ORDER BY a \
|
||||
RANGE BETWEEN INTERVAL '1' DAY PRECEDING AND INTERVAL '1 MONTH' FOLLOWING), \
|
||||
COUNT(*) OVER (ORDER BY a \
|
||||
RANGE BETWEEN INTERVAL '1 DAY' PRECEDING AND INTERVAL '1 DAY' FOLLOWING), \
|
||||
max(baz) OVER (ORDER BY a \
|
||||
ROWS UNBOUNDED PRECEDING), \
|
||||
sum(qux) OVER (ORDER BY a \
|
||||
GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) \
|
||||
FROM foo";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(5, select.projection.len());
|
||||
assert_eq!(7, select.projection.len());
|
||||
assert_eq!(
|
||||
&Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::new("row_number")]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue