Skip to content

Commit bac6bd7

Browse files
committed
_determine_last_relevant_keyword: handle the new IFNOTEXISTS keyword so that columns in "CREATE TABLE IF NOT EXISTS foo" statements are properly detected
1 parent 634e93a commit bac6bd7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sql_metadata/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ def _determine_last_relevant_keyword(self, token: SQLToken, last_keyword: str):
10051005
and self._open_parentheses[-1].is_partition_clause_start
10061006
)
10071007
and not (token.normalized == "USING" and last_keyword == "SELECT")
1008+
and not (token.normalized == "IFNOTEXISTS")
10081009
):
10091010
last_keyword = token.normalized
10101011
return last_keyword

0 commit comments

Comments
 (0)