sqlglot 30.24.0__tar.gz → 30.26.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.24.0 → sqlglot-30.26.0}/CHANGELOG.md +189 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/Makefile +13 -3
- {sqlglot-30.24.0/sqlglot.egg-info → sqlglot-30.26.0}/PKG-INFO +4 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0}/pyproject.toml +2 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/setup.py +1 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/athena.py +35 -12
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/bigquery.py +2 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/dialect.py +61 -8
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/duckdb.py +3 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/hive.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/oracle.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/snowflake.py +42 -58
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/spark2.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/sqlite.py +5 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/starrocks.py +9 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/array.py +4 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/builders.py +1 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/constraints.py +2 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/core.py +11 -8
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/datatypes.py +3 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/ddl.py +8 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/properties.py +4 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/query.py +8 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generator.py +133 -24
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/bigquery.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/clickhouse.py +7 -7
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/databricks.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/duckdb.py +111 -14
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/exasol.py +3 -6
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/hive.py +4 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/oracle.py +0 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/postgres.py +67 -11
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/presto.py +7 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/python.py +5 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/snowflake.py +3 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/sqlite.py +6 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/tsql.py +5 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/annotate_types.py +239 -176
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/canonicalize.py +2 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/canonicalize_internal_names.py +11 -10
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/eliminate_joins.py +19 -10
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/merge_subqueries.py +2 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/optimize_joins.py +3 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/pushdown_predicates.py +4 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/qualify_columns.py +94 -158
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/resolver.py +60 -9
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/scope.py +23 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/simplify.py +5 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/unnest_subqueries.py +49 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parser.py +102 -27
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/clickhouse.py +6 -9
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/duckdb.py +95 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/mysql.py +8 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/oracle.py +18 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/postgres.py +56 -5
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/snowflake.py +37 -16
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/spark.py +1 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/sqlite.py +32 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/tokenizer_core.py +2 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/bigquery.py +6 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0/sqlglot.egg-info}/PKG-INFO +4 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.egg-info/requires.txt +3 -3
- sqlglot-30.26.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglotc/pyproject.toml +3 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_athena.py +44 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_bigquery.py +27 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_clickhouse.py +36 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_databricks.py +19 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_dialect.py +137 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_duckdb.py +431 -31
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_exasol.py +2 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_hive.py +15 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_mysql.py +54 -3
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_oracle.py +44 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_postgres.py +101 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_presto.py +1 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_snowflake.py +247 -27
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_spark.py +29 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_sqlite.py +93 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_starrocks.py +14 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_tsql.py +9 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/annotate_types.sql +111 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/canonicalize.sql +34 -5
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +30 -0
- sqlglot-30.26.0/tests/fixtures/optimizer/eliminate_joins.sql +636 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/optimizer.sql +57 -13
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/qualify_columns.sql +70 -2
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +32 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/simplify.sql +6 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +3 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/unnest_subqueries.sql +159 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/pretty.sql +20 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/helpers.py +6 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_executor.py +11 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_expressions.py +21 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_generator.py +3 -1
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_optimizer.py +710 -42
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_parser.py +12 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_sqlglotc.py +17 -4
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_transpile.py +4 -0
- sqlglot-30.24.0/sqlglot.egg-info/scm_version.json +0 -8
- sqlglot-30.24.0/tests/fixtures/optimizer/eliminate_joins.sql +0 -336
- {sqlglot-30.24.0 → sqlglot-30.26.0}/.gitignore +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/.gitmodules +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/.gitpod.yml +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/AGENTS.md +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/CLAUDE.md +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/LICENSE +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/MANIFEST.in +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/README.md +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/setup.cfg +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/spark2.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/time.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/tokens.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglot.png +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_build.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_diff.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_docs.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_errors.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_helper.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_schema.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_serde.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_time.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.24.0 → sqlglot-30.26.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,193 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.25.0] - 2026-10-26
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`c90a322`](https://github.com/tobymao/sqlglot/commit/c90a322c329d2b1003bf73b848f0d9e17f1a3d67) - support non-identifier column parts in compiled code *(PR [#8710](https://github.com/tobymao/sqlglot/pull/8710) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
support non-identifier column parts in compiled code (#8710)
|
|
9
|
+
|
|
10
|
+
- due to [`78b24a7`](https://github.com/tobymao/sqlglot/commit/78b24a744adb8d5dc0eb285f067087338b60f266) - transpile hex SHA2 hashes with ENCODE(..., 'hex') and parse SHA256 as a digest [CLAUDE] *(PR [#8764](https://github.com/tobymao/sqlglot/pull/8764) by [@vidigoat](https://github.com/vidigoat))*:
|
|
11
|
+
|
|
12
|
+
transpile hex SHA2 hashes with ENCODE(..., 'hex') and parse SHA256 as a digest [CLAUDE] (#8764)
|
|
13
|
+
|
|
14
|
+
- due to [`0e7b2da`](https://github.com/tobymao/sqlglot/commit/0e7b2da5d199388e84908aef13c53e535f1cf715) - preserve grouping when removing redundant casts *(PR [#8787](https://github.com/tobymao/sqlglot/pull/8787) by [@georgesittas](https://github.com/georgesittas))*:
|
|
15
|
+
|
|
16
|
+
preserve grouping when removing redundant casts (#8787)
|
|
17
|
+
|
|
18
|
+
- due to [`f0b4347`](https://github.com/tobymao/sqlglot/commit/f0b4347b84b71bfd406e2fe831656a6d03351110) - coerce `VALUES` column types across all rows *(PR [#8775](https://github.com/tobymao/sqlglot/pull/8775) by [@drzippie](https://github.com/drzippie))*:
|
|
19
|
+
|
|
20
|
+
coerce `VALUES` column types across all rows (#8775)
|
|
21
|
+
|
|
22
|
+
- due to [`9d2966e`](https://github.com/tobymao/sqlglot/commit/9d2966ed3f8a7f0d370846dbae1579b40ddc2924) - defer scope annotation until qualification is complete *(PR [#8696](https://github.com/tobymao/sqlglot/pull/8696) by [@georgesittas](https://github.com/georgesittas))*:
|
|
23
|
+
|
|
24
|
+
defer scope annotation until qualification is complete (#8696)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### :sparkles: New Features
|
|
28
|
+
- [`a220ffb`](https://github.com/tobymao/sqlglot/commit/a220ffb98a2f0ba290ff09c75154a73f09ff57b1) - **duckdb**: support NEAREST joins *(PR [#8722](https://github.com/tobymao/sqlglot/pull/8722) by [@georgesittas](https://github.com/georgesittas))*
|
|
29
|
+
- [`5e0f716`](https://github.com/tobymao/sqlglot/commit/5e0f7169307a4c77fe4cd1eba484eed47d124c4e) - **optimizer**: back-project columns to single unknown-schema TVF *(PR [#8677](https://github.com/tobymao/sqlglot/pull/8677) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
30
|
+
- [`43fbff2`](https://github.com/tobymao/sqlglot/commit/43fbff2037b3c4aa4459ca5bce111c6a1c0c1559) - **optimizer**: Fix positional renaming to have proper type *(PR [#8725](https://github.com/tobymao/sqlglot/pull/8725) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
31
|
+
- [`1852fd3`](https://github.com/tobymao/sqlglot/commit/1852fd31961ac51afc38c923e33af84a447adced) - **starrocks**: parse blacklist and TRANSLATE TRINO statements as commands [CLAUDE] *(PR [#8732](https://github.com/tobymao/sqlglot/pull/8732) by [@nytai](https://github.com/nytai))*
|
|
32
|
+
- [`e3b3e23`](https://github.com/tobymao/sqlglot/commit/e3b3e23c644728be22e718b6ca838f753757592f) - **duckdb**: normalize explicit join types *(PR [#8759](https://github.com/tobymao/sqlglot/pull/8759) by [@georgesittas](https://github.com/georgesittas))*
|
|
33
|
+
- [`46af6e4`](https://github.com/tobymao/sqlglot/commit/46af6e468564c271f7cc748dda68a6d813a683f6) - **duckdb**: v2 [dis]connect statement *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
34
|
+
- [`c514be0`](https://github.com/tobymao/sqlglot/commit/c514be049b382191d6ba010c2af4765d9b8cca57) - **duckdb**: parse SQL trigger bodies *(PR [#8796](https://github.com/tobymao/sqlglot/pull/8796) by [@georgesittas](https://github.com/georgesittas))*
|
|
35
|
+
|
|
36
|
+
### :bug: Bug Fixes
|
|
37
|
+
- [`67961af`](https://github.com/tobymao/sqlglot/commit/67961afbed7c986dfe26ab82db89a25814c1bdcb) - **optimizer**: preserve unresolved JSON paths during alias matching *(PR [#8693](https://github.com/tobymao/sqlglot/pull/8693) by [@georgesittas](https://github.com/georgesittas))*
|
|
38
|
+
- [`c90a322`](https://github.com/tobymao/sqlglot/commit/c90a322c329d2b1003bf73b848f0d9e17f1a3d67) - support non-identifier column parts in compiled code *(PR [#8710](https://github.com/tobymao/sqlglot/pull/8710) by [@georgesittas](https://github.com/georgesittas))*
|
|
39
|
+
- [`d335f89`](https://github.com/tobymao/sqlglot/commit/d335f8985e59ad986408604ce92733e6834f24eb) - **generator**: parenthesize CONCAT paths in JSON arrow operators [CLAUDE] *(PR [#8701](https://github.com/tobymao/sqlglot/pull/8701) by [@vidigoat](https://github.com/vidigoat))*
|
|
40
|
+
- [`e6c7d52`](https://github.com/tobymao/sqlglot/commit/e6c7d5275707635d7f5cbf08ba6f8095126ab669) - **parser**: parse the column list after an INSERT target alias as the INSERT's [CLAUDE] *(PR [#8712](https://github.com/tobymao/sqlglot/pull/8712) by [@vidigoat](https://github.com/vidigoat))*
|
|
41
|
+
- [`83479d0`](https://github.com/tobymao/sqlglot/commit/83479d061b1b92836cc41b6fdf266f575a72dc3f) - duckdb v2 compat *(PR [#8717](https://github.com/tobymao/sqlglot/pull/8717) by [@georgesittas](https://github.com/georgesittas))*
|
|
42
|
+
- [`092e29a`](https://github.com/tobymao/sqlglot/commit/092e29a82fdb153c6c1925627b0b4a7955398c9b) - **databricks**: preserve timestamp precision during SQL generation *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
43
|
+
- [`2b57c00`](https://github.com/tobymao/sqlglot/commit/2b57c00a114ad74f8d016f499b0cc97c7ffca9d5) - **sqlite**: parse multi-argument MAX/MIN as GREATEST/LEAST *(PR [#8734](https://github.com/tobymao/sqlglot/pull/8734) by [@vidigoat](https://github.com/vidigoat))*
|
|
44
|
+
- [`83c09cd`](https://github.com/tobymao/sqlglot/commit/83c09cdf3cdd42a6a28a9e7514fdef0a9e202d77) - **oracle**: allow non-reserved SAMPLE and MATCH_RECOGNIZE as identifiers [CLAUDE] *(PR [#8733](https://github.com/tobymao/sqlglot/pull/8733) by [@adrianlzt](https://github.com/adrianlzt))*
|
|
45
|
+
- :arrow_lower_right: *fixes issue [#8715](https://github.com/tobymao/sqlglot/issues/8715) opened by [@adrianlzt](https://github.com/adrianlzt)*
|
|
46
|
+
- [`069a751`](https://github.com/tobymao/sqlglot/commit/069a75175b3914ccaed99162eaae9b817482da48) - **clickhouse**: natural join [#8739](https://github.com/tobymao/sqlglot/pull/8739) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
47
|
+
- [`a97d035`](https://github.com/tobymao/sqlglot/commit/a97d03579f530531451e773823d823404cb6bedd) - **duckdb**: keep the - end placeholder of a slice with a step [CLAUDE] *(PR [#8736](https://github.com/tobymao/sqlglot/pull/8736) by [@vidigoat](https://github.com/vidigoat))*
|
|
48
|
+
- [`30ceae5`](https://github.com/tobymao/sqlglot/commit/30ceae53a0049859d9fd36b2ec1336a9cad7d4d2) - **optimizer**: preserve semantics when unnesting subqueries in JOIN ON *(PR [#8742](https://github.com/tobymao/sqlglot/pull/8742) by [@georgesittas](https://github.com/georgesittas))*
|
|
49
|
+
- :arrow_lower_right: *fixes issue [#8737](https://github.com/tobymao/sqlglot/issues/8737) opened by [@DeepBuha06](https://github.com/DeepBuha06)*
|
|
50
|
+
- [`4678f6c`](https://github.com/tobymao/sqlglot/commit/4678f6cb67662b0156d942f603eee816abbfec5a) - **optimizer**: preserve row references and aliases during TVF inference *(PR [#8723](https://github.com/tobymao/sqlglot/pull/8723) by [@georgesittas](https://github.com/georgesittas))*
|
|
51
|
+
- [`8fb04fb`](https://github.com/tobymao/sqlglot/commit/8fb04fb3428d592ba785dfc75bff19cf29d6d198) - **sqlite**: normalize hexadecimal integer literals *(PR [#8744](https://github.com/tobymao/sqlglot/pull/8744) by [@georgesittas](https://github.com/georgesittas))*
|
|
52
|
+
- [`b994fa7`](https://github.com/tobymao/sqlglot/commit/b994fa759bb85182ae4a589c1d01973829236047) - **optimizer**: don't fold decimal division by zero [CLAUDE] *(PR [#8748](https://github.com/tobymao/sqlglot/pull/8748) by [@Debasishhh](https://github.com/Debasishhh))*
|
|
53
|
+
- :arrow_lower_right: *fixes issue [#8747](https://github.com/tobymao/sqlglot/issues/8747) opened by [@Debasishhh](https://github.com/Debasishhh)*
|
|
54
|
+
- [`dd71d36`](https://github.com/tobymao/sqlglot/commit/dd71d360f4ac49fc67b8a444b5c4c557e67298ea) - **duckdb**: keep the fraction of an interval written as one string [CLAUDE] *(PR [#8746](https://github.com/tobymao/sqlglot/pull/8746) by [@vidigoat](https://github.com/vidigoat))*
|
|
55
|
+
- [`7600123`](https://github.com/tobymao/sqlglot/commit/76001235539919787dfd05923c90d39b97122773) - **optimizer**: resolve Snowflake token-splitter columns and BigQuery pivot rows *(PR [#8745](https://github.com/tobymao/sqlglot/pull/8745) by [@georgesittas](https://github.com/georgesittas))*
|
|
56
|
+
- [`eb03a97`](https://github.com/tobymao/sqlglot/commit/eb03a9726f27ce33b2a899e2b70c52ba8e6de8ad) - **postgres**: transpile a case-insensitive regex flag to ~* [CLAUDE] *(PR [#8755](https://github.com/tobymao/sqlglot/pull/8755) by [@vidigoat](https://github.com/vidigoat))*
|
|
57
|
+
- [`a9f1309`](https://github.com/tobymao/sqlglot/commit/a9f1309cc7116a79008c9a2b6ab0a06ce6b6f4c7) - **optimizer**: rename right operand references when aligning UNION BY NAME *(PR [#8749](https://github.com/tobymao/sqlglot/pull/8749) by [@treysp](https://github.com/treysp))*
|
|
58
|
+
- [`e0ac5e4`](https://github.com/tobymao/sqlglot/commit/e0ac5e4e667146df9fce47fd3a449bdd19f4f8ea) - keep the last value of an exclusive series with a negative step [CLAUDE] *(PR [#8757](https://github.com/tobymao/sqlglot/pull/8757) by [@vidigoat](https://github.com/vidigoat))*
|
|
59
|
+
- [`f872c44`](https://github.com/tobymao/sqlglot/commit/f872c442af585d773247f623cd5878d17cda6850) - **optimizer**: preserve filtered and grouped CROSS JOIN inputs [CODEX] *(PR [#8756](https://github.com/tobymao/sqlglot/pull/8756) by [@Seraph-x](https://github.com/Seraph-x))*
|
|
60
|
+
- :arrow_lower_right: *fixes issue [#8754](https://github.com/tobymao/sqlglot/issues/8754) opened by [@hutiefang76](https://github.com/hutiefang76)*
|
|
61
|
+
- [`4aa189a`](https://github.com/tobymao/sqlglot/commit/4aa189a472639e7af442c8d794514ec3ab116995) - **duckdb**: decode the escapes of a Unicode string into its characters [CLAUDE] *(PR [#8758](https://github.com/tobymao/sqlglot/pull/8758) by [@vidigoat](https://github.com/vidigoat))*
|
|
62
|
+
- [`184557f`](https://github.com/tobymao/sqlglot/commit/184557f70dd6b606e76fb2592bd096e4667450eb) - **oracle**: parse JSON_VALUE RETURNING clause *(PR [#8762](https://github.com/tobymao/sqlglot/pull/8762) by [@madarwish007](https://github.com/madarwish007))*
|
|
63
|
+
- :arrow_lower_right: *fixes issue [#8761](https://github.com/tobymao/sqlglot/issues/8761) opened by [@madarwish007](https://github.com/madarwish007)*
|
|
64
|
+
- [`37f0963`](https://github.com/tobymao/sqlglot/commit/37f09630d14be44def882c8a2ef0666725a4d83a) - **optimizer**: GROUP BY ordinal interpretation in unnested subqueries *(PR [#8730](https://github.com/tobymao/sqlglot/pull/8730) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
65
|
+
- [`4d7421e`](https://github.com/tobymao/sqlglot/commit/4d7421ee43612043f11574d98227319d5e1f9855) - **optimizer**: keep CROSS JOIN with LIMIT 1 and split the LEFT JOIN row check *(PR [#8760](https://github.com/tobymao/sqlglot/pull/8760) by [@geooo109](https://github.com/geooo109))*
|
|
66
|
+
- :arrow_lower_right: *fixes issue [#8750](https://github.com/tobymao/sqlglot/issues/8750) opened by [@wjjc1017](https://github.com/wjjc1017)*
|
|
67
|
+
- [`78b24a7`](https://github.com/tobymao/sqlglot/commit/78b24a744adb8d5dc0eb285f067087338b60f266) - **postgres**: transpile hex SHA2 hashes with ENCODE(..., 'hex') and parse SHA256 as a digest [CLAUDE] *(PR [#8764](https://github.com/tobymao/sqlglot/pull/8764) by [@vidigoat](https://github.com/vidigoat))*
|
|
68
|
+
- [`c068aef`](https://github.com/tobymao/sqlglot/commit/c068aefd6997c5d272af86fb560ee25d8d5a10d6) - **parser**: copy DataType node for each cast in _replace_lambda *(PR [#8780](https://github.com/tobymao/sqlglot/pull/8780) by [@Pyhroff](https://github.com/Pyhroff))*
|
|
69
|
+
- :arrow_lower_right: *fixes issue [#8777](https://github.com/tobymao/sqlglot/issues/8777) opened by [@olmaks](https://github.com/olmaks)*
|
|
70
|
+
- [`a8a7610`](https://github.com/tobymao/sqlglot/commit/a8a7610d5d4139fe14d2ea624652fdbdb5ba74b3) - **bigquery**: generate EXTRACT(DAYOFWEEK FROM ...) for DayOfWeek *(PR [#8778](https://github.com/tobymao/sqlglot/pull/8778) by [@JoeyTan21](https://github.com/JoeyTan21))*
|
|
71
|
+
- :arrow_lower_right: *fixes issue [#8767](https://github.com/tobymao/sqlglot/issues/8767) opened by [@JoeyTan21](https://github.com/JoeyTan21)*
|
|
72
|
+
- [`d375836`](https://github.com/tobymao/sqlglot/commit/d3758367d4205bc728738110363e82edb3be211b) - **generator**: escape text before quoting it in generated SQL *(PR [#8779](https://github.com/tobymao/sqlglot/pull/8779) by [@tobymao](https://github.com/tobymao))*
|
|
73
|
+
- [`8c5600a`](https://github.com/tobymao/sqlglot/commit/8c5600ad1fa322cbc11dcd93ee78cf5608efeda5) - **clickhouse**: parenthesize Contains under unary minus [CLAUDE] *(PR [#8782](https://github.com/tobymao/sqlglot/pull/8782) by [@ekut](https://github.com/ekut))*
|
|
74
|
+
- [`908809d`](https://github.com/tobymao/sqlglot/commit/908809d3c2b756d0c4e259c55e8e61ca9579ebd8) - **sqlite**: parse REAL and FLOAT as 8-byte DOUBLE [CLAUDE] *(PR [#8784](https://github.com/tobymao/sqlglot/pull/8784) by [@kennywu411-dev](https://github.com/kennywu411-dev))*
|
|
75
|
+
- [`bc1cd99`](https://github.com/tobymao/sqlglot/commit/bc1cd99a78974337a592662023e24231c2bf2a91) - **parser**: infinite loop issue *(PR [#8788](https://github.com/tobymao/sqlglot/pull/8788) by [@georgesittas](https://github.com/georgesittas))*
|
|
76
|
+
- :arrow_lower_right: *fixes issue [#8786](https://github.com/tobymao/sqlglot/issues/8786) opened by [@RaghavChamadiya](https://github.com/RaghavChamadiya)*
|
|
77
|
+
- [`0e7b2da`](https://github.com/tobymao/sqlglot/commit/0e7b2da5d199388e84908aef13c53e535f1cf715) - **optimizer**: preserve grouping when removing redundant casts *(PR [#8787](https://github.com/tobymao/sqlglot/pull/8787) by [@georgesittas](https://github.com/georgesittas))*
|
|
78
|
+
- [`f0b4347`](https://github.com/tobymao/sqlglot/commit/f0b4347b84b71bfd406e2fe831656a6d03351110) - **optimizer**: coerce `VALUES` column types across all rows *(PR [#8775](https://github.com/tobymao/sqlglot/pull/8775) by [@drzippie](https://github.com/drzippie))*
|
|
79
|
+
- [`5859d71`](https://github.com/tobymao/sqlglot/commit/5859d7146aca266f3fdfbff6f11a8eeffcb4ee78) - **duckdb**: keep every path of a multi-path JSON_EXTRACT [CLAUDE] *(PR [#8771](https://github.com/tobymao/sqlglot/pull/8771) by [@vidigoat](https://github.com/vidigoat))*
|
|
80
|
+
- [`bc7a5c4`](https://github.com/tobymao/sqlglot/commit/bc7a5c466e8dffe653c3fe04cb080cef1de1ad41) - **optimizer**: avoid unsafe `LEFT JOIN` elimination with `DISTINCT ON` *(PR [#8769](https://github.com/tobymao/sqlglot/pull/8769) by [@treysp](https://github.com/treysp))*
|
|
81
|
+
- :arrow_lower_right: *fixes issue [#8751](https://github.com/tobymao/sqlglot/issues/8751) opened by [@wjjc1017](https://github.com/wjjc1017)*
|
|
82
|
+
- [`33c7209`](https://github.com/tobymao/sqlglot/commit/33c72094fbe6d05382e560e1026780372640f79b) - **optimizer**: exclude semi/anti join RHS sources from column resolution *(PR [#8763](https://github.com/tobymao/sqlglot/pull/8763) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
83
|
+
- [`634edd9`](https://github.com/tobymao/sqlglot/commit/634edd93bedaa5cb624098bb66fb99e07706f4ce) - **sqlite**: generate functions for temporal casts *(PR [#8793](https://github.com/tobymao/sqlglot/pull/8793) by [@georgesittas](https://github.com/georgesittas))*
|
|
84
|
+
- :arrow_lower_right: *fixes issue [#8791](https://github.com/tobymao/sqlglot/issues/8791) opened by [@kennywu411-dev](https://github.com/kennywu411-dev)*
|
|
85
|
+
- [`ebd5fb4`](https://github.com/tobymao/sqlglot/commit/ebd5fb4d74f6e849ef989c2a81ab8e69e0395569) - **duckdb**: drop the SQL/JSON clauses of JSON_ARRAY and JSON_OBJECT [CLAUDE] *(PR [#8794](https://github.com/tobymao/sqlglot/pull/8794) by [@vidigoat](https://github.com/vidigoat))*
|
|
86
|
+
- [`a357b7d`](https://github.com/tobymao/sqlglot/commit/a357b7d9be3d7c03ece213d53421d8a192b90a03) - **postgres**: support tablespace clauses in CREATE statements [CODEX] *(PR [#8792](https://github.com/tobymao/sqlglot/pull/8792) by [@georgesittas](https://github.com/georgesittas))*
|
|
87
|
+
- :arrow_lower_right: *fixes issue [#8776](https://github.com/tobymao/sqlglot/issues/8776) opened by [@cmodiano](https://github.com/cmodiano)*
|
|
88
|
+
- [`31918e9`](https://github.com/tobymao/sqlglot/commit/31918e9a2f249bb5cda263e644eb9c1b96be0c6d) - **duckdb**: preserve quoted variable names *(PR [#8795](https://github.com/tobymao/sqlglot/pull/8795) by [@georgesittas](https://github.com/georgesittas))*
|
|
89
|
+
- [`c5fe540`](https://github.com/tobymao/sqlglot/commit/c5fe5404f379d84798610ab23fb94980f26d2ff2) - **snowflake**: support MERGE ALL BY NAME *(PR [#8797](https://github.com/tobymao/sqlglot/pull/8797) by [@georgesittas](https://github.com/georgesittas))*
|
|
90
|
+
- :arrow_lower_right: *fixes issue [#8783](https://github.com/tobymao/sqlglot/issues/8783) opened by [@sai-sakalam](https://github.com/sai-sakalam)*
|
|
91
|
+
- [`114999a`](https://github.com/tobymao/sqlglot/commit/114999ae6787cbdb7ea630710b82ad2849711e08) - **optimizer**: avoid nested aggregates when unnesting scalar subqueries [CODEX] *(PR [#8798](https://github.com/tobymao/sqlglot/pull/8798) by [@georgesittas](https://github.com/georgesittas))*
|
|
92
|
+
- :arrow_lower_right: *fixes issue [#8790](https://github.com/tobymao/sqlglot/issues/8790) opened by [@kennywu411-dev](https://github.com/kennywu411-dev)*
|
|
93
|
+
- [`fb36fb7`](https://github.com/tobymao/sqlglot/commit/fb36fb7112ad71356fe81fd2cce9aa4733679e1d) - **optimizer**: annotate struct-valued subqueries and row references *(PR [#8694](https://github.com/tobymao/sqlglot/pull/8694) by [@georgesittas](https://github.com/georgesittas))*
|
|
94
|
+
|
|
95
|
+
### :zap: Performance Improvements
|
|
96
|
+
- [`a2a8bb4`](https://github.com/tobymao/sqlglot/commit/a2a8bb4209e188c0ae78d9809ec3e27666c00f16) - **athena**: avoid tokenizing DML twice [CLAUDE] *(PR [#8709](https://github.com/tobymao/sqlglot/pull/8709) by [@masiljangajji](https://github.com/masiljangajji))*
|
|
97
|
+
- :arrow_lower_right: *addresses issue [#8708](https://github.com/tobymao/sqlglot/issues/8708) opened by [@masiljangajji](https://github.com/masiljangajji)*
|
|
98
|
+
- [`7c4e124`](https://github.com/tobymao/sqlglot/commit/7c4e124f21225a4b60d790cb6938d64bf2778d4a) - **optimizer**: cache positional column alias mappings [CODEX] *(PR [#8735](https://github.com/tobymao/sqlglot/pull/8735) by [@georgesittas](https://github.com/georgesittas))*
|
|
99
|
+
|
|
100
|
+
### :recycle: Refactors
|
|
101
|
+
- [`65eb0f2`](https://github.com/tobymao/sqlglot/commit/65eb0f229a5d7af5e4d3ff9084d79362e5fc899a) - **duckdb**: drop unused Lambda colon arg *(PR [#8721](https://github.com/tobymao/sqlglot/pull/8721) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
102
|
+
- [`2bf94d9`](https://github.com/tobymao/sqlglot/commit/2bf94d96359db584862dcf20b358f34cabc1661d) - **optimizer**: expand struct column paths using inferred types *(PR [#8695](https://github.com/tobymao/sqlglot/pull/8695) by [@georgesittas](https://github.com/georgesittas))*
|
|
103
|
+
- [`9d2966e`](https://github.com/tobymao/sqlglot/commit/9d2966ed3f8a7f0d370846dbae1579b40ddc2924) - **optimizer**: defer scope annotation until qualification is complete *(PR [#8696](https://github.com/tobymao/sqlglot/pull/8696) by [@georgesittas](https://github.com/georgesittas))*
|
|
104
|
+
|
|
105
|
+
### :wrench: Chores
|
|
106
|
+
- [`9fedfa5`](https://github.com/tobymao/sqlglot/commit/9fedfa5f5ecb94f4ca290ee6373b1dd4feb120e2) - fix comments for insert table *(commit by [@geooo109](https://github.com/geooo109))*
|
|
107
|
+
- [`3377b95`](https://github.com/tobymao/sqlglot/commit/3377b95795837881a1ffe86c0ea6965084b195d7) - minimize insert table parser *(commit by [@geooo109](https://github.com/geooo109))*
|
|
108
|
+
- [`9075977`](https://github.com/tobymao/sqlglot/commit/90759771ddf61d8b53d729712c53870a3317f5ce) - suppress unsupported property warning in tests *(PR [#8724](https://github.com/tobymao/sqlglot/pull/8724) by [@treysp](https://github.com/treysp))*
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## [v30.24.0] - 2026-10-20
|
|
112
|
+
### :boom: BREAKING CHANGES
|
|
113
|
+
- due to [`094509a`](https://github.com/tobymao/sqlglot/commit/094509aad83fff575f1b4d198e4d03c21c432e58) - merge SortArray into ArraySort with explicit NULL ordering *(PR [#8643](https://github.com/tobymao/sqlglot/pull/8643) by [@tobymao](https://github.com/tobymao))*:
|
|
114
|
+
|
|
115
|
+
merge SortArray into ArraySort with explicit NULL ordering (#8643)
|
|
116
|
+
|
|
117
|
+
- due to [`7af2aa8`](https://github.com/tobymao/sqlglot/commit/7af2aa8db5e9b9df0afea07201574ceeb9e66098) - register CTE reference alias when pivoted *(PR [#8667](https://github.com/tobymao/sqlglot/pull/8667) by [@ansh-rohilla](https://github.com/ansh-rohilla))*:
|
|
118
|
+
|
|
119
|
+
register CTE reference alias when pivoted (#8667)
|
|
120
|
+
|
|
121
|
+
- due to [`1e5c649`](https://github.com/tobymao/sqlglot/commit/1e5c649cc4157bf4451bba1361a3898d9504745b) - map ISO week format patterns IYYY and IW [CLAUDE] *(PR [#8672](https://github.com/tobymao/sqlglot/pull/8672) by [@vidigoat](https://github.com/vidigoat))*:
|
|
122
|
+
|
|
123
|
+
map ISO week format patterns IYYY and IW [CLAUDE] (#8672)
|
|
124
|
+
|
|
125
|
+
- due to [`479c4ca`](https://github.com/tobymao/sqlglot/commit/479c4cae0e38d60d10f4aac833c4091d5c2304e2) - respect dialect precedence of IS predicates *(PR [#8676](https://github.com/tobymao/sqlglot/pull/8676) by [@georgesittas](https://github.com/georgesittas))*:
|
|
126
|
+
|
|
127
|
+
respect dialect precedence of IS predicates (#8676)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### :sparkles: New Features
|
|
131
|
+
- [`2444b6d`](https://github.com/tobymao/sqlglot/commit/2444b6db78f336b70c6f7aa980e43036367c7b0d) - **optimizer**: paste join support *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
132
|
+
- [`ec24376`](https://github.com/tobymao/sqlglot/commit/ec24376a58200dff16820fddcd15db102b6ead2e) - **starrocks**: parse admin and job-control statements as commands [CLAUDE] *(PR [#8681](https://github.com/tobymao/sqlglot/pull/8681) by [@nytai](https://github.com/nytai))*
|
|
133
|
+
|
|
134
|
+
### :bug: Bug Fixes
|
|
135
|
+
- [`f814e4c`](https://github.com/tobymao/sqlglot/commit/f814e4cb2a8743bba63e8818bae25207bbd3966f) - **mysql**: preserve population and sample aggregate semantics [CODEX] *(PR [#8632](https://github.com/tobymao/sqlglot/pull/8632) by [@yousefissa](https://github.com/yousefissa))*
|
|
136
|
+
- :arrow_lower_right: *fixes issue [#8626](https://github.com/tobymao/sqlglot/issues/8626) opened by [@bhargaviHQ](https://github.com/bhargaviHQ)*
|
|
137
|
+
- [`5527744`](https://github.com/tobymao/sqlglot/commit/552774469174ee686def95e6bcb2da46f61e047b) - **starrocks**: keep DATEDIFF's date-part semantics [CLAUDE] *(PR [#8636](https://github.com/tobymao/sqlglot/pull/8636) by [@nytai](https://github.com/nytai))*
|
|
138
|
+
- [`03744a2`](https://github.com/tobymao/sqlglot/commit/03744a2a8376af5f5f70230b04d1c5fbfb71dc61) - **hive,spark**: parse ALTER TABLE REPLACE COLUMNS [CLAUDE] *(PR [#8633](https://github.com/tobymao/sqlglot/pull/8633) by [@tsamaras](https://github.com/tsamaras))*
|
|
139
|
+
- [`021991f`](https://github.com/tobymao/sqlglot/commit/021991fb9a63060e2f71aeac48e134f67c77227f) - **optimizer**: evict dead refs from the type annotator cache *(PR [#8642](https://github.com/tobymao/sqlglot/pull/8642) by [@georgesittas](https://github.com/georgesittas))*
|
|
140
|
+
- :arrow_lower_right: *fixes issue [#8637](https://github.com/tobymao/sqlglot/issues/8637) opened by [@naveen-baton](https://github.com/naveen-baton)*
|
|
141
|
+
- [`00fce66`](https://github.com/tobymao/sqlglot/commit/00fce66dffd3dba4f90cda5534ec8df595bb1865) - **optimizer**: ensure generated decorrelation JOIN comes before reference in ON clause *(PR [#8638](https://github.com/tobymao/sqlglot/pull/8638) by [@treysp](https://github.com/treysp))*
|
|
142
|
+
- [`97134ff`](https://github.com/tobymao/sqlglot/commit/97134ffd3cd161222a42405b001a8a30a0a2c6f5) - **optimizer**: preserve precedence when unwrapping parens inside Mul *(PR [#8620](https://github.com/tobymao/sqlglot/pull/8620) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
143
|
+
- [`d747f5b`](https://github.com/tobymao/sqlglot/commit/d747f5b20dd71a379437dd3cf251ec130edd94b3) - don't materialize huge interval literals in simplify and the Postgres generator *(PR [#8641](https://github.com/tobymao/sqlglot/pull/8641) by [@tobymao](https://github.com/tobymao))*
|
|
144
|
+
- [`f321207`](https://github.com/tobymao/sqlglot/commit/f321207c8dcc2973d149744fcaa4d1a13edb0026) - **starrocks**: preserve LIKE argument order [CODEX] *(PR [#8645](https://github.com/tobymao/sqlglot/pull/8645) by [@01zhas](https://github.com/01zhas))*
|
|
145
|
+
- [`954cca1`](https://github.com/tobymao/sqlglot/commit/954cca1268ae38ae0384d5197e54fe50322ee9e3) - **starrocks**: preserve native TO_DAYS [CODEX] *(PR [#8648](https://github.com/tobymao/sqlglot/pull/8648) by [@01zhas](https://github.com/01zhas))*
|
|
146
|
+
- [`ce7f6e3`](https://github.com/tobymao/sqlglot/commit/ce7f6e39dbbbaa61ff01a307226ff867a3a9efb6) - **starrocks**: don't treat # as a comment [CLAUDE] *(PR [#8644](https://github.com/tobymao/sqlglot/pull/8644) by [@nytai](https://github.com/nytai))*
|
|
147
|
+
- [`c388227`](https://github.com/tobymao/sqlglot/commit/c388227a73fe4e6652e311db0a04b8d838c7c821) - remove obsolete sqlglotc extensions during builds *(PR [#8653](https://github.com/tobymao/sqlglot/pull/8653) by [@georgesittas](https://github.com/georgesittas))*
|
|
148
|
+
- [`d17c768`](https://github.com/tobymao/sqlglot/commit/d17c7680b70bccb5fda677aaf63980b2663224dc) - **bigquery**: transpile Trino date parts, FROM_BASE, APPROX_PERCENTILE, ARRAY_SORT and ARRAY_DISTINCT *(PR [#8639](https://github.com/tobymao/sqlglot/pull/8639) by [@tobymao](https://github.com/tobymao))*
|
|
149
|
+
- [`cb57d80`](https://github.com/tobymao/sqlglot/commit/cb57d80214bcd4a165194344b34bc930ef5318b8) - **optimizer**: clear child scope caches when projections are merged *(PR [#8646](https://github.com/tobymao/sqlglot/pull/8646) by [@treysp](https://github.com/treysp))*
|
|
150
|
+
- [`b50e43e`](https://github.com/tobymao/sqlglot/commit/b50e43e4407e010d15da9b313ff99df1b1099343) - **clickhouse**: parse PASTE JOIN instead of aliasing the table *(PR [#8662](https://github.com/tobymao/sqlglot/pull/8662) by [@spicysharkco](https://github.com/spicysharkco))*
|
|
151
|
+
- [`7af2aa8`](https://github.com/tobymao/sqlglot/commit/7af2aa8db5e9b9df0afea07201574ceeb9e66098) - **optimizer**: register CTE reference alias when pivoted *(PR [#8667](https://github.com/tobymao/sqlglot/pull/8667) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
|
|
152
|
+
- :arrow_lower_right: *fixes issue [#8663](https://github.com/tobymao/sqlglot/issues/8663) opened by [@rob2244](https://github.com/rob2244)*
|
|
153
|
+
- [`513beed`](https://github.com/tobymao/sqlglot/commit/513beedd3753a22c1ce234059bd5d831f64e48f0) - **teradata**: drop LOCKING request modifier for other dialects instead of crashing [CLAUDE] *(PR [#8666](https://github.com/tobymao/sqlglot/pull/8666) by [@bhuvan-uda](https://github.com/bhuvan-uda))*
|
|
154
|
+
- :arrow_lower_right: *fixes issue [#8665](https://github.com/tobymao/sqlglot/issues/8665) opened by [@bhuvan-uda](https://github.com/bhuvan-uda)*
|
|
155
|
+
- [`9beb4ab`](https://github.com/tobymao/sqlglot/commit/9beb4ab2807839088f3439a2b937d222e598b617) - **transforms**: don't hoist explodes from nested queries in explode_projection_to_unnest [CLAUDE] *(PR [#8664](https://github.com/tobymao/sqlglot/pull/8664) by [@rob2244](https://github.com/rob2244))*
|
|
156
|
+
- :arrow_lower_right: *fixes issue [#8242](https://github.com/tobymao/sqlglot/issues/8242) opened by [@rob2244](https://github.com/rob2244)*
|
|
157
|
+
- [`f8c314c`](https://github.com/tobymao/sqlglot/commit/f8c314c449080860604b9ddd716d6bc75c89155f) - **teradata**: transpile SAMPLE row counts and fractions [CLAUDE] *(PR [#8670](https://github.com/tobymao/sqlglot/pull/8670) by [@bhuvan-uda](https://github.com/bhuvan-uda))*
|
|
158
|
+
- :arrow_lower_right: *fixes issue [#8669](https://github.com/tobymao/sqlglot/issues/8669) opened by [@bhuvan-uda](https://github.com/bhuvan-uda)*
|
|
159
|
+
- [`1e5c649`](https://github.com/tobymao/sqlglot/commit/1e5c649cc4157bf4451bba1361a3898d9504745b) - **postgres**: map ISO week format patterns IYYY and IW [CLAUDE] *(PR [#8672](https://github.com/tobymao/sqlglot/pull/8672) by [@vidigoat](https://github.com/vidigoat))*
|
|
160
|
+
- [`b06ed8e`](https://github.com/tobymao/sqlglot/commit/b06ed8ea3fc5dbf3771f86ee2a44a2134df0ed00) - **starrocks**: don't default column names for multi-array UNNEST [CLAUDE] *(PR [#8671](https://github.com/tobymao/sqlglot/pull/8671) by [@nytai](https://github.com/nytai))*
|
|
161
|
+
- [`9e57e44`](https://github.com/tobymao/sqlglot/commit/9e57e448de90bc273a926e63f77f4fdf788d0fac) - **oracle**: map ISO week-numbering year IYYY to %G [CLAUDE] *(PR [#8675](https://github.com/tobymao/sqlglot/pull/8675) by [@vidigoat](https://github.com/vidigoat))*
|
|
162
|
+
- [`f536a82`](https://github.com/tobymao/sqlglot/commit/f536a8233b4f9aa1efac982dd9d6b098ed3982a4) - **bigquery**: correct percentile and distinct-array transpilation *(PR [#8674](https://github.com/tobymao/sqlglot/pull/8674) by [@georgesittas](https://github.com/georgesittas))*
|
|
163
|
+
- [`e3d0dfb`](https://github.com/tobymao/sqlglot/commit/e3d0dfb2279d390dfed6e86cc353ed65cb2b97bb) - **optimizer**: give order aliases independent expression nodes *(PR [#8678](https://github.com/tobymao/sqlglot/pull/8678) by [@georgesittas](https://github.com/georgesittas))*
|
|
164
|
+
- [`40dcaab`](https://github.com/tobymao/sqlglot/commit/40dcaabdd29a6c3cda7f4ce29dedcdcffa3e49a0) - **starrocks**: generate PIVOT instead of dropping it [CLAUDE] *(PR [#8679](https://github.com/tobymao/sqlglot/pull/8679) by [@nytai](https://github.com/nytai))*
|
|
165
|
+
- [`fdd0e9a`](https://github.com/tobymao/sqlglot/commit/fdd0e9a464f0f9ec425c56ae83fc87a5e2052087) - **mysql**: relative xor/or/and precedence closes [#8684](https://github.com/tobymao/sqlglot/pull/8684) *(PR [#8686](https://github.com/tobymao/sqlglot/pull/8686) by [@georgesittas](https://github.com/georgesittas))*
|
|
166
|
+
- :arrow_lower_right: *fixes issue [#8684](https://github.com/tobymao/sqlglot/issues/8684) opened by [@pbottine](https://github.com/pbottine)*
|
|
167
|
+
- [`8955d75`](https://github.com/tobymao/sqlglot/commit/8955d752acc88ee23955dd6e07d567542a8cfaf8) - **mysql**: preserve exclamation mark operator precedence *(PR [#8687](https://github.com/tobymao/sqlglot/pull/8687) by [@georgesittas](https://github.com/georgesittas))*
|
|
168
|
+
- :arrow_lower_right: *fixes issue [#8683](https://github.com/tobymao/sqlglot/issues/8683) opened by [@pbottine](https://github.com/pbottine)*
|
|
169
|
+
- [`b1fd4e9`](https://github.com/tobymao/sqlglot/commit/b1fd4e9edf05ee6211656c235a62040e0f055bf0) - **mysql**: respect bitwise operator precedence *(PR [#8688](https://github.com/tobymao/sqlglot/pull/8688) by [@georgesittas](https://github.com/georgesittas))*
|
|
170
|
+
- :arrow_lower_right: *fixes issue [#8685](https://github.com/tobymao/sqlglot/issues/8685) opened by [@pbottine](https://github.com/pbottine)*
|
|
171
|
+
- [`fc1472a`](https://github.com/tobymao/sqlglot/commit/fc1472a0d54c4e8d0d6700b0a4dbe66f0f32707b) - **starrocks**: parse map{...} literals as maps [CLAUDE] *(PR [#8682](https://github.com/tobymao/sqlglot/pull/8682) by [@nytai](https://github.com/nytai))*
|
|
172
|
+
- [`115ce02`](https://github.com/tobymao/sqlglot/commit/115ce02b002ed63ff23a4c99a24ad025ec1efbb4) - **starrocks**: infer static pivot output columns [CODEX] *(PR [#8689](https://github.com/tobymao/sqlglot/pull/8689) by [@georgesittas](https://github.com/georgesittas))*
|
|
173
|
+
- [`479c4ca`](https://github.com/tobymao/sqlglot/commit/479c4cae0e38d60d10f4aac833c4091d5c2304e2) - **parser**: respect dialect precedence of IS predicates *(PR [#8676](https://github.com/tobymao/sqlglot/pull/8676) by [@georgesittas](https://github.com/georgesittas))*
|
|
174
|
+
- :arrow_lower_right: *fixes issue [#8661](https://github.com/tobymao/sqlglot/issues/8661) opened by [@laravioli](https://github.com/laravioli)*
|
|
175
|
+
- [`7e4d995`](https://github.com/tobymao/sqlglot/commit/7e4d995f75dac9fb6ed110109b80bf12f24cdea5) - **clickhouse**: stop re-wrapping parenthesized CTAS queries with COMMENT [CLAUDE] *(PR [#8698](https://github.com/tobymao/sqlglot/pull/8698) by [@vidigoat](https://github.com/vidigoat))*
|
|
176
|
+
- [`d44db25`](https://github.com/tobymao/sqlglot/commit/d44db25a534d86ba593958dd0cc533f8310daef0) - **parser**: support PARTITION BY EXCLUDING *(PR [#8690](https://github.com/tobymao/sqlglot/pull/8690) by [@geooo109](https://github.com/geooo109))*
|
|
177
|
+
- [`2d3d3ff`](https://github.com/tobymao/sqlglot/commit/2d3d3ff7b8b8b475a68d70ffe3529ac110c96f4b) - **fabric**: don't re-wrap AT TIME ZONE that is already cast to DATETIME2 [CLAUDE] *(PR [#8699](https://github.com/tobymao/sqlglot/pull/8699) by [@vidigoat](https://github.com/vidigoat))*
|
|
178
|
+
- [`68cd4a2`](https://github.com/tobymao/sqlglot/commit/68cd4a2d8f766132e338721df8676e0b42d6b7ca) - **duckdb**: quote identifiers that are DuckDB reserved keywords [CLAUDE] *(PR [#8700](https://github.com/tobymao/sqlglot/pull/8700) by [@vidigoat](https://github.com/vidigoat))*
|
|
179
|
+
- [`55bff61`](https://github.com/tobymao/sqlglot/commit/55bff6129f36820c78efccf920c877443dc7fb70) - **optimizer**: retain nodes in type annotation caches *(PR [#8691](https://github.com/tobymao/sqlglot/pull/8691) by [@georgesittas](https://github.com/georgesittas))*
|
|
180
|
+
- [`5d588c0`](https://github.com/tobymao/sqlglot/commit/5d588c0f32d17a08191898638f67ff27bb0a13ff) - **optimizer**: preserve unsupported struct star operands *(PR [#8692](https://github.com/tobymao/sqlglot/pull/8692) by [@georgesittas](https://github.com/georgesittas))*
|
|
181
|
+
|
|
182
|
+
### :recycle: Refactors
|
|
183
|
+
- [`094509a`](https://github.com/tobymao/sqlglot/commit/094509aad83fff575f1b4d198e4d03c21c432e58) - merge SortArray into ArraySort with explicit NULL ordering *(PR [#8643](https://github.com/tobymao/sqlglot/pull/8643) by [@tobymao](https://github.com/tobymao))*
|
|
184
|
+
|
|
185
|
+
### :wrench: Chores
|
|
186
|
+
- [`cd41eee`](https://github.com/tobymao/sqlglot/commit/cd41eeef32e13db1a2517d0a0dc5432ec2b89eb5) - refactor starrocks tests for LIKE *(commit by [@geooo109](https://github.com/geooo109))*
|
|
187
|
+
- [`af2b577`](https://github.com/tobymao/sqlglot/commit/af2b57734d67082ecc4db97cb5da1e8743918af0) - simplify starrocks tests *(commit by [@geooo109](https://github.com/geooo109))*
|
|
188
|
+
- [`df5b53f`](https://github.com/tobymao/sqlglot/commit/df5b53f92e31247e82bc37a512fab0abd4b54031) - refactor starrocks TO_DAYS test *(commit by [@geooo109](https://github.com/geooo109))*
|
|
189
|
+
|
|
190
|
+
|
|
4
191
|
## [v30.23.0] - 2026-10-14
|
|
5
192
|
### :boom: BREAKING CHANGES
|
|
6
193
|
- due to [`cf39265`](https://github.com/tobymao/sqlglot/commit/cf39265a3e8efd8c32bab7f9c9b4f123fdfbf682) - hash flag for case-sensitive nodes [CLAUDE] *(PR [#8599](https://github.com/tobymao/sqlglot/pull/8599) by [@laravioli](https://github.com/laravioli))*:
|
|
@@ -16304,3 +16491,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16304
16491
|
[v30.21.0]: https://github.com/tobymao/sqlglot/compare/v30.20.0...v30.21.0
|
|
16305
16492
|
[v30.22.0]: https://github.com/tobymao/sqlglot/compare/v30.21.0...v30.22.0
|
|
16306
16493
|
[v30.23.0]: https://github.com/tobymao/sqlglot/compare/v30.22.0...v30.23.0
|
|
16494
|
+
[v30.24.0]: https://github.com/tobymao/sqlglot/compare/v30.23.0...v30.24.0
|
|
16495
|
+
[v30.25.0]: https://github.com/tobymao/sqlglot/compare/v30.24.0...v30.25.0
|
|
@@ -28,8 +28,8 @@ install-dev:
|
|
|
28
28
|
@if [ -f sqlglot-integration-tests/Makefile ]; then \
|
|
29
29
|
$(MAKE) -C sqlglot-integration-tests install; \
|
|
30
30
|
fi
|
|
31
|
+
$(PIP) uninstall $(if $(UV),,-y) sqlglotc 2>/dev/null || true
|
|
31
32
|
$(PIP) install -e ".[dev]"
|
|
32
|
-
$(PIP) uninstall -y sqlglotc 2>/dev/null || true
|
|
33
33
|
@if ! command -v gh >/dev/null 2>&1; then \
|
|
34
34
|
echo ""; \
|
|
35
35
|
echo "gh (GitHub CLI) is not installed. It is needed to auto-create PRs for integration tests."; \
|
|
@@ -48,14 +48,24 @@ PY_GE_310 := $(shell python -c "import sys; print(int(sys.version_info >= (3, 10
|
|
|
48
48
|
|
|
49
49
|
install-devc:
|
|
50
50
|
@if [ "$(PY_GE_310)" = "1" ]; then \
|
|
51
|
-
|
|
51
|
+
echo "Building sqlglotc (log: .sqlglotc-build.log)"; \
|
|
52
|
+
(cd sqlglotc && MYPYC_OPT=0 python setup.py build_ext --inplace -j $(NPROC)) > .sqlglotc-build.log 2>&1 || { \
|
|
53
|
+
status=$$?; \
|
|
54
|
+
echo "sqlglotc build failed. See .sqlglotc-build.log for details." >&2; \
|
|
55
|
+
exit $$status; \
|
|
56
|
+
}; \
|
|
52
57
|
else \
|
|
53
58
|
echo "Skipping sqlglotc build: requires Python 3.10+"; \
|
|
54
59
|
fi
|
|
55
60
|
|
|
56
61
|
install-devc-release: clean
|
|
57
62
|
@if [ "$(PY_GE_310)" = "1" ]; then \
|
|
58
|
-
|
|
63
|
+
echo "Building sqlglotc (log: .sqlglotc-build.log)"; \
|
|
64
|
+
(cd sqlglotc && python setup.py build_ext --inplace -j $(NPROC)) > .sqlglotc-build.log 2>&1 || { \
|
|
65
|
+
status=$$?; \
|
|
66
|
+
echo "sqlglotc build failed. See .sqlglotc-build.log for details." >&2; \
|
|
67
|
+
exit $$status; \
|
|
68
|
+
}; \
|
|
59
69
|
else \
|
|
60
70
|
echo "Skipping sqlglotc build: requires Python 3.10+"; \
|
|
61
71
|
fi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.26.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
|
|
@@ -21,7 +21,7 @@ Provides-Extra: dev
|
|
|
21
21
|
Requires-Dist: duckdb>=0.6; extra == "dev"
|
|
22
22
|
Requires-Dist: mypy>=2.4.0; python_version >= "3.10" and extra == "dev"
|
|
23
23
|
Requires-Dist: mypy; python_version < "3.10" and extra == "dev"
|
|
24
|
-
Requires-Dist: setuptools_scm; extra == "dev"
|
|
24
|
+
Requires-Dist: setuptools_scm>=10.2; extra == "dev"
|
|
25
25
|
Requires-Dist: pandas; extra == "dev"
|
|
26
26
|
Requires-Dist: pandas-stubs; extra == "dev"
|
|
27
27
|
Requires-Dist: python-dateutil; extra == "dev"
|
|
@@ -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.26.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.26.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -23,7 +23,7 @@ Repository = "https://github.com/tobymao/sqlglot"
|
|
|
23
23
|
Issues = "https://github.com/tobymao/sqlglot/issues"
|
|
24
24
|
|
|
25
25
|
[build-system]
|
|
26
|
-
requires = ["setuptools >= 61.0", "setuptools_scm"]
|
|
26
|
+
requires = ["setuptools >= 61.0", "setuptools_scm >= 10.2"]
|
|
27
27
|
build-backend = "setuptools.build_meta"
|
|
28
28
|
|
|
29
29
|
[tool.setuptools]
|
|
@@ -31,6 +31,7 @@ include-package-data = false
|
|
|
31
31
|
|
|
32
32
|
[tool.setuptools_scm]
|
|
33
33
|
version_file = "sqlglot/_version.py"
|
|
34
|
+
write_to_source = true
|
|
34
35
|
fallback_version = "0.0.0"
|
|
35
36
|
local_scheme = "no-local-version"
|
|
36
37
|
|
|
@@ -11,7 +11,7 @@ setup(
|
|
|
11
11
|
# for py3.10+; on py3.9 just use upstream mypy for type checking.
|
|
12
12
|
"mypy >= 2.4.0; python_version >= '3.10'",
|
|
13
13
|
"mypy; python_version < '3.10'",
|
|
14
|
-
"setuptools_scm",
|
|
14
|
+
"setuptools_scm >= 10.2",
|
|
15
15
|
"pandas",
|
|
16
16
|
"pandas-stubs",
|
|
17
17
|
"python-dateutil",
|
|
@@ -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.26.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 26, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gb0842a1ee'
|
|
@@ -75,33 +75,56 @@ class Athena(Trino):
|
|
|
75
75
|
self._trino_tokenizer = _TrinoTokenizer(Trino())
|
|
76
76
|
|
|
77
77
|
def tokenize(self, sql: str) -> list[Token]:
|
|
78
|
+
# DML only needs Trino's tokenizer; possible Hive statements need disambiguation.
|
|
79
|
+
try:
|
|
80
|
+
trino_tokens: list[Token] | None = self._trino_tokenizer.tokenize(sql)
|
|
81
|
+
except TokenError:
|
|
82
|
+
trino_tokens = None
|
|
83
|
+
|
|
84
|
+
if trino_tokens is not None and not _may_be_hive(trino_tokens):
|
|
85
|
+
return trino_tokens
|
|
86
|
+
|
|
78
87
|
try:
|
|
79
88
|
tokens = super().tokenize(sql)
|
|
80
89
|
except TokenError:
|
|
81
90
|
# Combined rules can reject literals valid in only one engine.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return [Token(TokenType.HIVE_TOKEN_STREAM, "")] + tokens if hive else tokens
|
|
91
|
+
if trino_tokens is not None and not _tokenize_as_hive(trino_tokens):
|
|
92
|
+
return trino_tokens
|
|
93
|
+
|
|
94
|
+
try:
|
|
95
|
+
tokens = self._hive_tokenizer.tokenize(sql)
|
|
96
|
+
except TokenError:
|
|
97
|
+
pass
|
|
98
|
+
else:
|
|
99
|
+
if _tokenize_as_hive(tokens):
|
|
100
|
+
return [Token(TokenType.HIVE_TOKEN_STREAM, "")] + tokens
|
|
93
101
|
raise
|
|
94
102
|
|
|
95
103
|
if _tokenize_as_hive(tokens):
|
|
96
104
|
return [Token(TokenType.HIVE_TOKEN_STREAM, "")] + self._hive_tokenizer.tokenize(sql)
|
|
97
105
|
|
|
98
|
-
return self._trino_tokenizer.tokenize(sql)
|
|
106
|
+
return trino_tokens if trino_tokens is not None else self._trino_tokenizer.tokenize(sql)
|
|
99
107
|
|
|
100
108
|
Parser = AthenaParser
|
|
101
109
|
|
|
102
110
|
Generator = AthenaGenerator
|
|
103
111
|
|
|
104
112
|
|
|
113
|
+
_MAYBE_HIVE_TOKENS = {
|
|
114
|
+
TokenType.ALTER,
|
|
115
|
+
TokenType.CREATE,
|
|
116
|
+
TokenType.DESCRIBE,
|
|
117
|
+
TokenType.DROP,
|
|
118
|
+
TokenType.SHOW,
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def _may_be_hive(tokens: list[Token]) -> bool:
|
|
123
|
+
return bool(tokens) and (
|
|
124
|
+
tokens[0].token_type in _MAYBE_HIVE_TOKENS or tokens[0].text.upper() == "MSCK"
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
105
128
|
def _tokenize_as_hive(tokens: list[Token]) -> bool:
|
|
106
129
|
if len(tokens) < 2:
|
|
107
130
|
return False
|
|
@@ -36,6 +36,7 @@ class BigQuery(Dialect):
|
|
|
36
36
|
ANNOTATE_ALL_SCOPES = True
|
|
37
37
|
PROJECTION_ALIASES_SHADOW_SOURCE_NAMES = True
|
|
38
38
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
39
|
+
TABLE_ALIASES_SHADOW_COLUMN_NAMES = True
|
|
39
40
|
SUPPORTS_STRUCT_STAR_EXPANSION = True
|
|
40
41
|
EXCLUDES_PSEUDOCOLUMNS_FROM_STAR = True
|
|
41
42
|
QUERY_RESULTS_ARE_STRUCTS = True
|
|
@@ -210,6 +211,7 @@ class BigQuery(Dialect):
|
|
|
210
211
|
"TIMESTAMP": TokenType.TIMESTAMPTZ,
|
|
211
212
|
"WHILE": TokenType.COMMAND,
|
|
212
213
|
}
|
|
214
|
+
KEYWORDS.pop("ISNULL")
|
|
213
215
|
KEYWORDS.pop("DIV")
|
|
214
216
|
KEYWORDS.pop("VALUES")
|
|
215
217
|
KEYWORDS.pop("/*+")
|
|
@@ -42,7 +42,15 @@ DATE_ADD_OR_DIFF = t.Union[
|
|
|
42
42
|
exp.TsOrDsAdd,
|
|
43
43
|
exp.TsOrDsDiff,
|
|
44
44
|
]
|
|
45
|
-
DATE_ADD_OR_SUB = t.Union[
|
|
45
|
+
DATE_ADD_OR_SUB = t.Union[
|
|
46
|
+
exp.DateAdd,
|
|
47
|
+
exp.DateSub,
|
|
48
|
+
exp.DatetimeAdd,
|
|
49
|
+
exp.DatetimeSub,
|
|
50
|
+
exp.TimestampAdd,
|
|
51
|
+
exp.TimestampSub,
|
|
52
|
+
exp.TsOrDsAdd,
|
|
53
|
+
]
|
|
46
54
|
JSON_EXTRACT_TYPE = t.Union[
|
|
47
55
|
exp.JSONExtract, exp.JSONExtractScalar, exp.JSONBExtract, exp.JSONBExtractScalar
|
|
48
56
|
]
|
|
@@ -59,6 +67,10 @@ DATETIME_DELTA = t.Union[
|
|
|
59
67
|
]
|
|
60
68
|
DATETIME_ADD = (exp.DateAdd, exp.TimeAdd, exp.DatetimeAdd, exp.TsOrDsAdd, exp.TimestampAdd)
|
|
61
69
|
|
|
70
|
+
# JSON paths that need parentheses when used as the right operand of -> / ->>.
|
|
71
|
+
# CONCAT may be generated as a chain of || operators, which would bind looser than the arrow
|
|
72
|
+
WRAPPED_JSON_PATH_EXPRESSIONS = (exp.Binary, exp.Predicate, exp.Not, exp.Concat)
|
|
73
|
+
|
|
62
74
|
if t.TYPE_CHECKING:
|
|
63
75
|
from sqlglot._typing import B, E, F, GeneratorArgs, ParserArgs, BuilderArgs
|
|
64
76
|
from typing_extensions import Unpack
|
|
@@ -635,6 +647,11 @@ class Dialect(metaclass=_Dialect):
|
|
|
635
647
|
with "custom_fields" in GROUP BY/HAVING.
|
|
636
648
|
"""
|
|
637
649
|
|
|
650
|
+
TABLE_ALIASES_SHADOW_COLUMN_NAMES = False
|
|
651
|
+
"""
|
|
652
|
+
Whether a whole-row reference to a table alias takes precedence over a same-named column.
|
|
653
|
+
"""
|
|
654
|
+
|
|
638
655
|
TABLES_REFERENCEABLE_AS_COLUMNS = False
|
|
639
656
|
"""
|
|
640
657
|
Whether table names can be referenced as columns (treated as structs).
|
|
@@ -795,6 +812,12 @@ class Dialect(metaclass=_Dialect):
|
|
|
795
812
|
must be explicitly specified.
|
|
796
813
|
"""
|
|
797
814
|
|
|
815
|
+
INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = True
|
|
816
|
+
"""
|
|
817
|
+
Whether INTERSECT binds more tightly than UNION and EXCEPT when a set operation chain isn't
|
|
818
|
+
parenthesized. If False, all set operations have equal precedence and associate left to right.
|
|
819
|
+
"""
|
|
820
|
+
|
|
798
821
|
CREATABLE_KIND_MAPPING: dict[str, str] = {}
|
|
799
822
|
"""
|
|
800
823
|
Helper for dialects that use a different name for the same creatable kind. For example, the Clickhouse
|
|
@@ -1357,7 +1380,7 @@ def arrow_json_extract_sql(
|
|
|
1357
1380
|
if self.JSON_TYPE_REQUIRED_FOR_EXTRACTION and isinstance(this, exp.Literal) and this.is_string:
|
|
1358
1381
|
this.replace(exp.cast(this, exp.DType.JSON))
|
|
1359
1382
|
|
|
1360
|
-
if isinstance(expression.expression,
|
|
1383
|
+
if isinstance(expression.expression, WRAPPED_JSON_PATH_EXPRESSIONS):
|
|
1361
1384
|
expression.set("expression", exp.paren(expression.expression, copy=False))
|
|
1362
1385
|
|
|
1363
1386
|
op = op or ("->" if isinstance(expression, exp.JSONExtract) else "->>")
|
|
@@ -1608,7 +1631,11 @@ def generate_series_sql(
|
|
|
1608
1631
|
if expression.args.get("is_end_exclusive"):
|
|
1609
1632
|
if exclusive_func_name:
|
|
1610
1633
|
return self.func(exclusive_func_name, start, end, step)
|
|
1611
|
-
|
|
1634
|
+
# The last value is one before the end in the direction of the step
|
|
1635
|
+
if step and step.is_int and t.cast(int, step.to_py()) < 0:
|
|
1636
|
+
adjusted_end: exp.Expr = exp.Add(this=end, expression=exp.Literal.number(1))
|
|
1637
|
+
else:
|
|
1638
|
+
adjusted_end = exp.Sub(this=end, expression=exp.Literal.number(1))
|
|
1612
1639
|
return self.func(func_name, start, adjusted_end, step)
|
|
1613
1640
|
|
|
1614
1641
|
return self.func(func_name, start, end, step)
|
|
@@ -2207,13 +2234,23 @@ def date_delta_sql(name: str, cast: bool = False) -> t.Callable[[Generator, DATE
|
|
|
2207
2234
|
return _delta_sql
|
|
2208
2235
|
|
|
2209
2236
|
|
|
2237
|
+
def date_delta_to_binary_sql(self: Generator, expression: exp.Expr, binary: exp.Binary) -> str:
|
|
2238
|
+
parent = expression.parent
|
|
2239
|
+
if isinstance(parent, (exp.Binary, exp.Unary, exp.AtTimeZone)) and not (
|
|
2240
|
+
isinstance(parent, exp.Paren)
|
|
2241
|
+
or isinstance(parent, (exp.Add, exp.Sub))
|
|
2242
|
+
and parent.this is expression
|
|
2243
|
+
):
|
|
2244
|
+
return self.sql(exp.paren(binary, copy=False))
|
|
2245
|
+
return self.sql(binary)
|
|
2246
|
+
|
|
2247
|
+
|
|
2210
2248
|
def date_delta_to_binary_interval_op(
|
|
2211
2249
|
cast: bool = True,
|
|
2212
2250
|
) -> t.Callable[[Generator, DATETIME_DELTA], str]:
|
|
2213
2251
|
def date_delta_to_binary_interval_op_sql(self: Generator, expression: DATETIME_DELTA) -> str:
|
|
2214
2252
|
this = expression.this
|
|
2215
2253
|
unit = unit_to_var(expression)
|
|
2216
|
-
op = "+" if isinstance(expression, DATETIME_ADD) else "-"
|
|
2217
2254
|
|
|
2218
2255
|
to_type: exp.DATA_TYPE | None = None
|
|
2219
2256
|
if cast:
|
|
@@ -2223,7 +2260,15 @@ def date_delta_to_binary_interval_op(
|
|
|
2223
2260
|
# Cast string literals (i.e function parameters) to the appropriate type for +/- interval to work
|
|
2224
2261
|
to_type = (
|
|
2225
2262
|
exp.DType.DATETIME
|
|
2226
|
-
if isinstance(
|
|
2263
|
+
if isinstance(
|
|
2264
|
+
expression,
|
|
2265
|
+
(
|
|
2266
|
+
exp.DatetimeAdd,
|
|
2267
|
+
exp.DatetimeSub,
|
|
2268
|
+
exp.TimestampAdd,
|
|
2269
|
+
exp.TimestampSub,
|
|
2270
|
+
),
|
|
2271
|
+
)
|
|
2227
2272
|
else exp.DType.DATE
|
|
2228
2273
|
)
|
|
2229
2274
|
|
|
@@ -2232,7 +2277,11 @@ def date_delta_to_binary_interval_op(
|
|
|
2232
2277
|
expr = expression.expression
|
|
2233
2278
|
interval = expr if isinstance(expr, exp.Interval) else exp.Interval(this=expr, unit=unit)
|
|
2234
2279
|
|
|
2235
|
-
return
|
|
2280
|
+
return date_delta_to_binary_sql(
|
|
2281
|
+
self,
|
|
2282
|
+
expression,
|
|
2283
|
+
this + interval if isinstance(expression, DATETIME_ADD) else this - interval,
|
|
2284
|
+
)
|
|
2236
2285
|
|
|
2237
2286
|
return date_delta_to_binary_interval_op_sql
|
|
2238
2287
|
|
|
@@ -2704,9 +2753,13 @@ def no_make_interval_sql(self: Generator, expression: exp.MakeInterval, sep: str
|
|
|
2704
2753
|
if isinstance(value, exp.Kwarg):
|
|
2705
2754
|
value = value.expression
|
|
2706
2755
|
|
|
2707
|
-
|
|
2756
|
+
if value is None:
|
|
2757
|
+
continue
|
|
2758
|
+
|
|
2759
|
+
value_sql = value.name if value.is_string else self.sql(value)
|
|
2760
|
+
args.append(f"{value_sql} {unit}")
|
|
2708
2761
|
|
|
2709
|
-
return f"INTERVAL
|
|
2762
|
+
return f"INTERVAL {self.sql(exp.Literal.string(self.format_args(*args, sep=sep)))}"
|
|
2710
2763
|
|
|
2711
2764
|
|
|
2712
2765
|
def length_or_char_length_sql(self: Generator, expression: exp.Length) -> str:
|
|
@@ -24,6 +24,7 @@ class DuckDB(Dialect):
|
|
|
24
24
|
SUPPORTS_LIMIT_ALL = True
|
|
25
25
|
SUPPORTS_FIXED_SIZE_ARRAYS = True
|
|
26
26
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
27
|
+
QUERY_RESULTS_ARE_STRUCTS = True
|
|
27
28
|
STRICT_JSON_PATH_SYNTAX = False
|
|
28
29
|
NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
|
|
29
30
|
UUID_IS_STRING_TYPE = False
|
|
@@ -94,8 +95,10 @@ class DuckDB(Dialect):
|
|
|
94
95
|
"BITSTRING": TokenType.BIT,
|
|
95
96
|
"BPCHAR": TokenType.TEXT,
|
|
96
97
|
"CHAR": TokenType.TEXT,
|
|
98
|
+
"CONNECT": TokenType.CONNECT,
|
|
97
99
|
"DATETIME": TokenType.TIMESTAMPNTZ,
|
|
98
100
|
"DETACH": TokenType.DETACH,
|
|
101
|
+
"DISCONNECT": TokenType.DISCONNECT,
|
|
99
102
|
"FORCE": TokenType.FORCE,
|
|
100
103
|
"INSTALL": TokenType.INSTALL,
|
|
101
104
|
"INT8": TokenType.BIGINT,
|
|
@@ -24,6 +24,7 @@ class Hive(Dialect):
|
|
|
24
24
|
ARRAY_AGG_INCLUDES_NULLS = None
|
|
25
25
|
REGEXP_EXTRACT_DEFAULT_GROUP = 1
|
|
26
26
|
ALTER_TABLE_SUPPORTS_CASCADE = True
|
|
27
|
+
INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
|
|
27
28
|
|
|
28
29
|
# https://spark.apache.org/docs/latest/sql-ref-identifier.html#description
|
|
29
30
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_INSENSITIVE
|
|
@@ -21,6 +21,7 @@ class Oracle(Dialect):
|
|
|
21
21
|
ON_CONDITION_EMPTY_BEFORE_ERROR = False
|
|
22
22
|
ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN = False
|
|
23
23
|
DISABLES_ALIAS_REF_EXPANSION = True
|
|
24
|
+
INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
|
|
24
25
|
|
|
25
26
|
# See section 8: https://docs.oracle.com/cd/A97630_01/server.920/a96540/sql_elements9a.htm
|
|
26
27
|
NORMALIZATION_STRATEGY = NormalizationStrategy.UPPERCASE
|