unstale

pypi / sqlglot

sqlglot

What changed in sqlglot 30, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.

16 breaking11 new APIs and options8 behavior and defaults1 tooling83 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.1 on npm

sqlglot 30119 changes

Breaking changes 16

  • SortArray is merged into ArraySort, with explicit NULL ordering.

    30.24.0release notes

  • StarRocks no longer treats # as a comment.

    30.24.0release notes

  • Parsing now respects dialect precedence for IS predicates.

    30.24.0release notes

  • StarRocks no longer defaults column names for multi-array UNNEST.

    30.24.0release notes

  • SortArray is merged into ArraySort; update code that uses the former expression.

    30.24.0release notes

  • Hashing now accounts for the case-sensitivity flag on expression nodes, changing hashes for affected nodes.

    30.23.0release notes

  • ClickHouse generation uses JSONExtractRaw for JSON-valued extraction.

    30.23.0release notes

  • DuckDB type inference now returns correct types for temporal interval arithmetic.

    30.23.0release notes

  • Teradata now defaults the window aggregate frame to the whole partition.

    30.23.0release notes

  • Correlated UNNEST fields are resolved from projection types.

    30.22.0release notes

  • infer_schema is removed from the optimizer.

    30.22.0release notes

  • Integer division truncates toward zero instead of rounding.

    30.22.0release notes

  • Preserved function names are scoped to their dialect.

    30.22.0release notes

  • Nested join constructs are expanded during table qualification.

    30.22.0release notes

  • Star expansion follows the order of sources in FROM and expands USING columns first.

    30.22.0release notes

  • String escape decoding and preservation are corrected across BigQuery, MySQL, Hive, Drill, PostgreSQL, DuckDB, Redshift, and ClickHouse.

    30.22.0release notes

New APIs and options 11

  • The optimizer adds PASTE JOIN support.

    30.24.0release notes

  • StarRocks admin and job-control statements are parsed as commands.

    30.24.0release notes

  • StarRocks now supports AGGREGATE KEY tables.

    30.23.0release notes

  • MySQL now supports named FOREIGN KEY indexes.

    30.23.0release notes

  • Doris parsing now supports full-text search operators.

    30.23.0release notes

  • StarRocks now supports HLL columns and the HLL_UNION aggregation type.

    30.23.0release notes

  • Databricks now supports MATCH_RECOGNIZE.

    30.23.0release notes

  • StarRocks parsing now supports REFRESH MATERIALIZED VIEW options.

    30.23.0release notes

  • StarRocks parses TIME_SLICE into exp.TimeSlice.

    30.23.0release notes

  • The MySQL parser supports parsing ASCII and UNICODE.

    30.22.0release notes

  • The optimizer adds a function Mode annotation for DuckDB.

    30.22.0release notes

Behavior and default changes 8

  • MySQL parsing now allows constraints without names.

    30.23.0release notes

  • ALTER actions can be optional and actions and options can appear in any order.

    30.22.0release notes

  • The parser now accepts bare ALTER TABLE ... DROP c syntax.

    30.22.0release notes

  • Spark parses dotted column identifiers in column definitions.

    30.22.0release notes

  • BigQuery and TSQL rewrite aggregate FILTER clauses into conditional aggregates.

    30.22.0release notes

  • Optimizer type annotations for these functions are based on their argument type.

    30.22.0release notes

  • Hive supports FROM-first multi-table INSERT syntax.

    30.22.0release notes

  • The parser supports ALTER statements containing mixed operations.

    30.22.0release notes

Tooling 1

