sqlglot 30.19.0__tar.gz → 30.21.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlglot-30.19.0 → sqlglot-30.21.0}/CHANGELOG.md +274 -0
- {sqlglot-30.19.0/sqlglot.egg-info → sqlglot-30.21.0}/PKG-INFO +3 -3
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/athena.py +2 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/dialect.py +18 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/snowflake.py +2 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/starrocks.py +1 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/json.py +1 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/query.py +13 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generator.py +43 -3
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/athena.py +1 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/bigquery.py +5 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/clickhouse.py +1 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/duckdb.py +7 -5
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/mysql.py +2 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/singlestore.py +6 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/spark.py +3 -3
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/spark2.py +10 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/sqlite.py +13 -6
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/starrocks.py +19 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/canonicalize_internal_names.py +6 -4
- sqlglot-30.21.0/sqlglot/optimizer/helpers.py +49 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/merge_subqueries.py +88 -12
- sqlglot-30.21.0/sqlglot/optimizer/pushdown_projections.py +600 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/qualify_columns.py +40 -15
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/resolver.py +16 -12
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/simplify.py +5 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/unnest_subqueries.py +5 -24
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parser.py +30 -11
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/athena.py +5 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/clickhouse.py +9 -6
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/hive.py +37 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/spark.py +2 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/spark2.py +2 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/teradata.py +2 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/tokenizer_core.py +110 -4
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/tokens.py +14 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/transforms.py +6 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/duckdb.py +34 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.egg-info/SOURCES.txt +1 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.egg-info/requires.txt +2 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.egg-info/scm_file_list.json +1 -0
- sqlglot-30.21.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_athena.py +33 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_bigquery.py +30 -6
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_clickhouse.py +31 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_dialect.py +74 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_duckdb.py +41 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_hive.py +4 -4
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_mysql.py +13 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_postgres.py +19 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_presto.py +3 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_singlestore.py +0 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_snowflake.py +17 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_spark.py +22 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_sqlite.py +54 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_starrocks.py +30 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_trino.py +18 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_tsql.py +1 -1
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/annotate_functions.sql +46 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/annotate_types.sql +28 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +7 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/merge_subqueries.sql +4 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/optimizer.sql +77 -52
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/pushdown_projections.sql +29 -2
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/qualify_columns.sql +42 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +4 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +2 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/simplify.sql +148 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_anonymize.py +7 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_optimizer.py +161 -40
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_parser.py +15 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_transforms.py +24 -5
- sqlglot-30.19.0/sqlglot/optimizer/pushdown_projections.py +0 -390
- sqlglot-30.19.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.19.0 → sqlglot-30.21.0}/.gitignore +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/.gitmodules +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/.gitpod.yml +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/AGENTS.md +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/CLAUDE.md +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/LICENSE +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/MANIFEST.in +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/Makefile +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/README.md +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/pyproject.toml +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/setup.cfg +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/setup.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/bigquery.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/duckdb.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/core.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/postgres.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/duckdb.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/snowflake.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/sqlite.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/time.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/bigquery.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglot.png +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/helpers.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_build.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_diff.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_docs.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_errors.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_executor.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_generator.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_helper.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_schema.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_serde.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_time.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_transpile.py +0 -0
- {sqlglot-30.19.0 → sqlglot-30.21.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,278 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.20.0] - 2026-09-27
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`1d0e3f3`](https://github.com/tobymao/sqlglot/commit/1d0e3f34864037c54cf6bdf45af594db62ad7319) - Fix mysql roundtrip for DATE_ADD and DATE_SUB *(PR [#8417](https://github.com/tobymao/sqlglot/pull/8417) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
7
|
+
|
|
8
|
+
Fix mysql roundtrip for DATE_ADD and DATE_SUB (#8417)
|
|
9
|
+
|
|
10
|
+
- due to [`284ea43`](https://github.com/tobymao/sqlglot/commit/284ea43fe773762a1aa1556171bbb4c03a197788) - support IGNORE NULLS and RESPECT NULLS in window functions [CLAUDE] *(PR [#8412](https://github.com/tobymao/sqlglot/pull/8412) by [@UCHPUCHMAK](https://github.com/UCHPUCHMAK))*:
|
|
11
|
+
|
|
12
|
+
support IGNORE NULLS and RESPECT NULLS in window functions [CLAUDE] (#8412)
|
|
13
|
+
|
|
14
|
+
- due to [`abacf31`](https://github.com/tobymao/sqlglot/commit/abacf31d7b12b3bd70cd4a70b25cfcd2ad6c1f0a) - use row-preserving default projection for windowed aggregates *(PR [#8381](https://github.com/tobymao/sqlglot/pull/8381) by [@treysp](https://github.com/treysp))*:
|
|
15
|
+
|
|
16
|
+
use row-preserving default projection for windowed aggregates (#8381)
|
|
17
|
+
|
|
18
|
+
- due to [`a388416`](https://github.com/tobymao/sqlglot/commit/a3884168f639633fa8f64334bf63e4b343bedfe2) - retain json <string> literals closes [#8413](https://github.com/tobymao/sqlglot/pull/8413) *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
19
|
+
|
|
20
|
+
retain json <string> literals closes #8413
|
|
21
|
+
|
|
22
|
+
- due to [`20fa8ae`](https://github.com/tobymao/sqlglot/commit/20fa8aedc48fccb780b973987908db63d0f76895) - keep `TRY_TO_NUMBER` safe when it falls back to a cast [CLAUDE] *(PR [#8424](https://github.com/tobymao/sqlglot/pull/8424) by [@anishmehta24](https://github.com/anishmehta24))*:
|
|
23
|
+
|
|
24
|
+
keep `TRY_TO_NUMBER` safe when it falls back to a cast [CLAUDE] (#8424)
|
|
25
|
+
|
|
26
|
+
- due to [`b85a8c8`](https://github.com/tobymao/sqlglot/commit/b85a8c8b0d107410f6689c2ddad0921dbff9ddad) - exponential AST growth prevention in merge_subqueries *(PR [#8427](https://github.com/tobymao/sqlglot/pull/8427) by [@georgesittas](https://github.com/georgesittas))*:
|
|
27
|
+
|
|
28
|
+
exponential AST growth prevention in merge_subqueries (#8427)
|
|
29
|
+
|
|
30
|
+
- due to [`4c11d07`](https://github.com/tobymao/sqlglot/commit/4c11d07af4b533274cabbcae9271234e9a0b039c) - avoid AUTOINCREMENT without a primary key *(PR [#8431](https://github.com/tobymao/sqlglot/pull/8431) by [@georgesittas](https://github.com/georgesittas))*:
|
|
31
|
+
|
|
32
|
+
avoid AUTOINCREMENT without a primary key (#8431)
|
|
33
|
+
|
|
34
|
+
- due to [`d2fbb21`](https://github.com/tobymao/sqlglot/commit/d2fbb215ff6bd548547a151e8838c277aad076c1) - preserve TIMESTAMP_FROM_PARTS time zones ([#8422](https://github.com/tobymao/sqlglot/pull/8422)) *(PR [#8434](https://github.com/tobymao/sqlglot/pull/8434) by [@georgesittas](https://github.com/georgesittas))*:
|
|
35
|
+
|
|
36
|
+
preserve TIMESTAMP_FROM_PARTS time zones (#8422) (#8434)
|
|
37
|
+
|
|
38
|
+
- due to [`afd6b69`](https://github.com/tobymao/sqlglot/commit/afd6b6946267b0b1100f48b299f3d44ff9a13767) - annotate `bit_or` for duckdb *(PR [#8438](https://github.com/tobymao/sqlglot/pull/8438) by [@deepika-kakde](https://github.com/deepika-kakde))*:
|
|
39
|
+
|
|
40
|
+
annotate `bit_or` for duckdb (#8438)
|
|
41
|
+
|
|
42
|
+
- due to [`8bd7686`](https://github.com/tobymao/sqlglot/commit/8bd768664197fbd0ed86158c0eca955c14f43328) - annotate `bit_and` for duckdb *(PR [#8439](https://github.com/tobymao/sqlglot/pull/8439) by [@Anuja006](https://github.com/Anuja006))*:
|
|
43
|
+
|
|
44
|
+
annotate `bit_and` for duckdb (#8439)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### :sparkles: New Features
|
|
48
|
+
- [`a313c8b`](https://github.com/tobymao/sqlglot/commit/a313c8bee143b4b92c9a068fef72a5fd512bba61) - **parser**: support boolean expressions in update assignments closes [#8428](https://github.com/tobymao/sqlglot/pull/8428) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
49
|
+
- [`afd6b69`](https://github.com/tobymao/sqlglot/commit/afd6b6946267b0b1100f48b299f3d44ff9a13767) - **optimizer**: annotate `bit_or` for duckdb *(PR [#8438](https://github.com/tobymao/sqlglot/pull/8438) by [@deepika-kakde](https://github.com/deepika-kakde))*
|
|
50
|
+
- [`8bd7686`](https://github.com/tobymao/sqlglot/commit/8bd768664197fbd0ed86158c0eca955c14f43328) - **optimizer**: annotate `bit_and` for duckdb *(PR [#8439](https://github.com/tobymao/sqlglot/pull/8439) by [@Anuja006](https://github.com/Anuja006))*
|
|
51
|
+
|
|
52
|
+
### :bug: Bug Fixes
|
|
53
|
+
- [`1d0e3f3`](https://github.com/tobymao/sqlglot/commit/1d0e3f34864037c54cf6bdf45af594db62ad7319) - **mysql**: Fix mysql roundtrip for DATE_ADD and DATE_SUB *(PR [#8417](https://github.com/tobymao/sqlglot/pull/8417) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
54
|
+
- :arrow_lower_right: *fixes issue [#8392](https://github.com/tobymao/sqlglot/issues/8392) opened by [@linchangyang-sg](https://github.com/linchangyang-sg)*
|
|
55
|
+
- [`284ea43`](https://github.com/tobymao/sqlglot/commit/284ea43fe773762a1aa1556171bbb4c03a197788) - **starrocks**: support IGNORE NULLS and RESPECT NULLS in window functions [CLAUDE] *(PR [#8412](https://github.com/tobymao/sqlglot/pull/8412) by [@UCHPUCHMAK](https://github.com/UCHPUCHMAK))*
|
|
56
|
+
- [`abacf31`](https://github.com/tobymao/sqlglot/commit/abacf31d7b12b3bd70cd4a70b25cfcd2ad6c1f0a) - **optimizer**: use row-preserving default projection for windowed aggregates *(PR [#8381](https://github.com/tobymao/sqlglot/pull/8381) by [@treysp](https://github.com/treysp))*
|
|
57
|
+
- [`a388416`](https://github.com/tobymao/sqlglot/commit/a3884168f639633fa8f64334bf63e4b343bedfe2) - retain json <string> literals closes [#8413](https://github.com/tobymao/sqlglot/pull/8413) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
58
|
+
- [`32a9297`](https://github.com/tobymao/sqlglot/commit/32a9297a24f06035293a2a3e935a7b65ece25755) - **optimizer**: avoid accumulating parentheses when merging repeated references *(PR [#8425](https://github.com/tobymao/sqlglot/pull/8425) by [@georgesittas](https://github.com/georgesittas))*
|
|
59
|
+
- [`20fa8ae`](https://github.com/tobymao/sqlglot/commit/20fa8aedc48fccb780b973987908db63d0f76895) - keep `TRY_TO_NUMBER` safe when it falls back to a cast [CLAUDE] *(PR [#8424](https://github.com/tobymao/sqlglot/pull/8424) by [@anishmehta24](https://github.com/anishmehta24))*
|
|
60
|
+
- [`b85a8c8`](https://github.com/tobymao/sqlglot/commit/b85a8c8b0d107410f6689c2ddad0921dbff9ddad) - **optimizer**: exponential AST growth prevention in merge_subqueries *(PR [#8427](https://github.com/tobymao/sqlglot/pull/8427) by [@georgesittas](https://github.com/georgesittas))*
|
|
61
|
+
- [`8d9f5d0`](https://github.com/tobymao/sqlglot/commit/8d9f5d08cce4b72b4df1a8f6394c2aa043cc7de8) - **parser**: handle singular ROW in FETCH and OFFSET clauses closes [#8429](https://github.com/tobymao/sqlglot/pull/8429) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
62
|
+
- [`981e492`](https://github.com/tobymao/sqlglot/commit/981e492413740f7740d2b0288e3da5b4028c767e) - **clickhouse**: preserve GLOBAL JOIN after ON conditions fixes [#8426](https://github.com/tobymao/sqlglot/pull/8426) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
63
|
+
- [`4c11d07`](https://github.com/tobymao/sqlglot/commit/4c11d07af4b533274cabbcae9271234e9a0b039c) - **sqlite**: avoid AUTOINCREMENT without a primary key *(PR [#8431](https://github.com/tobymao/sqlglot/pull/8431) by [@georgesittas](https://github.com/georgesittas))*
|
|
64
|
+
- :arrow_lower_right: *fixes issue [#8423](https://github.com/tobymao/sqlglot/issues/8423) opened by [@Rodrigo-Palma](https://github.com/Rodrigo-Palma)*
|
|
65
|
+
- [`87b1402`](https://github.com/tobymao/sqlglot/commit/87b14027372c3820cbf6c89bc8adc2cbf8963404) - **optimizer**: preserve grouping when complementing comparisons *(PR [#8433](https://github.com/tobymao/sqlglot/pull/8433) by [@georgesittas](https://github.com/georgesittas))*
|
|
66
|
+
- :arrow_lower_right: *fixes issue [#8421](https://github.com/tobymao/sqlglot/issues/8421) opened by [@Rodrigo-Palma](https://github.com/Rodrigo-Palma)*
|
|
67
|
+
- [`d2fbb21`](https://github.com/tobymao/sqlglot/commit/d2fbb215ff6bd548547a151e8838c277aad076c1) - **duckdb**: preserve TIMESTAMP_FROM_PARTS time zones ([#8422](https://github.com/tobymao/sqlglot/pull/8422)) *(PR [#8434](https://github.com/tobymao/sqlglot/pull/8434) by [@georgesittas](https://github.com/georgesittas))*
|
|
68
|
+
- :arrow_lower_right: *fixes issue [#8422](https://github.com/tobymao/sqlglot/issues/8422) opened by [@Rodrigo-Palma](https://github.com/Rodrigo-Palma)*
|
|
69
|
+
- [`d01e946`](https://github.com/tobymao/sqlglot/commit/d01e9461a7a3fcbe50a965c7a2ddf55d41aca97d) - **optimizer**: preserve ordinal ordering with duplicate aliases [CODEX] *(PR [#8436](https://github.com/tobymao/sqlglot/pull/8436) by [@tobymao](https://github.com/tobymao))*
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## [v30.19.0] - 2026-09-22
|
|
73
|
+
### :boom: BREAKING CHANGES
|
|
74
|
+
- due to [`bbb717e`](https://github.com/tobymao/sqlglot/commit/bbb717ebb24c8dcbee94d77c9154e74da1dc6c10) - rename union scope type to set operation for consistency *(PR [#8306](https://github.com/tobymao/sqlglot/pull/8306) by [@georgesittas](https://github.com/georgesittas))*:
|
|
75
|
+
|
|
76
|
+
rename union scope type to set operation for consistency (#8306)
|
|
77
|
+
|
|
78
|
+
- due to [`d7dd2cd`](https://github.com/tobymao/sqlglot/commit/d7dd2cd18fd214892136b4d0706cd65d348da285) - annotate function replace for postgres *(PR [#8307](https://github.com/tobymao/sqlglot/pull/8307) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
79
|
+
|
|
80
|
+
annotate function replace for postgres (#8307)
|
|
81
|
+
|
|
82
|
+
- due to [`9794193`](https://github.com/tobymao/sqlglot/commit/97941935711779438b34e11edbed6a736d2ad0c6) - preserve the order of CUBE, ROLLUP and GROUPING SETS in GROUP BY *(PR [#8312](https://github.com/tobymao/sqlglot/pull/8312) by [@georgesittas](https://github.com/georgesittas))*:
|
|
83
|
+
|
|
84
|
+
preserve the order of CUBE, ROLLUP and GROUPING SETS in GROUP BY (#8312)
|
|
85
|
+
|
|
86
|
+
- due to [`8bf484c`](https://github.com/tobymao/sqlglot/commit/8bf484ce23ad684430675d60fcd82c05a957e4db) - Fix the json path with single quote issue *(PR [#8309](https://github.com/tobymao/sqlglot/pull/8309) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
87
|
+
|
|
88
|
+
Fix the json path with single quote issue (#8309)
|
|
89
|
+
|
|
90
|
+
- due to [`1d753d7`](https://github.com/tobymao/sqlglot/commit/1d753d72c6e81e39cfc7160af33673314d4d600e) - EXISTS over a scalar aggregate is always true [CLAUDE] *(PR [#8304](https://github.com/tobymao/sqlglot/pull/8304) by [@jbylund](https://github.com/jbylund))*:
|
|
91
|
+
|
|
92
|
+
EXISTS over a scalar aggregate is always true [CLAUDE] (#8304)
|
|
93
|
+
|
|
94
|
+
- due to [`106ad25`](https://github.com/tobymao/sqlglot/commit/106ad25d3500f479144a24f3130c8a45a1d547b0) - decorrelation when non-EQ keys are present *(PR [#8317](https://github.com/tobymao/sqlglot/pull/8317) by [@georgesittas](https://github.com/georgesittas))*:
|
|
95
|
+
|
|
96
|
+
decorrelation when non-EQ keys are present (#8317)
|
|
97
|
+
|
|
98
|
+
- due to [`0d88a21`](https://github.com/tobymao/sqlglot/commit/0d88a211de50fa118e7e7185665d2f31310fceaa) - don't fan out EXISTS decorrelation over grouped subqueries *(PR [#8318](https://github.com/tobymao/sqlglot/pull/8318) by [@georgesittas](https://github.com/georgesittas))*:
|
|
99
|
+
|
|
100
|
+
don't fan out EXISTS decorrelation over grouped subqueries (#8318)
|
|
101
|
+
|
|
102
|
+
- due to [`0714112`](https://github.com/tobymao/sqlglot/commit/0714112aa814778ff371cc33a9441548ae6b924c) - only propagate constants through non-nullable columns *(PR [#8326](https://github.com/tobymao/sqlglot/pull/8326) by [@geooo109](https://github.com/geooo109))*:
|
|
103
|
+
|
|
104
|
+
only propagate constants through non-nullable columns (#8326)
|
|
105
|
+
|
|
106
|
+
- due to [`a34fc27`](https://github.com/tobymao/sqlglot/commit/a34fc276539980ee1f3d51e85a17a19f40b3f276) - star referencing outer-scope from correlated subquery *(PR [#8291](https://github.com/tobymao/sqlglot/pull/8291) by [@treysp](https://github.com/treysp))*:
|
|
107
|
+
|
|
108
|
+
star referencing outer-scope from correlated subquery (#8291)
|
|
109
|
+
|
|
110
|
+
- due to [`9f604b3`](https://github.com/tobymao/sqlglot/commit/9f604b3de5967c0107404676690c82e3c3552593) - preserve GREATEST/LEAST NULL semantics *(PR [#8320](https://github.com/tobymao/sqlglot/pull/8320) by [@Kunal8954](https://github.com/Kunal8954))*:
|
|
111
|
+
|
|
112
|
+
preserve GREATEST/LEAST NULL semantics (#8320)
|
|
113
|
+
|
|
114
|
+
- due to [`83abff6`](https://github.com/tobymao/sqlglot/commit/83abff6576cbc3b5858581b8ae9a912dec0f3304) - render a DynamicIdentifier in Table.name [CLAUDE] *(PR [#8329](https://github.com/tobymao/sqlglot/pull/8329) by [@chaitanyaatlan](https://github.com/chaitanyaatlan))*:
|
|
115
|
+
|
|
116
|
+
render a DynamicIdentifier in Table.name [CLAUDE] (#8329)
|
|
117
|
+
|
|
118
|
+
- due to [`9ec72cf`](https://github.com/tobymao/sqlglot/commit/9ec72cf88314ef218face2c587957189ab10a21b) - parse MySQL index prefixes *(PR [#8335](https://github.com/tobymao/sqlglot/pull/8335) by [@burnison](https://github.com/burnison))*:
|
|
119
|
+
|
|
120
|
+
parse MySQL index prefixes (#8335)
|
|
121
|
+
|
|
122
|
+
- due to [`64d6f59`](https://github.com/tobymao/sqlglot/commit/64d6f59a4981d35f362fecc615a4e3ce764bebb7) - for simplify fold contradictory comparisons to FALSE only for non-null columns *(PR [#8338](https://github.com/tobymao/sqlglot/pull/8338) by [@geooo109](https://github.com/geooo109))*:
|
|
123
|
+
|
|
124
|
+
for simplify fold contradictory comparisons to FALSE only for non-null columns (#8338)
|
|
125
|
+
|
|
126
|
+
- due to [`56a66cd`](https://github.com/tobymao/sqlglot/commit/56a66cddf65e83080ae6534824136575bf192274) - avoid to rewrite RIGHT JOIN ... ON TRUE to CROSS JOIN in simplify *(PR [#8340](https://github.com/tobymao/sqlglot/pull/8340) by [@geooo109](https://github.com/geooo109))*:
|
|
127
|
+
|
|
128
|
+
avoid to rewrite RIGHT JOIN ... ON TRUE to CROSS JOIN in simplify (#8340)
|
|
129
|
+
|
|
130
|
+
- due to [`a8719ad`](https://github.com/tobymao/sqlglot/commit/a8719ad6425579b8becd9434b93c9a9f0d28b05e) - preserve columns when source is a whole-row reference *(PR [#8332](https://github.com/tobymao/sqlglot/pull/8332) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
131
|
+
|
|
132
|
+
preserve columns when source is a whole-row reference (#8332)
|
|
133
|
+
|
|
134
|
+
- due to [`5cfb599`](https://github.com/tobymao/sqlglot/commit/5cfb5997a99010940138670adf3d6b34ac5a0a08) - preserve precedence when replacing aliases in predicate pushdown [GLM] *(PR [#8342](https://github.com/tobymao/sqlglot/pull/8342) by [@tobymao](https://github.com/tobymao))*:
|
|
135
|
+
|
|
136
|
+
preserve precedence when replacing aliases in predicate pushdown [GLM] (#8342)
|
|
137
|
+
|
|
138
|
+
- due to [`3ca8248`](https://github.com/tobymao/sqlglot/commit/3ca824895ef423f7895fb13d72357548c0f1f367) - preserve coalesce concat semantics closes [#8343](https://github.com/tobymao/sqlglot/pull/8343) *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
139
|
+
|
|
140
|
+
preserve coalesce concat semantics closes #8343
|
|
141
|
+
|
|
142
|
+
- due to [`eee4750`](https://github.com/tobymao/sqlglot/commit/eee4750c47cf15c8a41432b21df26fdaa0a11ead) - preserve UNION ALL arm width when nested set op forces column retention *(PR [#8325](https://github.com/tobymao/sqlglot/pull/8325) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
143
|
+
|
|
144
|
+
preserve UNION ALL arm width when nested set op forces column retention (#8325)
|
|
145
|
+
|
|
146
|
+
- due to [`4b84b4d`](https://github.com/tobymao/sqlglot/commit/4b84b4d4f3e91e4f64721cb72e0590e4de72aa46) - keep scale and length for MONEY, SMALLMONEY, XML and IMAGE [CLAUDE] *(PR [#8362](https://github.com/tobymao/sqlglot/pull/8362) by [@NielsZeilemaker](https://github.com/NielsZeilemaker))*:
|
|
147
|
+
|
|
148
|
+
keep scale and length for MONEY, SMALLMONEY, XML and IMAGE [CLAUDE] (#8362)
|
|
149
|
+
|
|
150
|
+
- due to [`4eb2c99`](https://github.com/tobymao/sqlglot/commit/4eb2c99a150f56c9048a3ddf6c71dded86597362) - transpile json type to varchar(max), similar to xml *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
151
|
+
|
|
152
|
+
transpile json type to varchar(max), similar to xml
|
|
153
|
+
|
|
154
|
+
- due to [`d53cbc9`](https://github.com/tobymao/sqlglot/commit/d53cbc988512ee63ca547694c6a1656fd4dbb637) - raise on a duplicate OFFSET instead of overwriting it [CLAUDE] *(PR [#8367](https://github.com/tobymao/sqlglot/pull/8367) by [@jbylund](https://github.com/jbylund))*:
|
|
155
|
+
|
|
156
|
+
raise on a duplicate OFFSET instead of overwriting it [CLAUDE] (#8367)
|
|
157
|
+
|
|
158
|
+
- due to [`4e973f0`](https://github.com/tobymao/sqlglot/commit/4e973f0c0cd426ab2260db291d45a7a207b48356) - honor positional column aliases declared on derived tables and CTEs *(PR [#8382](https://github.com/tobymao/sqlglot/pull/8382) by [@georgesittas](https://github.com/georgesittas))*:
|
|
159
|
+
|
|
160
|
+
honor positional column aliases declared on derived tables and CTEs (#8382)
|
|
161
|
+
|
|
162
|
+
- due to [`539b112`](https://github.com/tobymao/sqlglot/commit/539b1125dbe698145057a58efaff2eb7ae2dfdbd) - get rid of `remove_unused_selections` flag in `pushdown_projections` *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
163
|
+
|
|
164
|
+
get rid of `remove_unused_selections` flag in `pushdown_projections`
|
|
165
|
+
|
|
166
|
+
- due to [`f5cb53d`](https://github.com/tobymao/sqlglot/commit/f5cb53d6d06e8dd7e7521b35d7294d7c9fa5d293) - qualify bare right-hand table column ref in SEMI/ANTI join ON *(PR [#8383](https://github.com/tobymao/sqlglot/pull/8383) by [@treysp](https://github.com/treysp))*:
|
|
167
|
+
|
|
168
|
+
qualify bare right-hand table column ref in SEMI/ANTI join ON (#8383)
|
|
169
|
+
|
|
170
|
+
- due to [`901a678`](https://github.com/tobymao/sqlglot/commit/901a67882871b9eb27ad9dfdd23380c0fca4cf1f) - preserve DuckDB DATE_TRUNC return type when simplifying. *(commit by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
171
|
+
|
|
172
|
+
preserve DuckDB DATE_TRUNC return type when simplifying.
|
|
173
|
+
|
|
174
|
+
- due to [`06c7b3d`](https://github.com/tobymao/sqlglot/commit/06c7b3dd7b656ff5ed80337ee668cf58318e002b) - preserve precedence when collapsing CASE and IF *(PR [#8389](https://github.com/tobymao/sqlglot/pull/8389) by [@georgesittas](https://github.com/georgesittas))*:
|
|
175
|
+
|
|
176
|
+
preserve precedence when collapsing CASE and IF (#8389)
|
|
177
|
+
|
|
178
|
+
- due to [`9beb769`](https://github.com/tobymao/sqlglot/commit/9beb769dbffdbabc73b4459137ce2be21678765f) - drop TIMESTAMP_LTZ precision [CODEX] *(PR [#8403](https://github.com/tobymao/sqlglot/pull/8403) by [@tekumara](https://github.com/tekumara))*:
|
|
179
|
+
|
|
180
|
+
drop TIMESTAMP_LTZ precision [CODEX] (#8403)
|
|
181
|
+
|
|
182
|
+
- due to [`eeece5a`](https://github.com/tobymao/sqlglot/commit/eeece5a564e2d5c37b73d172843e7cd437406c42) - preserve pagination scope in set operations *(PR [#8385](https://github.com/tobymao/sqlglot/pull/8385) by [@georgesittas](https://github.com/georgesittas))*:
|
|
183
|
+
|
|
184
|
+
preserve pagination scope in set operations (#8385)
|
|
185
|
+
|
|
186
|
+
- due to [`1a782c5`](https://github.com/tobymao/sqlglot/commit/1a782c55a8f2bad4ac9ca7e28b1a1b1164840894) - keep the native IF instead of changing it to CASE [CLAUDE] *(PR [#8409](https://github.com/tobymao/sqlglot/pull/8409) by [@UCHPUCHMAK](https://github.com/UCHPUCHMAK))*:
|
|
187
|
+
|
|
188
|
+
keep the native IF instead of changing it to CASE [CLAUDE] (#8409)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### :sparkles: New Features
|
|
192
|
+
- [`d7dd2cd`](https://github.com/tobymao/sqlglot/commit/d7dd2cd18fd214892136b4d0706cd65d348da285) - **optimizer**: annotate function replace for postgres *(PR [#8307](https://github.com/tobymao/sqlglot/pull/8307) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
193
|
+
- [`3f154bf`](https://github.com/tobymao/sqlglot/commit/3f154bfb65ad77b2e2b71375692aee9a69f2d8da) - **mysql**: add `ALTER ... COMMENT`. *(PR [#8310](https://github.com/tobymao/sqlglot/pull/8310) by [@burnison](https://github.com/burnison))*
|
|
194
|
+
- [`8bf484c`](https://github.com/tobymao/sqlglot/commit/8bf484ce23ad684430675d60fcd82c05a957e4db) - **generator**: Fix the json path with single quote issue *(PR [#8309](https://github.com/tobymao/sqlglot/pull/8309) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
195
|
+
- :arrow_lower_right: *addresses issue [#8251](https://github.com/tobymao/sqlglot/issues/8251) opened by [@RogerHYang](https://github.com/RogerHYang)*
|
|
196
|
+
- [`3d25907`](https://github.com/tobymao/sqlglot/commit/3d259070d4c892992e9b1b247166d6056e742599) - **executor**: implement FIRST [CLAUDE] *(PR [#8319](https://github.com/tobymao/sqlglot/pull/8319) by [@jbylund](https://github.com/jbylund))*
|
|
197
|
+
- [`90d44b8`](https://github.com/tobymao/sqlglot/commit/90d44b8556a19ddf8d4d43395a39f589a42ab748) - **trino**: preserve Spark CONCAT_WS array semantics *(PR [#8391](https://github.com/tobymao/sqlglot/pull/8391) by [@georgesittas](https://github.com/georgesittas))*
|
|
198
|
+
- :arrow_lower_right: *addresses issue [#8386](https://github.com/tobymao/sqlglot/issues/8386) opened by [@xiaoyu-meng-mxy](https://github.com/xiaoyu-meng-mxy)*
|
|
199
|
+
- [`0256222`](https://github.com/tobymao/sqlglot/commit/02562228357e7d933ef66e27c56e257b88faad8f) - **parser**: supprot AGG *(PR [#8414](https://github.com/tobymao/sqlglot/pull/8414) by [@geooo109](https://github.com/geooo109))*
|
|
200
|
+
|
|
201
|
+
### :bug: Bug Fixes
|
|
202
|
+
- [`9794193`](https://github.com/tobymao/sqlglot/commit/97941935711779438b34e11edbed6a736d2ad0c6) - **parser**: preserve the order of CUBE, ROLLUP and GROUPING SETS in GROUP BY *(PR [#8312](https://github.com/tobymao/sqlglot/pull/8312) by [@georgesittas](https://github.com/georgesittas))*
|
|
203
|
+
- :arrow_lower_right: *fixes issue [#8311](https://github.com/tobymao/sqlglot/issues/8311) opened by [@wwzhe007](https://github.com/wwzhe007)*
|
|
204
|
+
- [`3086608`](https://github.com/tobymao/sqlglot/commit/3086608e6fd4c41c02dfba47171608d2b193fce2) - **trino**: prefix JSON_QUERY paths with the lax mode specifier *(PR [#8313](https://github.com/tobymao/sqlglot/pull/8313) by [@Kunal8954](https://github.com/Kunal8954))*
|
|
205
|
+
- [`18fc199`](https://github.com/tobymao/sqlglot/commit/18fc199a01f22ef2a62e68560fcb9c589a3e39df) - **optimizer**: keep projections referenced by SORT BY / DISTRIBUTE BY / CLUSTER BY *(PR [#8302](https://github.com/tobymao/sqlglot/pull/8302) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
206
|
+
- [`1d753d7`](https://github.com/tobymao/sqlglot/commit/1d753d72c6e81e39cfc7160af33673314d4d600e) - **optimizer**: EXISTS over a scalar aggregate is always true [CLAUDE] *(PR [#8304](https://github.com/tobymao/sqlglot/pull/8304) by [@jbylund](https://github.com/jbylund))*
|
|
207
|
+
- [`c9ad903`](https://github.com/tobymao/sqlglot/commit/c9ad903e7553543686472e5babf3c18e4e7dbc7b) - **optimizer**: preserve operand order when simplifying COALESCE comparisons *(PR [#8316](https://github.com/tobymao/sqlglot/pull/8316) by [@geooo109](https://github.com/geooo109))*
|
|
208
|
+
- [`106ad25`](https://github.com/tobymao/sqlglot/commit/106ad25d3500f479144a24f3130c8a45a1d547b0) - **optimizer**: decorrelation when non-EQ keys are present *(PR [#8317](https://github.com/tobymao/sqlglot/pull/8317) by [@georgesittas](https://github.com/georgesittas))*
|
|
209
|
+
- [`0d88a21`](https://github.com/tobymao/sqlglot/commit/0d88a211de50fa118e7e7185665d2f31310fceaa) - **optimizer**: don't fan out EXISTS decorrelation over grouped subqueries *(PR [#8318](https://github.com/tobymao/sqlglot/pull/8318) by [@georgesittas](https://github.com/georgesittas))*
|
|
210
|
+
- [`f22bcdb`](https://github.com/tobymao/sqlglot/commit/f22bcdbad732d9df2c02d37426cbdc27e64b5da6) - **optimizer**: preserve unreferenced UDTF and anonymous-function projections *(PR [#8314](https://github.com/tobymao/sqlglot/pull/8314) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
211
|
+
- [`0714112`](https://github.com/tobymao/sqlglot/commit/0714112aa814778ff371cc33a9441548ae6b924c) - **optimizer**: only propagate constants through non-nullable columns *(PR [#8326](https://github.com/tobymao/sqlglot/pull/8326) by [@geooo109](https://github.com/geooo109))*
|
|
212
|
+
- [`a34fc27`](https://github.com/tobymao/sqlglot/commit/a34fc276539980ee1f3d51e85a17a19f40b3f276) - **optimizer**: star referencing outer-scope from correlated subquery *(PR [#8291](https://github.com/tobymao/sqlglot/pull/8291) by [@treysp](https://github.com/treysp))*
|
|
213
|
+
- [`faa5ebf`](https://github.com/tobymao/sqlglot/commit/faa5ebf5e7195ea62996d30a1089bf3533731eb2) - **optimizer**: in simplify only move MONTH/YEAR intervals across a comparison when the move is exact *(PR [#8324](https://github.com/tobymao/sqlglot/pull/8324) by [@geooo109](https://github.com/geooo109))*
|
|
214
|
+
- [`9f604b3`](https://github.com/tobymao/sqlglot/commit/9f604b3de5967c0107404676690c82e3c3552593) - **sqlite**: preserve GREATEST/LEAST NULL semantics *(PR [#8320](https://github.com/tobymao/sqlglot/pull/8320) by [@Kunal8954](https://github.com/Kunal8954))*
|
|
215
|
+
- :arrow_lower_right: *fixes issue [#8315](https://github.com/tobymao/sqlglot/issues/8315) opened by [@abinashrasonowal](https://github.com/abinashrasonowal)*
|
|
216
|
+
- [`83abff6`](https://github.com/tobymao/sqlglot/commit/83abff6576cbc3b5858581b8ae9a912dec0f3304) - **expressions**: render a DynamicIdentifier in Table.name [CLAUDE] *(PR [#8329](https://github.com/tobymao/sqlglot/pull/8329) by [@chaitanyaatlan](https://github.com/chaitanyaatlan))*
|
|
217
|
+
- :arrow_lower_right: *fixes issue [#8328](https://github.com/tobymao/sqlglot/issues/8328) opened by [@chaitanyaatlan](https://github.com/chaitanyaatlan)*
|
|
218
|
+
- [`8b374bd`](https://github.com/tobymao/sqlglot/commit/8b374bd525eeade40cef0b02d281e7a9636b974a) - **mysql**: support`UNIQUE` with options *(PR [#8330](https://github.com/tobymao/sqlglot/pull/8330) by [@burnison](https://github.com/burnison))*
|
|
219
|
+
- [`cf8a4db`](https://github.com/tobymao/sqlglot/commit/cf8a4db927c6ce462e2962ddc9546ab4152b8626) - **snowflake**: support ROLLBACK as id var and udf name *(PR [#8334](https://github.com/tobymao/sqlglot/pull/8334) by [@treysp](https://github.com/treysp))*
|
|
220
|
+
- [`9ec72cf`](https://github.com/tobymao/sqlglot/commit/9ec72cf88314ef218face2c587957189ab10a21b) - **mysql**: parse MySQL index prefixes *(PR [#8335](https://github.com/tobymao/sqlglot/pull/8335) by [@burnison](https://github.com/burnison))*
|
|
221
|
+
- [`4559569`](https://github.com/tobymao/sqlglot/commit/45595690cfbacaad486683e019e35c4b6c653786) - **mysql**: drop implicit NULLS FIRST from UNIQUE/INDEX key parts *(commit by [@geooo109](https://github.com/geooo109))*
|
|
222
|
+
- [`70951c7`](https://github.com/tobymao/sqlglot/commit/70951c72dff3fb694040353e8db330756a242a7a) - implement `is_star` iteratively *(PR [#8337](https://github.com/tobymao/sqlglot/pull/8337) by [@georgesittas](https://github.com/georgesittas))*
|
|
223
|
+
- [`64d6f59`](https://github.com/tobymao/sqlglot/commit/64d6f59a4981d35f362fecc615a4e3ce764bebb7) - **optimizer**: for simplify fold contradictory comparisons to FALSE only for non-null columns *(PR [#8338](https://github.com/tobymao/sqlglot/pull/8338) by [@geooo109](https://github.com/geooo109))*
|
|
224
|
+
- [`56a66cd`](https://github.com/tobymao/sqlglot/commit/56a66cddf65e83080ae6534824136575bf192274) - **optimizer**: avoid to rewrite RIGHT JOIN ... ON TRUE to CROSS JOIN in simplify *(PR [#8340](https://github.com/tobymao/sqlglot/pull/8340) by [@geooo109](https://github.com/geooo109))*
|
|
225
|
+
- [`a8719ad`](https://github.com/tobymao/sqlglot/commit/a8719ad6425579b8becd9434b93c9a9f0d28b05e) - **optimizer**: preserve columns when source is a whole-row reference *(PR [#8332](https://github.com/tobymao/sqlglot/pull/8332) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
226
|
+
- [`5cfb599`](https://github.com/tobymao/sqlglot/commit/5cfb5997a99010940138670adf3d6b34ac5a0a08) - **optimizer**: preserve precedence when replacing aliases in predicate pushdown [GLM] *(PR [#8342](https://github.com/tobymao/sqlglot/pull/8342) by [@tobymao](https://github.com/tobymao))*
|
|
227
|
+
- :arrow_lower_right: *fixes issue [#8341](https://github.com/tobymao/sqlglot/issues/8341) opened by [@xiaoyu-meng-mxy](https://github.com/xiaoyu-meng-mxy)*
|
|
228
|
+
- [`5dea557`](https://github.com/tobymao/sqlglot/commit/5dea557136b0690c280c5c006257f4d681d7f3ce) - **doris**: add 15 missing words to RESERVED_KEYWORDS *(PR [#8357](https://github.com/tobymao/sqlglot/pull/8357) by [@raghav-reglobe](https://github.com/raghav-reglobe))*
|
|
229
|
+
- [`9831daa`](https://github.com/tobymao/sqlglot/commit/9831daa7b785c941ff7c7f90e7640349cec15151) - **sqlite**: correct nanosecond date difference multiplier [COPILOT] *(PR [#8346](https://github.com/tobymao/sqlglot/pull/8346) by [@PhuocOng](https://github.com/PhuocOng))*
|
|
230
|
+
- :arrow_lower_right: *fixes issue [#8345](https://github.com/tobymao/sqlglot/issues/8345) opened by [@PhuocOng](https://github.com/PhuocOng)*
|
|
231
|
+
- [`87d16d0`](https://github.com/tobymao/sqlglot/commit/87d16d022d76e642705681cb6140a544dbde24df) - **singlestore**: ignore nulls in percentile ordering [CODEX] *(PR [#8352](https://github.com/tobymao/sqlglot/pull/8352) by [@joeharris76](https://github.com/joeharris76))*
|
|
232
|
+
- [`e27b765`](https://github.com/tobymao/sqlglot/commit/e27b7654a9d710e29da6f42994de845a99444c84) - **executor**: plan DISTINCT before ORDER BY so the sort survives [CLAUDE] *(PR [#8321](https://github.com/tobymao/sqlglot/pull/8321) by [@jbylund](https://github.com/jbylund))*
|
|
233
|
+
- [`3ca8248`](https://github.com/tobymao/sqlglot/commit/3ca824895ef423f7895fb13d72357548c0f1f367) - **sqlite**: preserve coalesce concat semantics closes [#8343](https://github.com/tobymao/sqlglot/pull/8343) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
234
|
+
- [`eee4750`](https://github.com/tobymao/sqlglot/commit/eee4750c47cf15c8a41432b21df26fdaa0a11ead) - **optimizer**: preserve UNION ALL arm width when nested set op forces column retention *(PR [#8325](https://github.com/tobymao/sqlglot/pull/8325) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
235
|
+
- [`4b84b4d`](https://github.com/tobymao/sqlglot/commit/4b84b4d4f3e91e4f64721cb72e0590e4de72aa46) - **fabric**: keep scale and length for MONEY, SMALLMONEY, XML and IMAGE [CLAUDE] *(PR [#8362](https://github.com/tobymao/sqlglot/pull/8362) by [@NielsZeilemaker](https://github.com/NielsZeilemaker))*
|
|
236
|
+
- [`4eb2c99`](https://github.com/tobymao/sqlglot/commit/4eb2c99a150f56c9048a3ddf6c71dded86597362) - **fabric**: transpile json type to varchar(max), similar to xml *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
237
|
+
- [`a069a09`](https://github.com/tobymao/sqlglot/commit/a069a0964418188e3822e8bf9238af6b89db0652) - **tsql**: parse FORMAT(x, 'ffffff') as a time format *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
238
|
+
- [`338bb06`](https://github.com/tobymao/sqlglot/commit/338bb0699385f8a35f76c98954c58b920da679b5) - **sqlite**: evaluate dynamic date-add amounts [COPILOT] *(PR [#8360](https://github.com/tobymao/sqlglot/pull/8360) by [@PhuocOng](https://github.com/PhuocOng))*
|
|
239
|
+
- :arrow_lower_right: *fixes issue [#8359](https://github.com/tobymao/sqlglot/issues/8359) opened by [@PhuocOng](https://github.com/PhuocOng)*
|
|
240
|
+
- [`e946396`](https://github.com/tobymao/sqlglot/commit/e94639635d388cf6b58dd79d643a62082d2305cb) - **optimizer**: preserve COALESCE fallbacks after NULL [CODEX] *(PR [#8364](https://github.com/tobymao/sqlglot/pull/8364) by [@Kuang-xianxin](https://github.com/Kuang-xianxin))*
|
|
241
|
+
- [`d53cbc9`](https://github.com/tobymao/sqlglot/commit/d53cbc988512ee63ca547694c6a1656fd4dbb637) - **parser**: raise on a duplicate OFFSET instead of overwriting it [CLAUDE] *(PR [#8367](https://github.com/tobymao/sqlglot/pull/8367) by [@jbylund](https://github.com/jbylund))*
|
|
242
|
+
- [`fa73693`](https://github.com/tobymao/sqlglot/commit/fa73693547ad5a88ccbbe90fad1196b3153198ed) - **parser**: support OPERATOR as implicit alias *(PR [#8365](https://github.com/tobymao/sqlglot/pull/8365) by [@treysp](https://github.com/treysp))*
|
|
243
|
+
- [`65eb23b`](https://github.com/tobymao/sqlglot/commit/65eb23b53420212c20f394d399ca18efefec90e3) - **spark**: emit SQL function determinism correctly [CODEX] *(PR [#8369](https://github.com/tobymao/sqlglot/pull/8369) by [@jaideeppyne](https://github.com/jaideeppyne))*
|
|
244
|
+
- :arrow_lower_right: *fixes issue [#8368](https://github.com/tobymao/sqlglot/issues/8368) opened by [@EhabEasee](https://github.com/EhabEasee)*
|
|
245
|
+
- [`76004d7`](https://github.com/tobymao/sqlglot/commit/76004d7f33b2365e5e0d66917c18422070fda129) - **sqlite**: emit GROUP_CONCAT ORDER BY instead of dropping it [CODEX] *(PR [#8373](https://github.com/tobymao/sqlglot/pull/8373) by [@jaideeppyne](https://github.com/jaideeppyne))*
|
|
246
|
+
- [`4e973f0`](https://github.com/tobymao/sqlglot/commit/4e973f0c0cd426ab2260db291d45a7a207b48356) - **optimizer**: honor positional column aliases declared on derived tables and CTEs *(PR [#8382](https://github.com/tobymao/sqlglot/pull/8382) by [@georgesittas](https://github.com/georgesittas))*
|
|
247
|
+
- [`f5cb53d`](https://github.com/tobymao/sqlglot/commit/f5cb53d6d06e8dd7e7521b35d7294d7c9fa5d293) - **optimizer**: qualify bare right-hand table column ref in SEMI/ANTI join ON *(PR [#8383](https://github.com/tobymao/sqlglot/pull/8383) by [@treysp](https://github.com/treysp))*
|
|
248
|
+
- [`901a678`](https://github.com/tobymao/sqlglot/commit/901a67882871b9eb27ad9dfdd23380c0fca4cf1f) - **optimizer**: preserve DuckDB DATE_TRUNC return type when simplifying. *(commit by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
249
|
+
- [`a470787`](https://github.com/tobymao/sqlglot/commit/a470787be21812ba235963c41f23107e3502c00b) - **optimizer**: prevent merge_subqueries from folding set-returning projections *(PR [#8379](https://github.com/tobymao/sqlglot/pull/8379) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
250
|
+
- [`06c7b3d`](https://github.com/tobymao/sqlglot/commit/06c7b3dd7b656ff5ed80337ee668cf58318e002b) - **optimizer**: preserve precedence when collapsing CASE and IF *(PR [#8389](https://github.com/tobymao/sqlglot/pull/8389) by [@georgesittas](https://github.com/georgesittas))*
|
|
251
|
+
- :arrow_lower_right: *fixes issue [#8380](https://github.com/tobymao/sqlglot/issues/8380) opened by [@Rodrigo-Palma](https://github.com/Rodrigo-Palma)*
|
|
252
|
+
- [`9bc418a`](https://github.com/tobymao/sqlglot/commit/9bc418af0e03220a6eb5289a009bd79328e7cfd1) - **snowflake**: parse unquoted PUT sources as exp.Put [CODEX] *(PR [#8400](https://github.com/tobymao/sqlglot/pull/8400) by [@tekumara](https://github.com/tekumara))*
|
|
253
|
+
- :arrow_lower_right: *fixes issue [#8399](https://github.com/tobymao/sqlglot/issues/8399) opened by [@tekumara](https://github.com/tekumara)*
|
|
254
|
+
- [`9beb769`](https://github.com/tobymao/sqlglot/commit/9beb769dbffdbabc73b4459137ce2be21678765f) - **duckdb**: drop TIMESTAMP_LTZ precision [CODEX] *(PR [#8403](https://github.com/tobymao/sqlglot/pull/8403) by [@tekumara](https://github.com/tekumara))*
|
|
255
|
+
- :arrow_lower_right: *fixes issue [#8402](https://github.com/tobymao/sqlglot/issues/8402) opened by [@tekumara](https://github.com/tekumara)*
|
|
256
|
+
- [`8b6ff93`](https://github.com/tobymao/sqlglot/commit/8b6ff9386ddf4f6f8e3120a21f1991a384e60abd) - **executor**: support DISTINCT calculations CLAUDE *(PR [#8395](https://github.com/tobymao/sqlglot/pull/8395) by [@rubytobi](https://github.com/rubytobi))*
|
|
257
|
+
- [`eeece5a`](https://github.com/tobymao/sqlglot/commit/eeece5a564e2d5c37b73d172843e7cd437406c42) - preserve pagination scope in set operations *(PR [#8385](https://github.com/tobymao/sqlglot/pull/8385) by [@georgesittas](https://github.com/georgesittas))*
|
|
258
|
+
- [`8c3b989`](https://github.com/tobymao/sqlglot/commit/8c3b9893f72f0913fa0a8a4188d55c8cc6692ad5) - **mysql**: SHOW CREATE TABLE generating a syntax error [CLAUDE] *(PR [#8408](https://github.com/tobymao/sqlglot/pull/8408) by [@UCHPUCHMAK](https://github.com/UCHPUCHMAK))*
|
|
259
|
+
- [`1a782c5`](https://github.com/tobymao/sqlglot/commit/1a782c55a8f2bad4ac9ca7e28b1a1b1164840894) - **mysql**: keep the native IF instead of changing it to CASE [CLAUDE] *(PR [#8409](https://github.com/tobymao/sqlglot/pull/8409) by [@UCHPUCHMAK](https://github.com/UCHPUCHMAK))*
|
|
260
|
+
|
|
261
|
+
### :recycle: Refactors
|
|
262
|
+
- [`bbb717e`](https://github.com/tobymao/sqlglot/commit/bbb717ebb24c8dcbee94d77c9154e74da1dc6c10) - rename union scope type to set operation for consistency *(PR [#8306](https://github.com/tobymao/sqlglot/pull/8306) by [@georgesittas](https://github.com/georgesittas))*
|
|
263
|
+
- [`5fac41e`](https://github.com/tobymao/sqlglot/commit/5fac41edc6d81e9bad5a5d6a64888de4f80ff598) - **optimizer**: skip projection pushdown early *(PR [#8336](https://github.com/tobymao/sqlglot/pull/8336) by [@georgesittas](https://github.com/georgesittas))*
|
|
264
|
+
|
|
265
|
+
### :white_check_mark: Tests
|
|
266
|
+
- [`1928165`](https://github.com/tobymao/sqlglot/commit/1928165c7d9085b783f8f0c4eec2d6b12fd49a2c) - recognize Windows compiled extensions [COPILOT] *(PR [#8354](https://github.com/tobymao/sqlglot/pull/8354) by [@PhuocOng](https://github.com/PhuocOng))*
|
|
267
|
+
- :arrow_lower_right: *addresses issue [#8353](https://github.com/tobymao/sqlglot/issues/8353) opened by [@PhuocOng](https://github.com/PhuocOng)*
|
|
268
|
+
|
|
269
|
+
### :wrench: Chores
|
|
270
|
+
- [`9d322b9`](https://github.com/tobymao/sqlglot/commit/9d322b95cffbf09964f4b1b4dcfe0b17813d6b84) - handle `.pyd` suffix (windows builds) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
271
|
+
- [`b6aebcd`](https://github.com/tobymao/sqlglot/commit/b6aebcde1f6722142dbd812715cc5db6e5dc54f4) - refactor NOT DETERMINISTIC on base *(PR [#8376](https://github.com/tobymao/sqlglot/pull/8376) by [@geooo109](https://github.com/geooo109))*
|
|
272
|
+
- [`19077cc`](https://github.com/tobymao/sqlglot/commit/19077cc891003183ab2cffe2bd999c83fa7d9168) - sqlite GROUP_CONCAT refactor *(PR [#8377](https://github.com/tobymao/sqlglot/pull/8377) by [@geooo109](https://github.com/geooo109))*
|
|
273
|
+
- [`539b112`](https://github.com/tobymao/sqlglot/commit/539b1125dbe698145057a58efaff2eb7ae2dfdbd) - **optimizer**: get rid of `remove_unused_selections` flag in `pushdown_projections` *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
274
|
+
|
|
275
|
+
|
|
4
276
|
## [v30.18.0] - 2026-09-03
|
|
5
277
|
### :boom: BREAKING CHANGES
|
|
6
278
|
- due to [`8f60665`](https://github.com/tobymao/sqlglot/commit/8f606659077c0380cfbfe2ae53bd43583f41c4cf) - annotate decode for postgres *(PR [#8157](https://github.com/tobymao/sqlglot/pull/8157) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
@@ -15716,3 +15988,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
15716
15988
|
[v30.16.0]: https://github.com/tobymao/sqlglot/compare/v30.15.0...v30.16.0
|
|
15717
15989
|
[v30.17.0]: https://github.com/tobymao/sqlglot/compare/v30.16.0...v30.17.0
|
|
15718
15990
|
[v30.18.0]: https://github.com/tobymao/sqlglot/compare/v30.17.0...v30.18.0
|
|
15991
|
+
[v30.19.0]: https://github.com/tobymao/sqlglot/compare/v30.18.0...v30.19.0
|
|
15992
|
+
[v30.20.0]: https://github.com/tobymao/sqlglot/compare/v30.19.0...v30.20.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.21.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
34
34
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
35
35
|
Requires-Dist: pyperf; extra == "dev"
|
|
36
36
|
Provides-Extra: c
|
|
37
|
-
Requires-Dist: sqlglotc==30.
|
|
37
|
+
Requires-Dist: sqlglotc==30.21.0; python_version >= "3.10" and extra == "c"
|
|
38
38
|
Provides-Extra: rs
|
|
39
39
|
Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
|
|
40
|
-
Requires-Dist: sqlglotc==30.
|
|
40
|
+
Requires-Dist: sqlglotc==30.21.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '30.
|
|
22
|
-
__version_tuple__ = version_tuple = (30,
|
|
21
|
+
__version__ = version = '30.21.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 21, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g5d16fa83b'
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
from sqlglot import tokens
|
|
5
|
-
from sqlglot.dialects.dialect import
|
|
5
|
+
from sqlglot.dialects.dialect import DialectType
|
|
6
6
|
from sqlglot.generators.athena import AthenaGenerator
|
|
7
7
|
from sqlglot.parsers.athena import AthenaParser
|
|
8
8
|
from sqlglot.tokens import TokenType, Token
|
|
@@ -10,7 +10,7 @@ from sqlglot.dialects.trino import Trino
|
|
|
10
10
|
from sqlglot.dialects.hive import Hive
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class Athena(
|
|
13
|
+
class Athena(Trino):
|
|
14
14
|
"""
|
|
15
15
|
Over the years, it looks like AWS has taken various execution engines, bolted on AWS-specific
|
|
16
16
|
modifications and then built the Athena service around them.
|
|
@@ -346,6 +346,24 @@ class _Dialect(type):
|
|
|
346
346
|
if not v.isprintable() or v == "\\"
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
+
# Prefer hex, then octal, then Unicode for numeric control-character escapes.
|
|
350
|
+
numeric_escapes = klass.tokenizer_class.NUMERIC_ESCAPES
|
|
351
|
+
if "x" in numeric_escapes:
|
|
352
|
+
fmt = "\\x{:02x}"
|
|
353
|
+
elif "0" in numeric_escapes:
|
|
354
|
+
fmt = "\\{:03o}"
|
|
355
|
+
elif "u" in numeric_escapes:
|
|
356
|
+
fmt = "\\u{:04x}"
|
|
357
|
+
else:
|
|
358
|
+
fmt = ""
|
|
359
|
+
|
|
360
|
+
if fmt:
|
|
361
|
+
# ASCII controls are 0-31 and DEL (127). Preserve existing escape mappings and
|
|
362
|
+
# leave tab (9), newline (10), and carriage return (13) to their existing handling.
|
|
363
|
+
for code in (*range(32), 127):
|
|
364
|
+
if code not in (9, 10, 13):
|
|
365
|
+
klass.ESCAPED_SEQUENCES.setdefault(chr(code), fmt.format(code))
|
|
366
|
+
|
|
349
367
|
klass.SUPPORTS_COLUMN_JOIN_MARKS = "(+)" in klass.tokenizer_class.KEYWORDS
|
|
350
368
|
|
|
351
369
|
if enum not in ("", "bigquery", "snowflake"):
|
|
@@ -136,6 +136,8 @@ class Snowflake(Dialect):
|
|
|
136
136
|
|
|
137
137
|
class Tokenizer(tokens.Tokenizer):
|
|
138
138
|
STRING_ESCAPES = ["\\", "'"]
|
|
139
|
+
NUMERIC_ESCAPES = {"x": (16, 2, 2, 0xFF), "u": (16, 4, 4, 0xFFFF), "0": (8, 1, 3, 0xFF)}
|
|
140
|
+
DROP_UNKNOWN_ESCAPES = True
|
|
139
141
|
HEX_STRINGS = [("x'", "'"), ("X'", "'")]
|
|
140
142
|
RAW_STRINGS = ["$$"]
|
|
141
143
|
COMMENTS = ["--", "//", ("/*", "*/")]
|
|
@@ -248,4 +248,4 @@ class ParseJSON(Expression, Func):
|
|
|
248
248
|
# BigQuery, Snowflake have PARSE_JSON, Presto has JSON_PARSE
|
|
249
249
|
# Snowflake also has TRY_PARSE_JSON, which is represented using `safe`
|
|
250
250
|
_sql_names = ["PARSE_JSON", "JSON_PARSE"]
|
|
251
|
-
arg_types = {"this": True, "expression": False, "safe": False}
|
|
251
|
+
arg_types = {"this": True, "expression": False, "safe": False, "is_literal": False}
|
|
@@ -804,6 +804,19 @@ class Lateral(Expression, UDTF):
|
|
|
804
804
|
"ordinality": False,
|
|
805
805
|
}
|
|
806
806
|
|
|
807
|
+
@property
|
|
808
|
+
def selects(self) -> list[Expr]:
|
|
809
|
+
from sqlglot.expressions.array import Unnest
|
|
810
|
+
|
|
811
|
+
columns = super().selects
|
|
812
|
+
|
|
813
|
+
# UNNEST ... WITH ORDINALITY stores the ordinality column's name in Unnest.offset
|
|
814
|
+
offset = self.this.args.get("offset") if isinstance(self.this, Unnest) else None
|
|
815
|
+
if isinstance(offset, Identifier):
|
|
816
|
+
columns = columns + [offset]
|
|
817
|
+
|
|
818
|
+
return columns
|
|
819
|
+
|
|
807
820
|
|
|
808
821
|
class TableFromRows(Expression, UDTF):
|
|
809
822
|
arg_types = {
|
|
@@ -2959,7 +2959,20 @@ class Generator:
|
|
|
2959
2959
|
op_sql = self.seg(f"LATERAL VIEW{' OUTER' if expression.args.get('outer') else ''}")
|
|
2960
2960
|
return f"{op_sql}{self.sep()}{this}{table}{columns}"
|
|
2961
2961
|
|
|
2962
|
-
|
|
2962
|
+
table_alias = expression.args.get("alias")
|
|
2963
|
+
offset = expression.this.args.get("offset")
|
|
2964
|
+
|
|
2965
|
+
if (
|
|
2966
|
+
self.UNNEST_WITH_ORDINALITY
|
|
2967
|
+
and table_alias
|
|
2968
|
+
and isinstance(expression.this, exp.Unnest)
|
|
2969
|
+
and isinstance(offset, exp.Identifier)
|
|
2970
|
+
):
|
|
2971
|
+
# UNNEST ... WITH ORDINALITY stores the ordinality column's name in Unnest.offset
|
|
2972
|
+
table_alias = table_alias.copy()
|
|
2973
|
+
table_alias.append("columns", offset.copy())
|
|
2974
|
+
|
|
2975
|
+
alias = self.sql(table_alias)
|
|
2963
2976
|
alias = f" AS {alias}" if alias else ""
|
|
2964
2977
|
|
|
2965
2978
|
ordinality = expression.args.get("ordinality") or ""
|
|
@@ -4942,15 +4955,20 @@ class Generator:
|
|
|
4942
4955
|
def tonumber_sql(self, expression: exp.ToNumber) -> str:
|
|
4943
4956
|
if not self.SUPPORTS_TO_NUMBER:
|
|
4944
4957
|
self.unsupported("Unsupported TO_NUMBER function")
|
|
4945
|
-
return self.
|
|
4958
|
+
return self._tonumber_cast_sql(expression)
|
|
4946
4959
|
|
|
4947
4960
|
fmt = expression.args.get("format")
|
|
4948
4961
|
if not fmt:
|
|
4949
4962
|
self.unsupported("Conversion format is required for TO_NUMBER")
|
|
4950
|
-
return self.
|
|
4963
|
+
return self._tonumber_cast_sql(expression)
|
|
4951
4964
|
|
|
4952
4965
|
return self.func("TO_NUMBER", expression.this, fmt)
|
|
4953
4966
|
|
|
4967
|
+
def _tonumber_cast_sql(self, expression: exp.ToNumber) -> str:
|
|
4968
|
+
if expression.args.get("safe"):
|
|
4969
|
+
return self.sql(exp.TryCast(this=expression.this, to=exp.DataType.build("DOUBLE")))
|
|
4970
|
+
return self.sql(exp.cast(expression.this, exp.DType.DOUBLE))
|
|
4971
|
+
|
|
4954
4972
|
def dictproperty_sql(self, expression: exp.DictProperty) -> str:
|
|
4955
4973
|
this = self.sql(expression, "this")
|
|
4956
4974
|
kind = self.sql(expression, "kind")
|
|
@@ -5304,6 +5322,28 @@ class Generator:
|
|
|
5304
5322
|
sqlglot.dialects.dialect.unit_to_str(expression),
|
|
5305
5323
|
)
|
|
5306
5324
|
|
|
5325
|
+
def arrayinsert_sql(self, expression: exp.ArrayInsert, index_offset: int = 0) -> str:
|
|
5326
|
+
this = expression.this
|
|
5327
|
+
position = expression.args["position"]
|
|
5328
|
+
offset = index_offset - (expression.args.get("offset") or 0)
|
|
5329
|
+
|
|
5330
|
+
if offset:
|
|
5331
|
+
if position.is_int:
|
|
5332
|
+
value = position.to_py()
|
|
5333
|
+
if value >= 0:
|
|
5334
|
+
position = exp.Literal.number(value + offset)
|
|
5335
|
+
elif offset < 0 and value == -1:
|
|
5336
|
+
# 1-based -1 appends, which a 0-based position can only express as the size
|
|
5337
|
+
position = exp.ArraySize(this=this.copy())
|
|
5338
|
+
else:
|
|
5339
|
+
# Negative positions count from the end, so they shift in the opposite
|
|
5340
|
+
# direction, e.g. 0-based -1 (before the last element) is 1-based -2
|
|
5341
|
+
position = exp.Literal.number(value - offset)
|
|
5342
|
+
else:
|
|
5343
|
+
self.unsupported("ARRAY_INSERT position can only be converted if it's a literal")
|
|
5344
|
+
|
|
5345
|
+
return self.func("ARRAY_INSERT", this, position, expression.expression)
|
|
5346
|
+
|
|
5307
5347
|
def arrayany_sql(self, expression: exp.ArrayAny) -> str:
|
|
5308
5348
|
if self.CAN_IMPLEMENT_ARRAY_ANY:
|
|
5309
5349
|
filtered = exp.ArrayFilter(this=expression.this, expression=expression.expression)
|
|
@@ -713,6 +713,11 @@ class BigQueryGenerator(generator.Generator):
|
|
|
713
713
|
|
|
714
714
|
return self.func("CONTAINS_SUBSTR", this, expr, expression.args.get("json_scope"))
|
|
715
715
|
|
|
716
|
+
def parsejson_sql(self, expression: exp.ParseJSON) -> str:
|
|
717
|
+
if expression.args.get("is_literal"):
|
|
718
|
+
return f"JSON {self.sql(expression, 'this')}"
|
|
719
|
+
return super().parsejson_sql(expression)
|
|
720
|
+
|
|
716
721
|
def cast_sql(self, expression: exp.Cast, safe_prefix: str | None = None) -> str:
|
|
717
722
|
this = expression.this
|
|
718
723
|
|
|
@@ -370,6 +370,7 @@ class ClickHouseGenerator(generator.Generator):
|
|
|
370
370
|
exp.UnixToTime: _unix_to_time_sql,
|
|
371
371
|
exp.Trim: lambda self, e: trim_sql(self, e, default_trim_type="BOTH"),
|
|
372
372
|
exp.Variance: rename_func("varSamp"),
|
|
373
|
+
exp.VariancePop: rename_func("varPop"),
|
|
373
374
|
exp.SchemaCommentProperty: lambda self, e: self.naked_property(e),
|
|
374
375
|
exp.Stddev: rename_func("stddevSamp"),
|
|
375
376
|
exp.Chr: rename_func("CHAR"),
|
|
@@ -2577,11 +2577,10 @@ class DuckDBGenerator(generator.Generator):
|
|
|
2577
2577
|
scale = expression.args.get("scale")
|
|
2578
2578
|
|
|
2579
2579
|
if not fmt and precision and scale:
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
)
|
|
2580
|
+
to = exp.DataType.build(f"DECIMAL({precision.name}, {scale.name})", dialect="duckdb")
|
|
2581
|
+
if expression.args.get("safe"):
|
|
2582
|
+
return self.sql(exp.TryCast(this=expression.this, to=to))
|
|
2583
|
+
return self.sql(exp.cast(expression.this, to, dialect="duckdb"))
|
|
2585
2584
|
|
|
2586
2585
|
return super().tonumber_sql(expression)
|
|
2587
2586
|
|
|
@@ -3075,6 +3074,9 @@ class DuckDBGenerator(generator.Generator):
|
|
|
3075
3074
|
if milli or nano:
|
|
3076
3075
|
expression.set("sec", sec)
|
|
3077
3076
|
|
|
3077
|
+
if zone := expression.args.get("zone"):
|
|
3078
|
+
return self.sql(exp.AtTimeZone(this=expression, zone=zone.pop()))
|
|
3079
|
+
|
|
3078
3080
|
return rename_func("MAKE_TIMESTAMP")(self, expression)
|
|
3079
3081
|
|
|
3080
3082
|
@unsupported_args("nano")
|
|
@@ -154,9 +154,9 @@ class MySQLGenerator(generator.Generator):
|
|
|
154
154
|
exp.DateDiff: remove_ts_or_ds_to_date(
|
|
155
155
|
lambda self, e: self.func("DATEDIFF", e.this, e.expression), ("this", "expression")
|
|
156
156
|
),
|
|
157
|
-
exp.DateAdd:
|
|
157
|
+
exp.DateAdd: date_add_sql("ADD"),
|
|
158
158
|
exp.DateStrToDate: datestrtodate_sql,
|
|
159
|
-
exp.DateSub:
|
|
159
|
+
exp.DateSub: date_add_sql("SUB"),
|
|
160
160
|
exp.DateTrunc: _date_trunc_sql,
|
|
161
161
|
exp.Day: remove_ts_or_ds_to_date(),
|
|
162
162
|
exp.DayOfMonth: remove_ts_or_ds_to_date(rename_func("DAYOFMONTH")),
|
|
@@ -1529,7 +1529,12 @@ class SingleStoreGenerator(MySQLGenerator):
|
|
|
1529
1529
|
|
|
1530
1530
|
def collate_sql(self, expression: exp.Collate) -> str:
|
|
1531
1531
|
# SingleStore does not support setting a collation for column in the SELECT query,
|
|
1532
|
-
# so we cast column to a LONGTEXT type with specific collation
|
|
1532
|
+
# so we cast column to a LONGTEXT type with specific collation. If the cast is
|
|
1533
|
+
# already there (e.g. when regenerating previously generated SQL), don't add
|
|
1534
|
+
# another one, so that generation stays idempotent.
|
|
1535
|
+
this = expression.this
|
|
1536
|
+
if isinstance(this, exp.Cast) and this.to.this == exp.DType.LONGTEXT:
|
|
1537
|
+
return self.binary(expression, "COLLATE")
|
|
1533
1538
|
return self.binary(expression, ":> LONGTEXT COLLATE")
|
|
1534
1539
|
|
|
1535
1540
|
def currentdate_sql(self, expression: exp.CurrentDate) -> str:
|