@@ -16,6 +16,7 @@ pub(crate) fn clause_constructs(node: &Expression) -> Vec<Construct> {
1616 Expression :: Union ( union) => union_clauses ( union) ,
1717 Expression :: Intersect ( intersect) => intersect_clauses ( intersect) ,
1818 Expression :: Except ( except) => except_clauses ( except) ,
19+ Expression :: Table ( table) => present ( & [ ( table. table_sample . is_some ( ) , "sample" ) ] ) ,
1920 _ => Vec :: new ( ) ,
2021 } ;
2122 let mut constructs: Vec < Construct > = names
@@ -87,18 +88,34 @@ fn select_clauses(select: &Select) -> Vec<String> {
8788 } = select;
8889 present ( & [
8990 ( with. is_some ( ) , "with" ) ,
91+ (
92+ with. as_ref ( ) . is_some_and ( |with| with. recursive ) ,
93+ "with_recursive" ,
94+ ) ,
9095 ( * distinct, "distinct" ) ,
9196 ( distinct_on. is_some ( ) , "distinct_on" ) ,
9297 ( top. is_some ( ) , "top" ) ,
9398 ( !lateral_views. is_empty ( ) , "lateral_view" ) ,
9499 ( prewhere. is_some ( ) , "prewhere" ) ,
95100 ( where_clause. is_some ( ) , "where" ) ,
96101 ( group_by. is_some ( ) , "group_by" ) ,
102+ (
103+ group_by
104+ . as_ref ( )
105+ . is_some_and ( |group_by| group_by. all == Some ( true ) ) ,
106+ "group_by_all" ,
107+ ) ,
97108 ( having. is_some ( ) , "having" ) ,
98109 ( windows. is_some ( ) , "window" ) ,
99110 ( qualify. is_some ( ) , "qualify" ) ,
100111 ( connect. is_some ( ) , "connect_by" ) ,
101112 ( order_by. is_some ( ) , "order_by" ) ,
113+ (
114+ order_by
115+ . as_ref ( )
116+ . is_some_and ( |order_by| order_by. all . is_some ( ) ) ,
117+ "order_by_all" ,
118+ ) ,
102119 ( distribute_by. is_some ( ) , "distribute_by" ) ,
103120 ( cluster_by. is_some ( ) , "cluster_by" ) ,
104121 ( sort_by. is_some ( ) , "sort_by" ) ,
@@ -159,7 +176,17 @@ macro_rules! set_operation_clauses {
159176 ( * strict, concat!( $prefix, "_strict" ) ) ,
160177 ( !on_columns. is_empty( ) , concat!( $prefix, "_on_columns" ) ) ,
161178 ( with. is_some( ) , "with" ) ,
179+ (
180+ with. as_ref( ) . is_some_and( |with| with. recursive) ,
181+ "with_recursive" ,
182+ ) ,
162183 ( order_by. is_some( ) , "order_by" ) ,
184+ (
185+ order_by
186+ . as_ref( )
187+ . is_some_and( |order_by| order_by. all. is_some( ) ) ,
188+ "order_by_all" ,
189+ ) ,
163190 ( limit. is_some( ) , "limit" ) ,
164191 ( offset. is_some( ) , "offset" ) ,
165192 ( distribute_by. is_some( ) , "distribute_by" ) ,
0 commit comments