sql-metadata
sql-metadata copied to clipboard
with_name marked as table
Hi! Thank you, your package is very useful to us!
We encountered a minor issue with a query where some with_name is incorrectly marked as a table. I built this minimal example:
import sql_metadata
query = """
with
A as (
with intermediate_query as (
select
id,
some_column
from table_one
)
select
id,
some_column
from intermediate_query
),
B as (
select
id,
other_column
from table_two
)
select
A.id,
some_column,
other_column
from A
inner join B
on A.id = B.id
"""
parser = sql_metadata.Parser(query)
parser.tables, parser.with_names
With version 2.8.0 I get
(['table_one', 'B', 'table_two'], ['A', 'intermediate_table'])