ITADN

Formatting breaking with bigquery's `outer union all by name`

#707Openkarlanka 创建于 2025-10-03
K
karlankacommented
**Describe the bug** Bigquery fairly recently launched support for union by name (https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#by_name_or_corresponding). In short this is a union by column name instead of order. `sqlfmt` formats this in a way that makes me think it is not fully understood? **To Reproduce** Run `sqlfmt` on this query: ```sql select * from one_table left outer union all by name select * from another_table ``` **Expected behavior** I would expect that `sqlfmt` left the query above untouched. **Actual behavior** This is the result: ```sql select * from one_table left outer union all by name select * from another_table ``` **Additional context** This query shows the same behaviour: ```sql select * from one_table outer union all by name select * from another_table ``` But this one is untouched: ```sql select * from one_table union all by name select * from another_table ``` What is the output of `sqlfmt --version`? `sqlfmt, version 0.27.0` I am using: ``` [tool.sqlfmt] dialect = "bigquery" ```
1 条评论