sql-metadata icon indicating copy to clipboard operation
sql-metadata copied to clipboard

parser.columns lost the 2nd `` quoted columns with operation

Open zhaorenjie opened this issue 2 years ago • 0 comments

reproduce in 2.9.0

>>> Parser("select `col1 with space` / `col2_anything` from table1;").columns
['col1 with space']
>>> Parser("select `col1 with space` / `col2_anything` from table1;").columns_aliases
{'col2_anything': 'col1 with space'}
>>> Parser("select `col1 with space` / `col2_anything` from table1;").columns_dict
{'select': ['col1 with space']}
>>> Parser("select `col1 with space` / `col2_anything` from table1;").columns_aliases_dict
{'select': ['col2_anything']}

I think the correct answer should be ['col1 with space', 'col2_anything'], but col2_anything is now recognized as "alias" ?

zhaorenjie avatar Nov 03 '23 04:11 zhaorenjie