@@ -2907,7 +2907,7 @@ impl Parser {
2907
2907
let mut load = self . construct_node ( NodeType :: LoadStatement ) ?;
2908
2908
self . next_token ( ) ?; // -> DATA
2909
2909
load. push_node ( "data" , self . construct_node ( NodeType :: Keyword ) ?) ;
2910
- self . next_token ( ) ?; // -> INTO
2910
+ self . next_token ( ) ?; // -> INTO | OVERWRITE
2911
2911
load. push_node ( "into" , self . construct_node ( NodeType :: Keyword ) ?) ;
2912
2912
self . next_token ( ) ?; // -> ident
2913
2913
load. push_node ( "ident" , self . parse_identifier ( ) ?) ;
@@ -2935,12 +2935,28 @@ impl Parser {
2935
2935
print ! ( "{:?}" , self . construct_node( NodeType :: Keyword ) ?) ;
2936
2936
load. push_node ( "from_files" , self . parse_grouped_exprs ( false ) ?) ;
2937
2937
print ! ( "{:?}" , self . construct_node( NodeType :: Keyword ) ?) ;
2938
- self . next_token ( ) ?; // -> WITH
2939
- load. push_node ( "with" , self . construct_node ( NodeType :: Keyword ) ?) ;
2940
- self . next_token ( ) ?; // -> CONNECTION
2941
- load. push_node ( "connection" , self . construct_node ( NodeType :: Keyword ) ?) ;
2942
- self . next_token ( ) ?; // -> connection_name
2943
- load. push_node ( "connection_name" , self . parse_identifier ( ) ?) ;
2938
+ if self . get_token ( 1 ) ?. is ( "WITH" ) && self . get_token ( 2 ) ?. is ( "PARTITION" ) {
2939
+ self . next_token ( ) ?; // -> WITH
2940
+ let mut with = self . construct_node ( NodeType :: WithPartitionColumnsClause ) ?;
2941
+ self . next_token ( ) ?; // -> PARTITION
2942
+ with. push_node_vec ( "partition_columns" , self . parse_n_keywords ( 2 ) ?) ;
2943
+ if self . get_token ( 1 ) ?. is ( "(" ) {
2944
+ self . next_token ( ) ?; // -> (
2945
+ with. push_node (
2946
+ "column_schema_group" ,
2947
+ self . parse_grouped_type_declarations ( false ) ?,
2948
+ ) ;
2949
+ }
2950
+ load. push_node ( "with_partition_columns" , with) ;
2951
+ }
2952
+ if self . get_token ( 1 ) ?. is ( "WITH" ) && self . get_token ( 2 ) ?. is ( "CONNECTION" ) {
2953
+ self . next_token ( ) ?; // -> WITH
2954
+ load. push_node ( "with" , self . construct_node ( NodeType :: Keyword ) ?) ;
2955
+ self . next_token ( ) ?; // -> CONNECTION
2956
+ load. push_node ( "connection" , self . construct_node ( NodeType :: Keyword ) ?) ;
2957
+ self . next_token ( ) ?; // -> connection_name
2958
+ load. push_node ( "connection_name" , self . parse_identifier ( ) ?) ;
2959
+ }
2944
2960
2945
2961
if self . get_token ( 1 ) ?. is ( ";" ) && semicolon {
2946
2962
self . next_token ( ) ?; // -> ;
0 commit comments