Describe the bug
The sql is broken after formatting.
To Reproduce
The code below:
with
cte1 as (select * from {{ ref("model1") }}),
cte2 as (select * from {{ ref("model2") }}),
cte3 as (
select
cte2.*,
this_column
- that_super_long_long_column_name
as super_long_column_name,
another_long_column_name,
this_column,
yet_another_column
from cte2
left join cte1 using (project_id)
)
select *
from cte3
Once formatted turns into this:
with
cte1 as (select * from {{ ref("model1") }}),
cte2 as (select * from {{ ref("model2") }}),
cte3 as (
select
cte2.*,
this_column - that_super_long_long_column_name as super_long_column_name,
another_long_column_name,
this_column,
yet_another_column
left join cte1 using (project_id)
)
from cte2
select *
from cte3
The from cte2 statement is removed from the cte3 definition.
Describe the bug The sql is broken after formatting.
To Reproduce The code below:
Once formatted turns into this:
The
from cte2
statement is removed from the cte3 definition.Additional context
sqlfmt, version 0.19.0