macbre / sql-metadata

Uses tokenized query returned by python-sqlparse and generates query metadata

Home Page:https://pypi.python.org/pypi/sql-metadata

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG: The Hive ALTER statement was incorrectly parsed

Zhenghan-Lin opened this issue · comments

commented

The input SQL is :
SQL = “ALTER TABLE table_name DROP IF EXISTS PARTITION (dt = 20240524)”

The code is :

Parser(SQL).tables

The output is:
['table_name', 'PARTITION', 'dt']

While the correct result should be: ['table_name']