Fixes and other changes 83

  • Hive and Spark now parse ALTER TABLE REPLACE COLUMNS.

    30.24.0release notes

  • BigQuery transpilation adds support for APPROX_PERCENTILE, along with Trino date parts, FROM_BASE, ARRAY_SORT, and ARRAY_DISTINCT.

    30.24.0release notes

  • BigQuery transpilation adds support for ARRAY_DISTINCT, along with Trino date parts, FROM_BASE, APPROX_PERCENTILE, and ARRAY_SORT.

    30.24.0release notes

  • BigQuery transpilation adds support for ARRAY_SORT, along with Trino date parts, FROM_BASE, APPROX_PERCENTILE, and ARRAY_DISTINCT.

    30.24.0release notes

  • MySQL parsing respects bitwise operator precedence.

    30.24.0release notes

  • The optimizer registers a CTE reference alias when the CTE is pivoted.

    30.24.0release notes

  • StarRocks transpilation keeps DATEDIFF date-part semantics.

    30.24.0release notes

  • DuckDB generation quotes identifiers that are reserved keywords.

    30.24.0release notes

  • MySQL parsing preserves exclamation mark operator precedence.

    30.24.0release notes

  • BigQuery transpilation adds support for FROM_BASE, along with Trino date parts, APPROX_PERCENTILE, ARRAY_SORT, and ARRAY_DISTINCT.

    30.24.0release notes

  • Simplification and the Postgres generator avoid materializing huge interval literals.

    30.24.0release notes

  • Postgres maps the ISO week format pattern IW.

    30.24.0release notes

  • Postgres maps the ISO week-numbering year format pattern IYYY.

    30.24.0release notes

  • Oracle maps ISO week-numbering year IYYY to %G.

    30.24.0release notes

  • StarRocks transpilation preserves LIKE argument order.

    30.24.0release notes

  • Other dialects drop the Teradata LOCKING request modifier instead of crashing.

    30.24.0release notes

  • StarRocks parses map{...} literals as maps.

    30.24.0release notes

  • The parser now supports PARTITION BY EXCLUDING.

    30.24.0release notes

  • ClickHouse parses PASTE JOIN instead of treating it as a table alias.

    30.24.0release notes

  • BigQuery percentile and distinct-array transpilation is corrected.

    30.24.0release notes

  • StarRocks generates PIVOT instead of dropping it.

    30.24.0release notes

  • MySQL transpilation preserves population and sample aggregate semantics.

    30.24.0release notes

  • Teradata transpilation supports SAMPLE row counts and fractions.

    30.24.0release notes

  • StarRocks infers output columns for static pivots.

    30.24.0release notes

  • StarRocks transpilation preserves the native TO_DAYS function.

    30.24.0release notes

  • BigQuery transpilation adds support for Trino date parts, FROM_BASE, APPROX_PERCENTILE, ARRAY_SORT, and ARRAY_DISTINCT.

    30.24.0release notes

  • MySQL parsing now accounts for relative XOR, OR, and AND precedence.

    30.24.0release notes

  • The optimizer now includes semi/anti join references when identifying alias collisions.

    30.23.0release notes

  • Spark parsing now supports all ALTER TABLE DROP COLUMN forms.

    30.23.0release notes

  • DuckDB translation now treats ARRAY_INSERT at index -1 as append for 1-based arrays.

    30.23.0release notes

  • DuckDB translation converts ARRAY_SLICE endpoints to SLICE lengths.

    30.23.0release notes

  • DuckDB translation casts array elements to text before applying the null replacement.

    30.23.0release notes

  • Athena routes tokenization by each engine's rules when the combined tokenizer fails.

    30.23.0release notes

  • Unnesting a COUNT subquery now keeps the alias outside COALESCE.

    30.23.0release notes

  • Oracle parsing now supports CREATE TABLE physical attributes and storage clauses.

    30.23.0release notes

  • Oracle parsing now supports CREATE TABLE TABLESPACE.

    30.23.0release notes

  • Athena CTAS now allows EXTERNAL FUNCTION.

    30.23.0release notes

  • Oracle flashback timestamps are normalized and their parsing is simplified.

    30.23.0release notes

  • Postgres JSON_VALUE support is improved.

    30.23.0release notes

  • Doris now round-trips MATCH operands and quoted analyzers.

    30.23.0release notes

  • Oracle parsing now handles partition clauses and flashback queries.

    30.23.0release notes

  • Oracle parsing expands alternative quoting and supports national literals.

    30.23.0release notes

  • Oracle tokenization now recognizes q'...' quoted string literals.

    30.23.0release notes

  • When REFRESH falls back to a command, the parser now keeps the whole statement.

    30.23.0release notes

  • ClickHouse transpilation now converts RegexpCount to countMatches.

    30.23.0release notes

  • Placeholder replacements now retain their grouping.

    30.23.0release notes

  • The optimizer now qualifies bare USING columns after SEMI/ANTI JOIN.

    30.23.0release notes

  • The optimizer now qualifies columns for SPLIT_TO_TABLE.

    30.23.0release notes

  • The parser supports dropping multiple columns in one ALTER TABLE DROP.

    30.22.0release notes

  • BigQuery and DuckDB no longer drop array elements after a subquery.

    30.22.0release notes

  • Bracket flags are preserved in generator serialization.

    30.22.0release notes

  • Optimization preserves CASE branches that precede always-true conditions.

    30.22.0release notes

  • Snowflake parsing supports (+) outer join markers.

    30.22.0release notes

  • MySQL retains the CHAR length in CHARACTER SET casts.

    30.22.0release notes

  • An edge case in BigQuery array generation is corrected.

    30.22.0release notes

  • Optimizer column resolution is improved for TVFs, PIVOTs, and Snowflake schemas.

    30.22.0release notes

  • DuckDB transpiles Spark CONCAT_WS on arrays to ARRAY_TO_STRING.

    30.22.0release notes

  • ClickHouse generates POSITION(...) > 0 for Contains.

    30.22.0release notes

  • All OR arms are preserved during DNF pushdown for multi-table branches.

    30.22.0release notes

  • DROP INDEX accepts db.t syntax.

    30.22.0release notes

  • The MySQL parser supports these constructs.

    30.22.0release notes

  • The optimizer qualifies DuckDB list comprehension variables.

    30.22.0release notes

  • ClickHouse parsing supports isInfinite.

    30.22.0release notes

  • ClickHouse maps ISO calendar functions in both directions.

    30.22.0release notes

  • Databricks roundtrips retain LIMIT ALL in recursive CTEs.

    30.22.0release notes

  • Snowflake parsing supports LIST and LS stage commands.

    30.22.0release notes

  • The MySQL parser accepts non-CSV table options and handles misplaced table and index options.

    30.22.0release notes

  • The tokenizer incorporates MySQL rules.

    30.22.0release notes

  • Generation resolves only a query's own ORDER BY aliases when simulating NULLS behavior.

    30.22.0release notes

  • Generation escapes identifier escape characters when generating quoted identifiers.

    30.22.0release notes

  • Optimizer simplification can produce scalar subqueries.

    30.22.0release notes

  • The parser allows SEARCH and CYCLE together, including CYCLE TO ... DEFAULT.

    30.22.0release notes

  • The optimizer annotates sha2 properly for Redshift.

    30.22.0release notes

  • DuckDB transpilation preserves Spark array slice length.

    30.22.0release notes

  • Snowflake support is added for SPLIT_TO_TABLE.

    30.22.0release notes

  • PostgreSQL ^@ is parsed as STARTS_WITH.

    30.22.0release notes

  • The builder allows a None table name for sqlglotc.

    30.22.0release notes

  • TSQL parsing supports bare table hints.

    30.22.0release notes

  • Trino preserves precision for all temporal literals.

    30.22.0release notes

  • Trino roundtrips preserve precision for timestamp and time literals.

    30.22.0release notes

  • ClickHouse generation is added for these functions.

    30.22.0release notes

  • DuckDB reads the UNIFORM seed set by the Databricks parser.

    30.22.0release notes

  • DuckDB generates USING SAMPLE before ORDER BY and LIMIT.

    30.22.0release notes