Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Formatting Changes and Bug Fixes

- sqlfmt now lexes ClickHouse `any left join` as a join keyword; in 0.28.0 we only supported the other syntax, `left any join` ([#719](https://github.com/tconbeer/sqlfmt/issues/719) - thank you [@haild-metricvn](https://github.com/haild-metricvn); see also [#713](https://github.com/tconbeer/sqlfmt/pull/713)).

## [0.28.1] - 2025-10-22

### Formatting Changes and Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion src/sqlfmt/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
r"delete\s+from",
r"from",
(
r"((global|natural|asof)\s+)?"
r"((global|natural|asof|any)\s+)?"
r"((inner|left|right|full|cross)\s+)?"
r"((outer|semi|anti|any|all|asof|cross|positional|array|paste)\s+)?join"
),
Expand Down
4 changes: 2 additions & 2 deletions tests/data/unformatted/220_clickhouse_joins.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ FROM
count() AS hits
FROM test.hits
GROUP BY CounterID
) LEFT ANY JOIN
) ANY LEFT JOIN
(
SELECT
CounterID,
Expand Down Expand Up @@ -89,7 +89,7 @@ where

select counterid, hits, visits
from (select counterid, count() as hits from test.hits group by counterid)
left any join
any left join
(select counterid, sum(sign) as visits from test.visits group by counterid)
using counterid
order by hits desc
Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def get_rule(ruleset: List[Rule], rule_name: str) -> Rule:
(MAIN, "unterm_keyword", "anti join"),
(MAIN, "unterm_keyword", "any join"),
(MAIN, "unterm_keyword", "left any join"),
(MAIN, "unterm_keyword", "any left join"),
(MAIN, "unterm_keyword", "all join"),
(MAIN, "unterm_keyword", "array join"),
(MAIN, "unterm_keyword", "left array join"),
Expand Down