[3.3.0] – 2024-12-10

Highlights

This release brings a few more significant changes. Especially given the introduction of several new rules, we highly recommend testing this release on your project before upgrading to make sure they are configured appropriately for your project style guide. As always, we have tried to make sure that the defaults for all new rules are both widely applicable, and fairly light touch. While all have been tested on some existing larger codebases which the maintainers have access to – do still report any bugs you might find on GitHub in the usual manner.

  • We’ve dropped the appdirs package as a dependency (as an abandoned project) and instead added platformdirs instead. Users should not notice any functionality changes beyond the different dependency.
  • TWO new dialects: Impala and StarRocks.
  • FIVE new rules:
    • AM08 (ambiguous.join_condition), which detects JOIN clauses without conditions (i.e. without an ON or USING clause). These are often typos and can result in significant row count increases if unintended.
    • CV12 (convention.join_condition), which is related to AM08 and detects cases where users have used a WHERE clause instead of a JOIN ... ON ... clause to do their join conditions. The join condition is a form of metadata and should communicate to the end user how the table should be joined. By mixing this information into the WHERE clause it makes the SQL harder to understand.
    • LT14 (layout.keyword_newline), which allows certain keywords to trigger line breaks in queries. Primarily this forces the main SELECT statement clauses like WHERE, GROUP BY etc. onto new lines. This rule has been designed to be highly configurable, but with sensible light-touch defaults. Check out the docs to adapt it to the conventions of your project.
    • ST10 (structure.constant_expression), some SQL users include redundant expressions in their code (e.g. WHERE tbl.col = tbl.col). These conditions always evaluate to a constant outcome (i.e. always evaluate as TRUE or FALSE) as so add no functionality or meaning to the query. This rule catches them.
    • ST11 (structure.unused_join), which detects unused joins in SQL statements, and is designed to catch tables that were once used, but where the column references have since been removed and now the table is unnecessary.

Beyond these changes, we’ve seen a whole host of dialect improvements to almost all of the supported dialects and several bugfixes which are combined into this release.

We also welcome TWELVE new contributors to the project in this release. Thanks to all of them for their hard work 🚀🏆🚀.

What’s Changed

 

Source: https://github.com/sqlfluff/sqlfluff/releases/tag/3.3.0

More From Author

Leave a Reply

Recent Comments

No comments to show.