You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I believe that union gets improperly indented. The first and second blocks are of the same "importance" but union indents it because I assume it thinks it's a function and the opening parentheses (() at the start. I think this is a bug.
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
union
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
Expected behavior
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
union
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
Actual behavior
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
union
(
select*from"data_warehouse"."order_status"where var1 is not nulland var2 is not nulllimit100
)
The text was updated successfully, but these errors were encountered:
Thanks for the report! union is formatted properly if the second query is not wrapped in parentheses, but I agree with you that this is a bug, and the second query should not be indented
To fix this I think we should create a new token type, SET_OPERATOR to distinguish union from a normal unterminated keyword like select. Then we update the logic for mutating open_brackets so that set operators don't get added to that list (but do have the existing behavior of popping existing unterminated keywords)
Describe the bug
I believe that
union
gets improperly indented. The first and second blocks are of the same "importance" butunion
indents it because I assume it thinks it's a function and the opening parentheses ((
) at the start. I think this is a bug.To Reproduce
Paste the query in http://sqlfmt.com/
Input code
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: