File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -401,11 +401,6 @@ pub fn parse_create_table(
401
401
let if_not_exists = parser. parse_keywords ( & [ Keyword :: IF , Keyword :: NOT , Keyword :: EXISTS ] ) ;
402
402
let table_name = parser. parse_object_name ( false ) ?;
403
403
404
- // Snowflake allows `IF NOT EXIST` both before and after the table name so if we haven't
405
- // already seen that before the table name, try to parse it again.
406
- let if_not_exists =
407
- if_not_exists || parser. parse_keywords ( & [ Keyword :: IF , Keyword :: NOT , Keyword :: EXISTS ] ) ;
408
-
409
404
let mut builder = CreateTableBuilder :: new ( table_name)
410
405
. or_replace ( or_replace)
411
406
. if_not_exists ( if_not_exists)
@@ -565,6 +560,9 @@ pub fn parse_create_table(
565
560
builder. storage_serialization_policy =
566
561
Some ( parse_storage_serialization_policy ( parser) ?) ;
567
562
}
563
+ Keyword :: IF if parser. parse_keywords ( & [ Keyword :: NOT , Keyword :: EXISTS ] ) => {
564
+ builder = builder. if_not_exists ( true ) ;
565
+ }
568
566
_ => {
569
567
return parser. expected ( "end of statement" , next_token) ;
570
568
}
You can’t perform that action at this time.
0 commit comments