File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,11 +401,6 @@ pub fn parse_create_table(
401401 let if_not_exists = parser. parse_keywords ( & [ Keyword :: IF , Keyword :: NOT , Keyword :: EXISTS ] ) ;
402402 let table_name = parser. parse_object_name ( false ) ?;
403403
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-
409404 let mut builder = CreateTableBuilder :: new ( table_name)
410405 . or_replace ( or_replace)
411406 . if_not_exists ( if_not_exists)
@@ -565,6 +560,9 @@ pub fn parse_create_table(
565560 builder. storage_serialization_policy =
566561 Some ( parse_storage_serialization_policy ( parser) ?) ;
567562 }
563+ Keyword :: IF if parser. parse_keywords ( & [ Keyword :: NOT , Keyword :: EXISTS ] ) => {
564+ builder = builder. if_not_exists ( true ) ;
565+ }
568566 _ => {
569567 return parser. expected ( "end of statement" , next_token) ;
570568 }
You can’t perform that action at this time.
0 commit comments