Skip to content

v0.39.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 21:46
e54a3ed

0.39.0 (2026-11-15)

⚠ BREAKING CHANGES

  • rename module path to github.com/maltzsama/sqlglot-go

Features

  • add the dialect flags and arg order simplify reads (b1f4db1)
  • add the Spark 2, Spark and Databricks dialects (95a9725)
  • bigquery: port the BigQuery dialect (112b692)
  • bigquery: port the BigQuery dialect (8cbe3dc)
  • clickhouse: port the ClickHouse dialect to 468/468 corpus parity (#5) (b81f5b0)
  • databricks: add the Databricks dialect (4e92423)
  • dialects: add Redshift, Materialize and RisingWave dialects (a04109b)
  • dialects: add shared time-format and Postgres family infrastructure (4f257df)
  • dialects: add the PROMOTE_TO_INFERRED_DATETIME_TYPE flag (e304298)
  • dialects: add TSQL (SQL Server) support (782101f)
  • dialects: add TSQL (SQL Server) support (d63eeb3), closes #118
  • dialects: port the Materialize dialect (6b6ffb3)
  • dialects: port the Redshift dialect (f5f06e6)
  • dialects: port the RisingWave dialect (41a9024)
  • dialects: register mariadb as an alias of mysql (1cd9c8b)
  • dialects: register mariadb as an alias of mysql (4d42a2b), closes #17
  • doris: port the Apache Doris dialect to 56/56 corpus parity (33dce2c)
  • doris: port the Apache Doris dialect to 56/56 corpus parity (70f387e)
  • dremio: port the Dremio dialect to 46/46 corpus parity (#63) (27cda27)
  • duckdb: port the DuckDB dialect (71e9873)
  • duckdb: port the DuckDB dialect (dcb5756)
  • expressions: add the ArrayAll and ArrayAny function nodes (771eec9)
  • expressions: add the lookups type annotation needs (b64e86f)
  • expressions: add the Select.having builder (5ad2d13)
  • expressions: add the Spark and Databricks expression node kinds (f667411)
  • expressions: add the STRING function node (98ec771)
  • expressions: annotate expressions with a type (3b5a2c3)
  • expressions: port the function nodes annotate_types could not type (6848866)
  • expressions: port the function nodes annotate_types could not type (4119c24)
  • expressions: port the query builder API used by the optimizer (192ed34)
  • mariadb: give MariaDB its own dialect identity and grammar (#62) (739a5e6)
  • optimizer: complete simplify (d84576f)
  • optimizer: complete simplify (4fe5c8f)
  • optimizer: expand stars through PIVOT and UNPIVOT output columns (#59) (12bc235)
  • optimizer: port annotate_types (c5310e3)
  • optimizer: port annotate_types (3a6ed89)
  • optimizer: port canonicalize (08eebdb)
  • optimizer: port canonicalize (6b0e717)
  • optimizer: port eliminate_ctes and the mutation journal (261bb94)
  • optimizer: port eliminate_ctes, eliminate_subqueries and optimize_joins (ce01ccb)
  • optimizer: port eliminate_joins (1644991)
  • optimizer: port eliminate_subqueries (6ce763b)
  • optimizer: port merge_subqueries (7ff7b7c)
  • optimizer: port normalize (bb8710f)
  • optimizer: port normalize and eliminate_joins (2bcbbdb)
  • optimizer: port optimize (ebb5dd1)
  • optimizer: port optimize and the default rule sequence (04e5ad6)
  • optimizer: port optimize_joins (29af823)
  • optimizer: port pushdown_predicates (168391e)
  • optimizer: port pushdown_predicates and pushdown_projections (0695bdf)
  • optimizer: port pushdown_projections (15c5db8)
  • optimizer: port simplify's gen pseudo-generator (392ca35)
  • optimizer: port the value semantics simplify folds constants with (ca09697)
  • optimizer: port unnest_subqueries (cad44a0)
  • optimizer: port unnest_subqueries and merge_subqueries (15654c4)
  • optimizer: type PIVOT and UNPIVOT columns in annotate_types (dfb70e7)
  • oracle: port the Oracle dialect to 249/249 corpus parity (857ecfd)
  • oracle: port the Oracle dialect to 249/249 corpus parity (ebe49a7)
  • rename module path to github.com/maltzsama/sqlglot-go (721b422)
  • snowflake: port the Snowflake dialect (a4013a3)
  • snowflake: port the Snowflake dialect (33b0fae)
  • spark2: add the Spark 2 parser and generator (29423bf)
  • spark: add the Spark 3 dialect (3e9f437)
  • sqlite: port the SQLite dialect to 137/137 corpus parity (#61) (e1de84e)
  • starrocks: port the StarRocks dialect to 145/145 corpus parity (d38921e)
  • starrocks: port the StarRocks dialect to 145/145 corpus parity (e477b18)
  • teradata: port the Teradata dialect to 84/84 corpus parity (50c852d)
  • teradata: port the Teradata dialect to 84/84 corpus parity (#64) (41e0982)
  • trino: parse and generate inline SQL UDFs (bff1476)
  • trino: parse and generate inline SQL UDFs (032ead7)
  • tsql: close remaining corpus gaps to 613/613 (#4) (4b752de)
  • tsql: extend dialect coverage to 600/613 corpus cases (15dd345)
  • tsql: extend dialect coverage to 600/613 corpus cases (4291041)

Bug Fixes

  • dialects: address review findings on exponent, StrPosition and Teradata generation (e34f80b)
  • dialects: parse postgres TO_TIMESTAMP as UnixToTime or StrToTime (3befdae)
  • dialects: register FROM_BASE in the base function registry (130db88)
  • duckdb: address the review findings (c30eeb4)
  • duckdb: address the second review pass (70233a1)
  • duckdb: group compound operands in the time conversions (55ddcf5)
  • errors: clamp negative limits in ConcatMessages (f97f13f)
  • errors: clamp negative limits in ConcatMessages (c7028f5)
  • expressions: address the review findings (9eda8bd)
  • expressions: give In and Between the Condition trait (0922ad3)
  • generator: address the staticcheck findings in the Spark JSON rendering (3cc0c91)
  • generator: group a compound ARRAY_AGG null-check operand (fe2fffb)
  • generator: harden the ARRAY_AGG null filter (e613cf8)
  • lint: keep analyse in the Redshift reserved keywords (d6d4ef1)
  • optimizer: keep alias column lists when merge_subqueries renames a source (bf25f1c)
  • optimizer: port the v30.17.0 scope traversal for DML and Subquery roots (e0eb848)
  • optimizer: skip a scalar set-operation subquery unnest can't place (3821f41)
  • oracle: keep PL/SQL units whole across inner semicolons (6b029e8), closes #15
  • oracle: treat a SQL*Plus slash line as a statement terminator (0b6db4b), closes #16
  • parser: infer PIVOT output column names (b802c58)
  • parser: parse COPY with credentials as structured Copy nodes (bba7ae5)
  • parser: port Redshift implicit unnest conversion (31c5c52)
  • respect script statement boundaries for GO, slash lines and PL/SQL units (e22aaf1)
  • snowflake: address the review findings (ba93c40)
  • snowflake: render TimeDiff as DATEDIFF (72fb7ed)
  • tsql: treat a GO line as a batch separator (23884ed), closes #14

Performance

  • cut allocations across parse and generate (b3a798d)
  • cut allocations in the parse and generate hot paths (71ec633)
  • cut parse allocations with lazy maps and cached lookups (a0ac258)
  • cut parse allocations with lazy maps and cached lookups (4cc0d8d)
  • dialects: cache dialect templates (59224a8)
  • dialects: share the cached template on read-only paths (50c5024)
  • expressions: build copied nodes in one pass (fb8b57c)
  • tokens: index ASCII input without converting to runes (dea3055)

Documentation

  • describe annotate_types as ported (5de040d)
  • describe the repository as a maintained fork (e6df3a6)
  • document the Spark 2, Spark and Databricks dialects (9b18ac4)
  • drop the deferred PIVOT note from the roadmap (922c446)
  • expressions: document the init-only parser hooks (9caee23)
  • list canonicalize as ported (703dcbd)
  • list normalize and eliminate_joins as ported (78e3bf7)
  • list optimize as ported (90e1e32)
  • list Redshift, Materialize and RisingWave in the dialect docs (d94d898)
  • list simplify as ported (bcb7761)
  • list the newly ported optimizer passes (b2afccf)
  • list the pushdown passes as ported (8bb849f)
  • list unnest_subqueries and merge_subqueries as ported (6aa06cb)
  • make the fork consumable as github.com/maltzsama/sqlglot-go (4b1cd5e)
  • note DuckDB and Snowflake in the dialect status (e15bfda)
  • roadmap: record the Redshift test port and its known divergences (701863d)

Refactoring

  • address staticcheck findings in annotate_types (607a0fa)
  • address staticcheck findings in simplify (ab25fde)
  • address staticcheck findings in the new optimizer code (131e50d)
  • apply De Morgan's law across simplify's guards (4713647)
  • flatten control-flow guard clauses (b7662a3)
  • flatten control-flow guard clauses (76924fe)
  • gate Postgres behavior on the dialect family, not its name (63894c0)
  • optimizer: keep the typing metadata as plain Go source (ca2b083)
  • oracle: drop dead code and the rendered-SQL Var hack (12533f1)
  • parser: make function-parser registration order-independent (9283d75)