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 initsqlglot 30119 changes
Breaking changes 16
SortArray is merged into ArraySort, with explicit NULL ordering.
StarRocks no longer treats # as a comment.
Parsing now respects dialect precedence for IS predicates.
StarRocks no longer defaults column names for multi-array UNNEST.
SortArray is merged into ArraySort; update code that uses the former expression.
Hashing now accounts for the case-sensitivity flag on expression nodes, changing hashes for affected nodes.
ClickHouse generation uses JSONExtractRaw for JSON-valued extraction.
DuckDB type inference now returns correct types for temporal interval arithmetic.
Teradata now defaults the window aggregate frame to the whole partition.
Correlated UNNEST fields are resolved from projection types.
infer_schema is removed from the optimizer.
Integer division truncates toward zero instead of rounding.
Preserved function names are scoped to their dialect.
Nested join constructs are expanded during table qualification.
Star expansion follows the order of sources in FROM and expands USING columns first.
String escape decoding and preservation are corrected across BigQuery, MySQL, Hive, Drill, PostgreSQL, DuckDB, Redshift, and ClickHouse.
New APIs and options 11
The optimizer adds PASTE JOIN support.
StarRocks admin and job-control statements are parsed as commands.
StarRocks now supports AGGREGATE KEY tables.
MySQL now supports named FOREIGN KEY indexes.
Doris parsing now supports full-text search operators.
StarRocks now supports HLL columns and the HLL_UNION aggregation type.
Databricks now supports MATCH_RECOGNIZE.
StarRocks parsing now supports REFRESH MATERIALIZED VIEW options.
StarRocks parses TIME_SLICE into exp.TimeSlice.
The MySQL parser supports parsing ASCII and UNICODE.
The optimizer adds a function Mode annotation for DuckDB.
Behavior and default changes 8
MySQL parsing now allows constraints without names.
ALTER actions can be optional and actions and options can appear in any order.
The parser now accepts bare ALTER TABLE ... DROP c syntax.
Spark parses dotted column identifiers in column definitions.
BigQuery and TSQL rewrite aggregate FILTER clauses into conditional aggregates.
Optimizer type annotations for these functions are based on their argument type.
Hive supports FROM-first multi-table INSERT syntax.
The parser supports ALTER statements containing mixed operations.
Tooling 1
Python 3.15 is now supported.
Fixes and other changes 83
Hive and Spark now parse ALTER TABLE REPLACE COLUMNS.
BigQuery transpilation adds support for APPROX_PERCENTILE, along with Trino date parts, FROM_BASE, ARRAY_SORT, and ARRAY_DISTINCT.
BigQuery transpilation adds support for ARRAY_DISTINCT, along with Trino date parts, FROM_BASE, APPROX_PERCENTILE, and ARRAY_SORT.
BigQuery transpilation adds support for ARRAY_SORT, along with Trino date parts, FROM_BASE, APPROX_PERCENTILE, and ARRAY_DISTINCT.
MySQL parsing respects bitwise operator precedence.
The optimizer registers a CTE reference alias when the CTE is pivoted.
StarRocks transpilation keeps DATEDIFF date-part semantics.
DuckDB generation quotes identifiers that are reserved keywords.
MySQL parsing preserves exclamation mark operator precedence.
BigQuery transpilation adds support for FROM_BASE, along with Trino date parts, APPROX_PERCENTILE, ARRAY_SORT, and ARRAY_DISTINCT.
Simplification and the Postgres generator avoid materializing huge interval literals.
Postgres maps the ISO week format pattern IW.
Postgres maps the ISO week-numbering year format pattern IYYY.
Oracle maps ISO week-numbering year IYYY to %G.
StarRocks transpilation preserves LIKE argument order.
Other dialects drop the Teradata LOCKING request modifier instead of crashing.
StarRocks parses map{...} literals as maps.
The parser now supports PARTITION BY EXCLUDING.
ClickHouse parses PASTE JOIN instead of treating it as a table alias.
BigQuery percentile and distinct-array transpilation is corrected.
StarRocks generates PIVOT instead of dropping it.
MySQL transpilation preserves population and sample aggregate semantics.
Teradata transpilation supports SAMPLE row counts and fractions.
StarRocks infers output columns for static pivots.
StarRocks transpilation preserves the native TO_DAYS function.
BigQuery transpilation adds support for Trino date parts, FROM_BASE, APPROX_PERCENTILE, ARRAY_SORT, and ARRAY_DISTINCT.
MySQL parsing now accounts for relative XOR, OR, and AND precedence.
The optimizer now includes semi/anti join references when identifying alias collisions.
Spark parsing now supports all ALTER TABLE DROP COLUMN forms.
DuckDB translation now treats ARRAY_INSERT at index -1 as append for 1-based arrays.
DuckDB translation converts ARRAY_SLICE endpoints to SLICE lengths.
DuckDB translation casts array elements to text before applying the null replacement.
Athena routes tokenization by each engine's rules when the combined tokenizer fails.
Unnesting a COUNT subquery now keeps the alias outside COALESCE.
Oracle parsing now supports CREATE TABLE physical attributes and storage clauses.
Oracle parsing now supports CREATE TABLE TABLESPACE.
Athena CTAS now allows EXTERNAL FUNCTION.
Oracle flashback timestamps are normalized and their parsing is simplified.
Postgres JSON_VALUE support is improved.
Doris now round-trips MATCH operands and quoted analyzers.
Oracle parsing now handles partition clauses and flashback queries.
Oracle parsing expands alternative quoting and supports national literals.
Oracle tokenization now recognizes q'...' quoted string literals.
When REFRESH falls back to a command, the parser now keeps the whole statement.
ClickHouse transpilation now converts RegexpCount to countMatches.
Placeholder replacements now retain their grouping.
The optimizer now qualifies bare USING columns after SEMI/ANTI JOIN.
The optimizer now qualifies columns for SPLIT_TO_TABLE.
The parser supports dropping multiple columns in one ALTER TABLE DROP.
BigQuery and DuckDB no longer drop array elements after a subquery.
Bracket flags are preserved in generator serialization.
Optimization preserves CASE branches that precede always-true conditions.
Snowflake parsing supports (+) outer join markers.
MySQL retains the CHAR length in CHARACTER SET casts.
An edge case in BigQuery array generation is corrected.
Optimizer column resolution is improved for TVFs, PIVOTs, and Snowflake schemas.
DuckDB transpiles Spark CONCAT_WS on arrays to ARRAY_TO_STRING.
ClickHouse generates POSITION(...) > 0 for Contains.
All OR arms are preserved during DNF pushdown for multi-table branches.
DROP INDEX accepts db.t syntax.
The MySQL parser supports these constructs.
The optimizer qualifies DuckDB list comprehension variables.
ClickHouse parsing supports isInfinite.
ClickHouse maps ISO calendar functions in both directions.
Databricks roundtrips retain LIMIT ALL in recursive CTEs.
Snowflake parsing supports LIST and LS stage commands.
The MySQL parser accepts non-CSV table options and handles misplaced table and index options.
The tokenizer incorporates MySQL rules.
Generation resolves only a query's own ORDER BY aliases when simulating NULLS behavior.
Generation escapes identifier escape characters when generating quoted identifiers.
Optimizer simplification can produce scalar subqueries.
The parser allows SEARCH and CYCLE together, including CYCLE TO ... DEFAULT.
The optimizer annotates sha2 properly for Redshift.
DuckDB transpilation preserves Spark array slice length.
Snowflake support is added for SPLIT_TO_TABLE.
PostgreSQL ^@ is parsed as STARTS_WITH.
The builder allows a None table name for sqlglotc.
TSQL parsing supports bare table hints.
Trino preserves precision for all temporal literals.
Trino roundtrips preserve precision for timestamp and time literals.
ClickHouse generation is added for these functions.
DuckDB reads the UNIFORM seed set by the Databricks parser.
DuckDB generates USING SAMPLE before ORDER BY and LIMIT.