File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ pub struct Select {
132132 pub group_by : Vec < Expr > ,
133133 /// HAVING
134134 pub having : Option < Expr > ,
135+ /// QUALIFY https://docs.snowflake.com/en/sql-reference/constructs/qualify.html
136+ pub qualify : Option < Expr > ,
135137}
136138
137139impl fmt:: Display for Select {
@@ -153,6 +155,9 @@ impl fmt::Display for Select {
153155 if let Some ( ref having) = self . having {
154156 write ! ( f, " HAVING {}" , having) ?;
155157 }
158+ if let Some ( ref qualify) = self . qualify {
159+ write ! ( f, " QUALIFY {}" , qualify) ?;
160+ }
156161 Ok ( ( ) )
157162 }
158163}
Original file line number Diff line number Diff line change @@ -332,6 +332,7 @@ define_keywords!(
332332 PREPARE ,
333333 PRIMARY ,
334334 PROCEDURE ,
335+ QUALIFY ,
335336 QUARTER ,
336337 RANGE ,
337338 RANK ,
Original file line number Diff line number Diff line change @@ -2057,6 +2057,12 @@ impl<'a> Parser<'a> {
20572057 None
20582058 } ;
20592059
2060+ let qualify = if self . parse_keyword ( Keyword :: QUALIFY ) {
2061+ Some ( self . parse_expr ( ) ?)
2062+ } else {
2063+ None
2064+ } ;
2065+
20602066 Ok ( Select {
20612067 distinct,
20622068 top,
@@ -2065,6 +2071,7 @@ impl<'a> Parser<'a> {
20652071 selection,
20662072 group_by,
20672073 having,
2074+ qualify,
20682075 } )
20692076 }
20702077
You can’t perform that action at this time.
0 commit comments