sqlglot 30.16.0__tar.gz → 30.17.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.16.0 → sqlglot-30.17.0}/CHANGELOG.md +211 -0
- {sqlglot-30.16.0/sqlglot.egg-info → sqlglot-30.17.0}/PKG-INFO +4 -4
- {sqlglot-30.16.0 → sqlglot-30.17.0}/setup.py +1 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/executor/env.py +9 -3
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/core.py +10 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/query.py +22 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generator.py +20 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/python.py +14 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/sqlite.py +16 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/trino.py +26 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/annotate_types.py +21 -6
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/canonicalize_internal_names.py +6 -4
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/eliminate_subqueries.py +8 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/optimize_joins.py +8 -3
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/pushdown_projections.py +30 -3
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/qualify_columns.py +27 -15
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/qualify_tables.py +14 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/scope.py +58 -5
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/simplify.py +17 -4
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parser.py +26 -6
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/clickhouse.py +2 -2
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/prql.py +1 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/spark2.py +5 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/sqlite.py +27 -3
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/trino.py +45 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/mysql.py +1 -0
- sqlglot-30.17.0/sqlglot/typing/postgres.py +21 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0/sqlglot.egg-info}/PKG-INFO +4 -4
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.egg-info/requires.txt +3 -3
- sqlglot-30.17.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglotc/pyproject.toml +2 -2
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_clickhouse.py +5 -5
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_sqlite.py +30 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_trino.py +159 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/identity.sql +1 -1
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/annotate_functions.sql +20 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +4 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +12 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/optimize_joins.sql +9 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/pushdown_projections.sql +58 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/qualify_columns.sql +8 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +5 -5
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_executor.py +91 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_expressions.py +15 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_optimizer.py +165 -2
- sqlglot-30.16.0/sqlglot/typing/postgres.py +0 -11
- sqlglot-30.16.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.16.0 → sqlglot-30.17.0}/.gitignore +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/.gitmodules +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/.gitpod.yml +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/AGENTS.md +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/CLAUDE.md +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/LICENSE +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/MANIFEST.in +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/Makefile +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/README.md +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/pyproject.toml +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/setup.cfg +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/bigquery.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/duckdb.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/clickhouse.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/duckdb.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/postgres.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/duckdb.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/snowflake.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/time.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/tokenizer_core.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/tokens.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/bigquery.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglot.png +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_bigquery.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_dialect.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_duckdb.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_hive.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_mysql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_postgres.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_snowflake.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_spark.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/helpers.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_build.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_diff.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_docs.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_errors.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_generator.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_helper.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_parser.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_schema.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_serde.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_time.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_transpile.py +0 -0
- {sqlglot-30.16.0 → sqlglot-30.17.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,216 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.16.0] - 2026-08-10
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`32d44c5`](https://github.com/tobymao/sqlglot/commit/32d44c50d0138762c812a9326bb394eebd862464) - annotate bit_and for mysql *(PR [#8038](https://github.com/tobymao/sqlglot/pull/8038) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
7
|
+
|
|
8
|
+
annotate bit_and for mysql (#8038)
|
|
9
|
+
|
|
10
|
+
- due to [`3329bb6`](https://github.com/tobymao/sqlglot/commit/3329bb6776761a355dbc8cddcdd2a4bb1807286c) - annotate ArraySize as INT for Hive et al *(PR [#8046](https://github.com/tobymao/sqlglot/pull/8046) by [@georgesittas](https://github.com/georgesittas))*:
|
|
11
|
+
|
|
12
|
+
annotate ArraySize as INT for Hive et al (#8046)
|
|
13
|
+
|
|
14
|
+
- due to [`109eb55`](https://github.com/tobymao/sqlglot/commit/109eb55a6d57ac5f4e9e95d985107705740310e9) - annotate bit_xor, update bit_and for mysql *(PR [#8045](https://github.com/tobymao/sqlglot/pull/8045) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
15
|
+
|
|
16
|
+
annotate bit_xor, update bit_and for mysql (#8045)
|
|
17
|
+
|
|
18
|
+
- due to [`445d04f`](https://github.com/tobymao/sqlglot/commit/445d04fe7efb7c191a6bcf2c4592090c562e08ca) - annotate bit_or for mysql *(PR [#8047](https://github.com/tobymao/sqlglot/pull/8047) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
19
|
+
|
|
20
|
+
annotate bit_or for mysql (#8047)
|
|
21
|
+
|
|
22
|
+
- due to [`d4742de`](https://github.com/tobymao/sqlglot/commit/d4742deec595b8fa0a85da5339ed56e018234636) - prevent fabrication of struct-field refs for schema-less correlated columns *(PR [#8043](https://github.com/tobymao/sqlglot/pull/8043) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
23
|
+
|
|
24
|
+
prevent fabrication of struct-field refs for schema-less correlated columns (#8043)
|
|
25
|
+
|
|
26
|
+
- due to [`c0ee97f`](https://github.com/tobymao/sqlglot/commit/c0ee97f6e74f34945641a1e3e67f6ad581831e9f) - annotate jsonobjecttag for mysql *(PR [#8048](https://github.com/tobymao/sqlglot/pull/8048) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
27
|
+
|
|
28
|
+
annotate jsonobjecttag for mysql (#8048)
|
|
29
|
+
|
|
30
|
+
- due to [`00ca3ed`](https://github.com/tobymao/sqlglot/commit/00ca3ed452a5a315447ede73c75e70520dd11e68) - only qualify lateral sources in their defining scope *(PR [#8049](https://github.com/tobymao/sqlglot/pull/8049) by [@georgesittas](https://github.com/georgesittas))*:
|
|
31
|
+
|
|
32
|
+
only qualify lateral sources in their defining scope (#8049)
|
|
33
|
+
|
|
34
|
+
- due to [`cb4a821`](https://github.com/tobymao/sqlglot/commit/cb4a8214605bf038c185a6b09d2541ff39475650) - trace columns through chained (UN)PIVOT operators *(PR [#8042](https://github.com/tobymao/sqlglot/pull/8042) by [@georgesittas](https://github.com/georgesittas))*:
|
|
35
|
+
|
|
36
|
+
trace columns through chained (UN)PIVOT operators (#8042)
|
|
37
|
+
|
|
38
|
+
- due to [`9976fe1`](https://github.com/tobymao/sqlglot/commit/9976fe11ad1ac3c10029c5ef77b6717811e963cb) - annotate jsonobject for mysql *(PR [#8052](https://github.com/tobymao/sqlglot/pull/8052) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
39
|
+
|
|
40
|
+
annotate jsonobject for mysql (#8052)
|
|
41
|
+
|
|
42
|
+
- due to [`adff713`](https://github.com/tobymao/sqlglot/commit/adff713cc3512ac06baec8fd1ae7339e022a2de5) - annotate jsonextract for mysql *(PR [#8054](https://github.com/tobymao/sqlglot/pull/8054) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
43
|
+
|
|
44
|
+
annotate jsonextract for mysql (#8054)
|
|
45
|
+
|
|
46
|
+
- due to [`5724156`](https://github.com/tobymao/sqlglot/commit/57241562e74eb0034142337fbe5a47484d3f26d1) - annotate jsonkeys for mysql *(PR [#8055](https://github.com/tobymao/sqlglot/pull/8055) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
47
|
+
|
|
48
|
+
annotate jsonkeys for mysql (#8055)
|
|
49
|
+
|
|
50
|
+
- due to [`ebb9700`](https://github.com/tobymao/sqlglot/commit/ebb97000f0e7ef72b39d6c07aa61e3bb30b52464) - annotate jsontype for mysql *(PR [#8056](https://github.com/tobymao/sqlglot/pull/8056) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
51
|
+
|
|
52
|
+
annotate jsontype for mysql (#8056)
|
|
53
|
+
|
|
54
|
+
- due to [`7daf3e4`](https://github.com/tobymao/sqlglot/commit/7daf3e4213bbc7db18c491aeea06d0048be77eb1) - annotate jsonarrayappend for mysql *(PR [#8057](https://github.com/tobymao/sqlglot/pull/8057) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
55
|
+
|
|
56
|
+
annotate jsonarrayappend for mysql (#8057)
|
|
57
|
+
|
|
58
|
+
- due to [`cc6ef38`](https://github.com/tobymao/sqlglot/commit/cc6ef3815d0927ed62d1737946291dd4bc7b2e2f) - annotate jsonarrayinsert for mysql *(PR [#8058](https://github.com/tobymao/sqlglot/pull/8058) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
59
|
+
|
|
60
|
+
annotate jsonarrayinsert for mysql (#8058)
|
|
61
|
+
|
|
62
|
+
- due to [`02bc4ed`](https://github.com/tobymao/sqlglot/commit/02bc4ed0d0cf8d434b3ffed12c7b99de521e7798) - annotate jsonremove for mysql *(PR [#8059](https://github.com/tobymao/sqlglot/pull/8059) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
63
|
+
|
|
64
|
+
annotate jsonremove for mysql (#8059)
|
|
65
|
+
|
|
66
|
+
- due to [`4eedeeb`](https://github.com/tobymao/sqlglot/commit/4eedeebe2257d2322c27865dc2c2335a0e764fd8) - annotate jsonset for mysql *(PR [#8060](https://github.com/tobymao/sqlglot/pull/8060) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
67
|
+
|
|
68
|
+
annotate jsonset for mysql (#8060)
|
|
69
|
+
|
|
70
|
+
- due to [`a537f84`](https://github.com/tobymao/sqlglot/commit/a537f8424743d1e70ab1b6b90363c140c67c981e) - annotate grouping for mysql *(PR [#8062](https://github.com/tobymao/sqlglot/pull/8062) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
71
|
+
|
|
72
|
+
annotate grouping for mysql (#8062)
|
|
73
|
+
|
|
74
|
+
- due to [`4e31179`](https://github.com/tobymao/sqlglot/commit/4e31179419c860be44e3c19dea22803da4367057) - annotate uuid for mysql *(PR [#8066](https://github.com/tobymao/sqlglot/pull/8066) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
75
|
+
|
|
76
|
+
annotate uuid for mysql (#8066)
|
|
77
|
+
|
|
78
|
+
- due to [`7fa1fbd`](https://github.com/tobymao/sqlglot/commit/7fa1fbd0506b874982755a9c0d0dec22bb46f82f) - annotate ToChar return type *(PR [#8064](https://github.com/tobymao/sqlglot/pull/8064) by [@vaishnavi-polekar](https://github.com/vaishnavi-polekar))*:
|
|
79
|
+
|
|
80
|
+
annotate ToChar return type (#8064)
|
|
81
|
+
|
|
82
|
+
- due to [`30c278e`](https://github.com/tobymao/sqlglot/commit/30c278e0f0f17a185902c787bb58c6b312f73fe5) - annotate boolean binary predicates as BOOLEAN [CLAUDE] *(PR [#8069](https://github.com/tobymao/sqlglot/pull/8069) by [@DivyaNarahari97](https://github.com/DivyaNarahari97))*:
|
|
83
|
+
|
|
84
|
+
annotate boolean binary predicates as BOOLEAN [CLAUDE] (#8069)
|
|
85
|
+
|
|
86
|
+
- due to [`a9c0bea`](https://github.com/tobymao/sqlglot/commit/a9c0bea7e1cda3819458bbf21c84896df4019a3e) - annotate types for adjacent, extends left/right, overlaps *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
87
|
+
|
|
88
|
+
annotate types for adjacent, extends left/right, overlaps
|
|
89
|
+
|
|
90
|
+
- due to [`9e98d2c`](https://github.com/tobymao/sqlglot/commit/9e98d2cad7316263a54a928b3640f762f1fb6220) - annotate currentrole for mysql *(PR [#8072](https://github.com/tobymao/sqlglot/pull/8072) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
91
|
+
|
|
92
|
+
annotate currentrole for mysql (#8072)
|
|
93
|
+
|
|
94
|
+
- due to [`d94b9d5`](https://github.com/tobymao/sqlglot/commit/d94b9d50ff3280a32b5f0c14bc53b766003c2fc5) - annotate `TO_CHAR` for Spark *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
95
|
+
|
|
96
|
+
annotate `TO_CHAR` for Spark
|
|
97
|
+
|
|
98
|
+
- due to [`d6d174e`](https://github.com/tobymao/sqlglot/commit/d6d174e85e37d7644d16c0bce3e4fb49384a6bc8) - map json_extract func to ->> closes [#8076](https://github.com/tobymao/sqlglot/pull/8076) *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
99
|
+
|
|
100
|
+
map json_extract func to ->> closes #8076
|
|
101
|
+
|
|
102
|
+
- due to [`fa10c2c`](https://github.com/tobymao/sqlglot/commit/fa10c2c6460d18c17acbc10faecca9748be7a6c3) - preserve json_extract semantics instead of rewriting to -> *(PR [#8082](https://github.com/tobymao/sqlglot/pull/8082) by [@RogerHYang](https://github.com/RogerHYang))*:
|
|
103
|
+
|
|
104
|
+
preserve json_extract semantics instead of rewriting to -> (#8082)
|
|
105
|
+
|
|
106
|
+
- due to [`db7e0fc`](https://github.com/tobymao/sqlglot/commit/db7e0fc14cf9d3449b60e7dbfb9041272ab05cb1) - annotate current_role function *(PR [#8094](https://github.com/tobymao/sqlglot/pull/8094) by [@deepika-kakde](https://github.com/deepika-kakde))*:
|
|
107
|
+
|
|
108
|
+
annotate current_role function (#8094)
|
|
109
|
+
|
|
110
|
+
- due to [`c00ca98`](https://github.com/tobymao/sqlglot/commit/c00ca98d6fb0ae6968c70d6438d25a31b9f3eb4f) - annotate CurrentRole as VARCHAR *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
111
|
+
|
|
112
|
+
annotate CurrentRole as VARCHAR
|
|
113
|
+
|
|
114
|
+
- due to [`ee1658a`](https://github.com/tobymao/sqlglot/commit/ee1658ae83be59de34d278cb5c2315fec796227b) - annotate Grouping function for databricks *(PR [#8098](https://github.com/tobymao/sqlglot/pull/8098) by [@vaishnavi-polekar](https://github.com/vaishnavi-polekar))*:
|
|
115
|
+
|
|
116
|
+
annotate Grouping function for databricks (#8098)
|
|
117
|
+
|
|
118
|
+
- due to [`13e6c07`](https://github.com/tobymao/sqlglot/commit/13e6c07984e3ba8c34021ae72366a014a8f54a4e) - annotate grouping properly in the hive hierarchy *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
119
|
+
|
|
120
|
+
annotate grouping properly in the hive hierarchy
|
|
121
|
+
|
|
122
|
+
- due to [`afedce6`](https://github.com/tobymao/sqlglot/commit/afedce6180fc7bafb1de7bf2517070e53280ce1e) - annotate lead for mysql *(PR [#8090](https://github.com/tobymao/sqlglot/pull/8090) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*:
|
|
123
|
+
|
|
124
|
+
annotate lead for mysql (#8090)
|
|
125
|
+
|
|
126
|
+
- due to [`66ecca3`](https://github.com/tobymao/sqlglot/commit/66ecca33975e06fc862d3b159f8c4c1418fc04e9) - parse MODIFY COLUMN as AlterColumn *(PR [#8091](https://github.com/tobymao/sqlglot/pull/8091) by [@dgvj-work](https://github.com/dgvj-work))*:
|
|
127
|
+
|
|
128
|
+
parse MODIFY COLUMN as AlterColumn (#8091)
|
|
129
|
+
|
|
130
|
+
- due to [`f7dfbac`](https://github.com/tobymao/sqlglot/commit/f7dfbacd3b245aca169abb52f0b515230e9b6715) - classify boolean binary operators as Predicate *(PR [#8073](https://github.com/tobymao/sqlglot/pull/8073) by [@georgesittas](https://github.com/georgesittas))*:
|
|
131
|
+
|
|
132
|
+
classify boolean binary operators as Predicate (#8073)
|
|
133
|
+
|
|
134
|
+
- due to [`7810755`](https://github.com/tobymao/sqlglot/commit/7810755168e8d57d8e5f632248779ecfed782689) - move JSON extraction operators to Postgres's binary-operator precedence tier *(PR [#8063](https://github.com/tobymao/sqlglot/pull/8063) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
135
|
+
|
|
136
|
+
move JSON extraction operators to Postgres's binary-operator precedence tier (#8063)
|
|
137
|
+
|
|
138
|
+
- due to [`2f914c5`](https://github.com/tobymao/sqlglot/commit/2f914c54aa4817a0a5e65a0d7d5e7cba9037ac30) - parse ||, -> and ->> as a single tier that binds tighter than arithmetic closes [#8115](https://github.com/tobymao/sqlglot/pull/8115) *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
139
|
+
|
|
140
|
+
parse ||, -> and ->> as a single tier that binds tighter than arithmetic closes #8115
|
|
141
|
+
|
|
142
|
+
- due to [`9fc3578`](https://github.com/tobymao/sqlglot/commit/9fc35781e4eba77dd5e771608bfb027be8f8c831) - specify variable length `Func` spill arg explicitly *(PR [#8120](https://github.com/tobymao/sqlglot/pull/8120) by [@georgesittas](https://github.com/georgesittas))*:
|
|
143
|
+
|
|
144
|
+
specify variable length `Func` spill arg explicitly (#8120)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### :sparkles: New Features
|
|
148
|
+
- [`32d44c5`](https://github.com/tobymao/sqlglot/commit/32d44c50d0138762c812a9326bb394eebd862464) - **optimizer**: annotate bit_and for mysql *(PR [#8038](https://github.com/tobymao/sqlglot/pull/8038) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
149
|
+
- [`109eb55`](https://github.com/tobymao/sqlglot/commit/109eb55a6d57ac5f4e9e95d985107705740310e9) - **optimizer**: annotate bit_xor, update bit_and for mysql *(PR [#8045](https://github.com/tobymao/sqlglot/pull/8045) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
150
|
+
- [`445d04f`](https://github.com/tobymao/sqlglot/commit/445d04fe7efb7c191a6bcf2c4592090c562e08ca) - **optimizer**: annotate bit_or for mysql *(PR [#8047](https://github.com/tobymao/sqlglot/pull/8047) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
151
|
+
- [`c0ee97f`](https://github.com/tobymao/sqlglot/commit/c0ee97f6e74f34945641a1e3e67f6ad581831e9f) - **optimizer**: annotate jsonobjecttag for mysql *(PR [#8048](https://github.com/tobymao/sqlglot/pull/8048) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
152
|
+
- [`9976fe1`](https://github.com/tobymao/sqlglot/commit/9976fe11ad1ac3c10029c5ef77b6717811e963cb) - **optimizer**: annotate jsonobject for mysql *(PR [#8052](https://github.com/tobymao/sqlglot/pull/8052) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
153
|
+
- [`adff713`](https://github.com/tobymao/sqlglot/commit/adff713cc3512ac06baec8fd1ae7339e022a2de5) - **optimizer**: annotate jsonextract for mysql *(PR [#8054](https://github.com/tobymao/sqlglot/pull/8054) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
154
|
+
- [`5724156`](https://github.com/tobymao/sqlglot/commit/57241562e74eb0034142337fbe5a47484d3f26d1) - **optimizer**: annotate jsonkeys for mysql *(PR [#8055](https://github.com/tobymao/sqlglot/pull/8055) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
155
|
+
- [`ebb9700`](https://github.com/tobymao/sqlglot/commit/ebb97000f0e7ef72b39d6c07aa61e3bb30b52464) - **optimizer**: annotate jsontype for mysql *(PR [#8056](https://github.com/tobymao/sqlglot/pull/8056) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
156
|
+
- [`7daf3e4`](https://github.com/tobymao/sqlglot/commit/7daf3e4213bbc7db18c491aeea06d0048be77eb1) - **optimizer**: annotate jsonarrayappend for mysql *(PR [#8057](https://github.com/tobymao/sqlglot/pull/8057) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
157
|
+
- [`cc6ef38`](https://github.com/tobymao/sqlglot/commit/cc6ef3815d0927ed62d1737946291dd4bc7b2e2f) - **optimizer**: annotate jsonarrayinsert for mysql *(PR [#8058](https://github.com/tobymao/sqlglot/pull/8058) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
158
|
+
- [`ffa349a`](https://github.com/tobymao/sqlglot/commit/ffa349abf91a4fa0eebb25db5055a4b4b09500c8) - **trino**: parse IF/ELSEIF/ELSE routine statements [CLAUDE] *(PR [#8044](https://github.com/tobymao/sqlglot/pull/8044) by [@rusackas](https://github.com/rusackas))*
|
|
159
|
+
- [`02bc4ed`](https://github.com/tobymao/sqlglot/commit/02bc4ed0d0cf8d434b3ffed12c7b99de521e7798) - **optimizer**: annotate jsonremove for mysql *(PR [#8059](https://github.com/tobymao/sqlglot/pull/8059) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
160
|
+
- [`4eedeeb`](https://github.com/tobymao/sqlglot/commit/4eedeebe2257d2322c27865dc2c2335a0e764fd8) - **optimizer**: annotate jsonset for mysql *(PR [#8060](https://github.com/tobymao/sqlglot/pull/8060) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
161
|
+
- [`a537f84`](https://github.com/tobymao/sqlglot/commit/a537f8424743d1e70ab1b6b90363c140c67c981e) - **optimizer**: annotate grouping for mysql *(PR [#8062](https://github.com/tobymao/sqlglot/pull/8062) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
162
|
+
- [`4e31179`](https://github.com/tobymao/sqlglot/commit/4e31179419c860be44e3c19dea22803da4367057) - **optimizer**: annotate uuid for mysql *(PR [#8066](https://github.com/tobymao/sqlglot/pull/8066) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
163
|
+
- [`7fa1fbd`](https://github.com/tobymao/sqlglot/commit/7fa1fbd0506b874982755a9c0d0dec22bb46f82f) - **optimizer**: annotate ToChar return type *(PR [#8064](https://github.com/tobymao/sqlglot/pull/8064) by [@vaishnavi-polekar](https://github.com/vaishnavi-polekar))*
|
|
164
|
+
- [`a9c0bea`](https://github.com/tobymao/sqlglot/commit/a9c0bea7e1cda3819458bbf21c84896df4019a3e) - **optimizer**: annotate types for adjacent, extends left/right, overlaps *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
165
|
+
- [`9e98d2c`](https://github.com/tobymao/sqlglot/commit/9e98d2cad7316263a54a928b3640f762f1fb6220) - **optimizer**: annotate currentrole for mysql *(PR [#8072](https://github.com/tobymao/sqlglot/pull/8072) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
166
|
+
- [`d94b9d5`](https://github.com/tobymao/sqlglot/commit/d94b9d50ff3280a32b5f0c14bc53b766003c2fc5) - **optimizer**: annotate `TO_CHAR` for Spark *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
167
|
+
- [`db7e0fc`](https://github.com/tobymao/sqlglot/commit/db7e0fc14cf9d3449b60e7dbfb9041272ab05cb1) - **optimizer**: annotate current_role function *(PR [#8094](https://github.com/tobymao/sqlglot/pull/8094) by [@deepika-kakde](https://github.com/deepika-kakde))*
|
|
168
|
+
- [`c00ca98`](https://github.com/tobymao/sqlglot/commit/c00ca98d6fb0ae6968c70d6438d25a31b9f3eb4f) - **optimizer**: annotate CurrentRole as VARCHAR *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
169
|
+
- [`ee1658a`](https://github.com/tobymao/sqlglot/commit/ee1658ae83be59de34d278cb5c2315fec796227b) - **optimizer**: annotate Grouping function for databricks *(PR [#8098](https://github.com/tobymao/sqlglot/pull/8098) by [@vaishnavi-polekar](https://github.com/vaishnavi-polekar))*
|
|
170
|
+
- [`011c461`](https://github.com/tobymao/sqlglot/commit/011c461da0d432c23c84f4fbb1159ff4992ad0a1) - **trino**: parse CASE routine statements [CLAUDE] *(PR [#8068](https://github.com/tobymao/sqlglot/pull/8068) by [@rusackas](https://github.com/rusackas))*
|
|
171
|
+
- [`afedce6`](https://github.com/tobymao/sqlglot/commit/afedce6180fc7bafb1de7bf2517070e53280ce1e) - **optimizer**: annotate lead for mysql *(PR [#8090](https://github.com/tobymao/sqlglot/pull/8090) by [@PiyaDaswadkar](https://github.com/PiyaDaswadkar))*
|
|
172
|
+
- [`bbfb497`](https://github.com/tobymao/sqlglot/commit/bbfb497f16002da3cda10c927683a404a2fb694e) - **tokenizer**: add optional start/end indexes in `TokenError` *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
173
|
+
|
|
174
|
+
### :bug: Bug Fixes
|
|
175
|
+
- [`db410ab`](https://github.com/tobymao/sqlglot/commit/db410ab5ca369711c460189ed6a8566b7e37ca7c) - **optimizer**: remap GROUP BY ordinals on projection prune [GROK] *(PR [#8025](https://github.com/tobymao/sqlglot/pull/8025) by [@PriyankaDaneva](https://github.com/PriyankaDaneva))*
|
|
176
|
+
- [`3329bb6`](https://github.com/tobymao/sqlglot/commit/3329bb6776761a355dbc8cddcdd2a4bb1807286c) - **optimizer**: annotate ArraySize as INT for Hive et al *(PR [#8046](https://github.com/tobymao/sqlglot/pull/8046) by [@georgesittas](https://github.com/georgesittas))*
|
|
177
|
+
- [`d4742de`](https://github.com/tobymao/sqlglot/commit/d4742deec595b8fa0a85da5339ed56e018234636) - **optimizer**: prevent fabrication of struct-field refs for schema-less correlated columns *(PR [#8043](https://github.com/tobymao/sqlglot/pull/8043) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
178
|
+
- [`00ca3ed`](https://github.com/tobymao/sqlglot/commit/00ca3ed452a5a315447ede73c75e70520dd11e68) - **optimizer**: only qualify lateral sources in their defining scope *(PR [#8049](https://github.com/tobymao/sqlglot/pull/8049) by [@georgesittas](https://github.com/georgesittas))*
|
|
179
|
+
- [`cb4a821`](https://github.com/tobymao/sqlglot/commit/cb4a8214605bf038c185a6b09d2541ff39475650) - **lineage**: trace columns through chained (UN)PIVOT operators *(PR [#8042](https://github.com/tobymao/sqlglot/pull/8042) by [@georgesittas](https://github.com/georgesittas))*
|
|
180
|
+
- [`dedc7e3`](https://github.com/tobymao/sqlglot/commit/dedc7e3671eb180688c621c8053b7f86dc181dc6) - **optimizer**: expand qualify inner columns with QUALIFY/HAVING *(PR [#8050](https://github.com/tobymao/sqlglot/pull/8050) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
181
|
+
- [`0c19a6d`](https://github.com/tobymao/sqlglot/commit/0c19a6dab6b8259711cf91a2c70a4dc88cebd07f) - **tsql**: support nullability in ALTER COLUMN *(PR [#8053](https://github.com/tobymao/sqlglot/pull/8053) by [@sravankumarkunadi](https://github.com/sravankumarkunadi))*
|
|
182
|
+
- [`463c015`](https://github.com/tobymao/sqlglot/commit/463c015289c5098641d208265f0902e4ea6e7c43) - **optimizer**: restore FLOOR type annotation lost in ANNOTATORS refactor [CLAUDE] *(PR [#8067](https://github.com/tobymao/sqlglot/pull/8067) by [@DivyaNarahari97](https://github.com/DivyaNarahari97))*
|
|
183
|
+
- [`30c278e`](https://github.com/tobymao/sqlglot/commit/30c278e0f0f17a185902c787bb58c6b312f73fe5) - **optimizer**: annotate boolean binary predicates as BOOLEAN [CLAUDE] *(PR [#8069](https://github.com/tobymao/sqlglot/pull/8069) by [@DivyaNarahari97](https://github.com/DivyaNarahari97))*
|
|
184
|
+
- [`d6d174e`](https://github.com/tobymao/sqlglot/commit/d6d174e85e37d7644d16c0bce3e4fb49384a6bc8) - **sqlite**: map json_extract func to ->> closes [#8076](https://github.com/tobymao/sqlglot/pull/8076) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
185
|
+
- [`fa10c2c`](https://github.com/tobymao/sqlglot/commit/fa10c2c6460d18c17acbc10faecca9748be7a6c3) - **sqlite**: preserve json_extract semantics instead of rewriting to -> *(PR [#8082](https://github.com/tobymao/sqlglot/pull/8082) by [@RogerHYang](https://github.com/RogerHYang))*
|
|
186
|
+
- :arrow_lower_right: *fixes issue [#8076](https://github.com/tobymao/sqlglot/issues/8076) opened by [@RogerHYang](https://github.com/RogerHYang)*
|
|
187
|
+
- [`b4776a4`](https://github.com/tobymao/sqlglot/commit/b4776a40995985c5523849269e1ab6d29e667ec6) - **generator**: avoid materializing huge integers when capping numeric type params, closes [#8113](https://github.com/tobymao/sqlglot/pull/8113) *(commit by [@tobymao](https://github.com/tobymao))*
|
|
188
|
+
- [`df5ec1e`](https://github.com/tobymao/sqlglot/commit/df5ec1ecd43b83ac63800bf40b04362c9af0173e) - **parser**: break out of the function-property loop on a failed property, closes [#8112](https://github.com/tobymao/sqlglot/pull/8112) *(commit by [@tobymao](https://github.com/tobymao))*
|
|
189
|
+
- [`c25225d`](https://github.com/tobymao/sqlglot/commit/c25225d9ac7390ef87bd02a3d2ac005073a1e27d) - **generator**: double the delimiter in Unicode literals instead of applying string escapes, closes [#8110](https://github.com/tobymao/sqlglot/pull/8110) *(commit by [@dgvj-work](https://github.com/dgvj-work))*
|
|
190
|
+
- [`13e6c07`](https://github.com/tobymao/sqlglot/commit/13e6c07984e3ba8c34021ae72366a014a8f54a4e) - **optimizer**: annotate grouping properly in the hive hierarchy *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
191
|
+
- [`66ecca3`](https://github.com/tobymao/sqlglot/commit/66ecca33975e06fc862d3b159f8c4c1418fc04e9) - **clickhouse**: parse MODIFY COLUMN as AlterColumn *(PR [#8091](https://github.com/tobymao/sqlglot/pull/8091) by [@dgvj-work](https://github.com/dgvj-work))*
|
|
192
|
+
- :arrow_lower_right: *fixes issue [#8019](https://github.com/tobymao/sqlglot/issues/8019) opened by [@dgvj-work](https://github.com/dgvj-work)*
|
|
193
|
+
- [`f7dfbac`](https://github.com/tobymao/sqlglot/commit/f7dfbacd3b245aca169abb52f0b515230e9b6715) - **expressions**: classify boolean binary operators as Predicate *(PR [#8073](https://github.com/tobymao/sqlglot/pull/8073) by [@georgesittas](https://github.com/georgesittas))*
|
|
194
|
+
- [`617989c`](https://github.com/tobymao/sqlglot/commit/617989c38ea251b0aca35e2ffe205db96b856797) - **clickhouse**: clean up MODIFY COLUMN handling *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
195
|
+
- [`f15c499`](https://github.com/tobymao/sqlglot/commit/f15c499771c44e2800338c15974c5618d5403cc7) - **optimizer**: keep parens around a predicate under bitwise NOT *(PR [#8119](https://github.com/tobymao/sqlglot/pull/8119) by [@georgesittas](https://github.com/georgesittas))*
|
|
196
|
+
- [`7810755`](https://github.com/tobymao/sqlglot/commit/7810755168e8d57d8e5f632248779ecfed782689) - **parser**: move JSON extraction operators to Postgres's binary-operator precedence tier *(PR [#8063](https://github.com/tobymao/sqlglot/pull/8063) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
197
|
+
- :arrow_lower_right: *fixes issue [#8035](https://github.com/tobymao/sqlglot/issues/8035) opened by [@RogerHYang](https://github.com/RogerHYang)*
|
|
198
|
+
- [`2f914c5`](https://github.com/tobymao/sqlglot/commit/2f914c54aa4817a0a5e65a0d7d5e7cba9037ac30) - **sqlite**: parse ||, -> and ->> as a single tier that binds tighter than arithmetic closes [#8115](https://github.com/tobymao/sqlglot/pull/8115) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
199
|
+
|
|
200
|
+
### :recycle: Refactors
|
|
201
|
+
- [`381f49c`](https://github.com/tobymao/sqlglot/commit/381f49c2cd38563f283309c39bf8810127328e27) - **trino**: parse inline UDF `IF` branches iteraitvely *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
202
|
+
- [`eb7e248`](https://github.com/tobymao/sqlglot/commit/eb7e24829320163bcd2f4aa8823c75ce6c102934) - clean up redundant type annotations *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
203
|
+
- [`9fc3578`](https://github.com/tobymao/sqlglot/commit/9fc35781e4eba77dd5e771608bfb027be8f8c831) - **expressions**: specify variable length `Func` spill arg explicitly *(PR [#8120](https://github.com/tobymao/sqlglot/pull/8120) by [@georgesittas](https://github.com/georgesittas))*
|
|
204
|
+
|
|
205
|
+
### :white_check_mark: Tests
|
|
206
|
+
- [`5258f24`](https://github.com/tobymao/sqlglot/commit/5258f24934a0f68cb42c6698db6e4992eedeb1c9) - **sqlite**: cover root, non-literal and subscript paths for json_extract *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
207
|
+
|
|
208
|
+
### :wrench: Chores
|
|
209
|
+
- [`c164cce`](https://github.com/tobymao/sqlglot/commit/c164cce9341eae08dcf3d4a43fc53e49fb69d59e) - default UNKNOWN for mysql BIT_AND *(commit by [@geooo109](https://github.com/geooo109))*
|
|
210
|
+
- [`515083c`](https://github.com/tobymao/sqlglot/commit/515083ca63a4bc6a85549a10e1c5651215d9a01f) - don't leak `decimal.InvalidOperation` on bad inputs *(PR [#8117](https://github.com/tobymao/sqlglot/pull/8117) by [@eeshsaxena](https://github.com/eeshsaxena))*
|
|
211
|
+
- [`e36ba73`](https://github.com/tobymao/sqlglot/commit/e36ba73f651c9a82fbe831195fa7883799d0ddb0) - improve type hints to facilitate better mypyc compilation *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
212
|
+
|
|
213
|
+
|
|
4
214
|
## [v30.14.0] - 2026-07-27
|
|
5
215
|
### :boom: BREAKING CHANGES
|
|
6
216
|
- due to [`a715f9f`](https://github.com/tobymao/sqlglot/commit/a715f9f9aa1ba640f558c7602af9a63fc35d8697) - type annotation for databricks NANVL, SIGN, SHIFTLEFT, SIGNUM, SHUFFLE *(PR [#7896](https://github.com/tobymao/sqlglot/pull/7896) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
@@ -15186,3 +15396,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
15186
15396
|
[v30.12.0]: https://github.com/tobymao/sqlglot/compare/v30.11.0...v30.12.0
|
|
15187
15397
|
[v30.13.0]: https://github.com/tobymao/sqlglot/compare/v30.12.0...v30.13.0
|
|
15188
15398
|
[v30.14.0]: https://github.com/tobymao/sqlglot/compare/v30.13.0...v30.14.0
|
|
15399
|
+
[v30.16.0]: https://github.com/tobymao/sqlglot/compare/v30.15.0...v30.16.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.17.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
|
|
@@ -19,7 +19,7 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Provides-Extra: dev
|
|
21
21
|
Requires-Dist: duckdb>=0.6; extra == "dev"
|
|
22
|
-
Requires-Dist: sqlglot-mypy>=2.
|
|
22
|
+
Requires-Dist: sqlglot-mypy>=2.3.0.post1; python_version >= "3.10" and extra == "dev"
|
|
23
23
|
Requires-Dist: mypy; python_version < "3.10" and extra == "dev"
|
|
24
24
|
Requires-Dist: setuptools_scm; extra == "dev"
|
|
25
25
|
Requires-Dist: pandas; 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.17.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.17.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -9,7 +9,7 @@ setup(
|
|
|
9
9
|
"duckdb>=0.6",
|
|
10
10
|
# sqlglot-mypy 1.20+ is the build dep for sqlglotc and only ships
|
|
11
11
|
# for py3.10+; on py3.9 just use upstream mypy for type checking.
|
|
12
|
-
"sqlglot-mypy >= 2.
|
|
12
|
+
"sqlglot-mypy >= 2.3.0.post1; python_version >= '3.10'",
|
|
13
13
|
"mypy; python_version < '3.10'",
|
|
14
14
|
"setuptools_scm",
|
|
15
15
|
"pandas",
|
|
@@ -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.17.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 17, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g9a8129b6f'
|
|
@@ -185,6 +185,12 @@ def ordered(this, desc, nulls_first):
|
|
|
185
185
|
return this
|
|
186
186
|
|
|
187
187
|
|
|
188
|
+
def _like(this, e, flags=0):
|
|
189
|
+
return bool(
|
|
190
|
+
re.fullmatch(re.escape(e).replace("_", ".").replace("%", ".*"), this, re.DOTALL | flags)
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
|
|
188
194
|
@null_if_any
|
|
189
195
|
def interval(this, unit):
|
|
190
196
|
plural = unit + "S"
|
|
@@ -255,9 +261,9 @@ ENV = {
|
|
|
255
261
|
"INTERVAL": interval,
|
|
256
262
|
"JSONEXTRACT": jsonextract,
|
|
257
263
|
"LEFT": null_if_any(lambda this, e: this[:e]),
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
),
|
|
264
|
+
"LENGTH": null_if_any(len),
|
|
265
|
+
"LIKE": null_if_any(lambda this, e: _like(this, e)),
|
|
266
|
+
"ILIKE": null_if_any(lambda this, e: _like(this, e, re.IGNORECASE)),
|
|
261
267
|
"LOWER": null_if_any(lambda arg: arg.lower()),
|
|
262
268
|
"LT": null_if_any(lambda this, e: this < e),
|
|
263
269
|
"LTE": null_if_any(lambda this, e: this <= e),
|
|
@@ -1699,7 +1699,16 @@ class AggFunc(Func):
|
|
|
1699
1699
|
|
|
1700
1700
|
|
|
1701
1701
|
class Column(Expression, Condition):
|
|
1702
|
-
|
|
1702
|
+
# "shadow" marks a column whose qualifier is shadowed by a projection alias, so it must be
|
|
1703
|
+
# rendered unqualified in dialects where PROJECTION_ALIASES_SHADOW_SOURCE_NAMES is set
|
|
1704
|
+
arg_types = {
|
|
1705
|
+
"this": True,
|
|
1706
|
+
"table": False,
|
|
1707
|
+
"db": False,
|
|
1708
|
+
"catalog": False,
|
|
1709
|
+
"join_mark": False,
|
|
1710
|
+
"shadow": False,
|
|
1711
|
+
}
|
|
1703
1712
|
|
|
1704
1713
|
@property
|
|
1705
1714
|
def table(self) -> str:
|
|
@@ -1050,6 +1050,11 @@ class SetOperation(Expression, Query):
|
|
|
1050
1050
|
def named_selects(self) -> list[str]:
|
|
1051
1051
|
expr: Expr = self
|
|
1052
1052
|
while isinstance(expr, SetOperation):
|
|
1053
|
+
if expr.args.get("by_name"):
|
|
1054
|
+
left = t.cast(Selectable, expr.this.unnest()).named_selects
|
|
1055
|
+
right = t.cast(Selectable, expr.expression.unnest()).named_selects
|
|
1056
|
+
return list(dict.fromkeys(left + right))
|
|
1057
|
+
|
|
1053
1058
|
expr = expr.this.unnest()
|
|
1054
1059
|
return _named_selects(expr)
|
|
1055
1060
|
|
|
@@ -2124,7 +2129,23 @@ class CaseStatement(Expression):
|
|
|
2124
2129
|
|
|
2125
2130
|
|
|
2126
2131
|
class WhileBlock(Expression):
|
|
2127
|
-
arg_types = {"this": True, "body": True}
|
|
2132
|
+
arg_types = {"this": True, "body": True, "label": False}
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
class LoopBlock(Expression):
|
|
2136
|
+
arg_types = {"body": True, "label": False}
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
class RepeatBlock(Expression):
|
|
2140
|
+
arg_types = {"body": True, "until": True, "label": False}
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
class Leave(Expression):
|
|
2144
|
+
pass
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
class Iterate(Expression):
|
|
2148
|
+
pass
|
|
2128
2149
|
|
|
2129
2150
|
|
|
2130
2151
|
class EndStatement(Expression):
|
|
@@ -1151,6 +1151,10 @@ class Generator:
|
|
|
1151
1151
|
return f"{default}CHARACTER SET={self.sql(expression, 'this')}"
|
|
1152
1152
|
|
|
1153
1153
|
def column_parts(self, expression: exp.Column) -> str:
|
|
1154
|
+
if expression.args.get("shadow") and self.dialect.PROJECTION_ALIASES_SHADOW_SOURCE_NAMES:
|
|
1155
|
+
# The qualifier would be captured by a colliding projection alias (see qualify_columns)
|
|
1156
|
+
return self.sql(expression, "this")
|
|
1157
|
+
|
|
1154
1158
|
return ".".join(
|
|
1155
1159
|
self.sql(part)
|
|
1156
1160
|
for part in (
|
|
@@ -6319,6 +6323,22 @@ class Generator:
|
|
|
6319
6323
|
self.unsupported("Unsupported While block syntax")
|
|
6320
6324
|
return ""
|
|
6321
6325
|
|
|
6326
|
+
def loopblock_sql(self, expression: exp.LoopBlock) -> str:
|
|
6327
|
+
self.unsupported("Unsupported Loop block syntax")
|
|
6328
|
+
return ""
|
|
6329
|
+
|
|
6330
|
+
def repeatblock_sql(self, expression: exp.RepeatBlock) -> str:
|
|
6331
|
+
self.unsupported("Unsupported Repeat block syntax")
|
|
6332
|
+
return ""
|
|
6333
|
+
|
|
6334
|
+
def leave_sql(self, expression: exp.Leave) -> str:
|
|
6335
|
+
self.unsupported("Unsupported Leave syntax")
|
|
6336
|
+
return ""
|
|
6337
|
+
|
|
6338
|
+
def iterate_sql(self, expression: exp.Iterate) -> str:
|
|
6339
|
+
self.unsupported("Unsupported Iterate syntax")
|
|
6340
|
+
return ""
|
|
6341
|
+
|
|
6322
6342
|
def execute_sql(self, expression: exp.Execute) -> str:
|
|
6323
6343
|
self.unsupported("Unsupported Execute syntax")
|
|
6324
6344
|
return ""
|
|
@@ -58,6 +58,15 @@ def _lambda_sql(self, e: exp.Lambda) -> str:
|
|
|
58
58
|
return f"lambda {self.expressions(e, flat=True)}: {self.sql(e, 'this')}"
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
def _like_sql(self: generator.Generator, e: exp.Like | exp.ILike) -> str:
|
|
62
|
+
sql = self.func(e.key, e.this, e.expression)
|
|
63
|
+
|
|
64
|
+
if e.args.get("negate"):
|
|
65
|
+
sql = f"NOT({sql})"
|
|
66
|
+
|
|
67
|
+
return sql
|
|
68
|
+
|
|
69
|
+
|
|
61
70
|
def _div_sql(self: generator.Generator, e: exp.Div) -> str:
|
|
62
71
|
denominator = self.sql(e, "expression")
|
|
63
72
|
|
|
@@ -66,7 +75,9 @@ def _div_sql(self: generator.Generator, e: exp.Div) -> str:
|
|
|
66
75
|
|
|
67
76
|
sql = f"DIV({self.sql(e, 'this')}, {denominator})"
|
|
68
77
|
|
|
69
|
-
if e.args.get("typed")
|
|
78
|
+
if e.args.get("typed") and not (
|
|
79
|
+
e.this.is_type(*exp.DataType.REAL_TYPES) or e.expression.is_type(*exp.DataType.REAL_TYPES)
|
|
80
|
+
):
|
|
70
81
|
sql = f"int({sql})"
|
|
71
82
|
|
|
72
83
|
return sql
|
|
@@ -90,6 +101,7 @@ class PythonGenerator(generator.Generator):
|
|
|
90
101
|
exp.Distinct: lambda self, e: f"set({self.sql(e, 'this')})",
|
|
91
102
|
exp.Div: _div_sql,
|
|
92
103
|
exp.Extract: lambda self, e: f"EXTRACT('{e.name.lower()}', {self.sql(e, 'expression')})",
|
|
104
|
+
exp.ILike: _like_sql,
|
|
93
105
|
exp.In: lambda self, e: self.func("IN", e.this, *e.expressions),
|
|
94
106
|
exp.Interval: lambda self, e: f"INTERVAL({self.sql(e.this)}, '{self.sql(e.unit)}')",
|
|
95
107
|
exp.Is: lambda self, e: (
|
|
@@ -102,6 +114,7 @@ class PythonGenerator(generator.Generator):
|
|
|
102
114
|
exp.JSONPathKey: lambda self, e: f"'{self.sql(e.this)}'",
|
|
103
115
|
exp.JSONPathSubscript: lambda self, e: f"'{e.this}'",
|
|
104
116
|
exp.Lambda: _lambda_sql,
|
|
117
|
+
exp.Like: _like_sql,
|
|
105
118
|
exp.Not: lambda self, e: self.func("NOT", e.this),
|
|
106
119
|
exp.Null: lambda *_: "None",
|
|
107
120
|
exp.Or: lambda self, e: f"OR(lambda: {self.sql(e.left)}, lambda: {self.sql(e.right)})",
|
|
@@ -69,7 +69,9 @@ def _generated_to_auto_increment(expression: exp.Expr) -> exp.Expr:
|
|
|
69
69
|
|
|
70
70
|
generated = expression.find(exp.GeneratedAsIdentityColumnConstraint)
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
# Only rewrite true identity columns. Expression-bearing forms are computed
|
|
73
|
+
# columns (GENERATED ALWAYS AS (expr)) and must keep their expression.
|
|
74
|
+
if generated and generated.expression is None:
|
|
73
75
|
t.cast(exp.ColumnConstraint, generated.parent).pop()
|
|
74
76
|
|
|
75
77
|
not_null = expression.find(exp.NotNullColumnConstraint)
|
|
@@ -253,6 +255,19 @@ class SQLiteGenerator(generator.Generator):
|
|
|
253
255
|
|
|
254
256
|
return super().cast_sql(expression)
|
|
255
257
|
|
|
258
|
+
# https://www.sqlite.org/gencol.html
|
|
259
|
+
# Inline unsupported check: mypyc cannot compile @unsupported_args on an
|
|
260
|
+
# override of an undecorated base-class method.
|
|
261
|
+
def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
|
|
262
|
+
if expression.args.get("data_type"):
|
|
263
|
+
self.unsupported("SQLite generated columns do not support a data type")
|
|
264
|
+
|
|
265
|
+
this = expression.this
|
|
266
|
+
this_sql = self.sql(this) if isinstance(this, exp.Paren) else f"({self.sql(this)})"
|
|
267
|
+
storage = " STORED" if expression.args.get("persisted") else ""
|
|
268
|
+
not_null = " NOT NULL" if expression.args.get("not_null") else ""
|
|
269
|
+
return f"AS {this_sql}{storage}{not_null}"
|
|
270
|
+
|
|
256
271
|
# Note: SQLite's TRUNC always returns REAL (e.g., trunc(10.99) -> 10.0), not INTEGER.
|
|
257
272
|
# This creates a transpilation gap affecting division semantics, similar to Presto.
|
|
258
273
|
# Unlike Presto where this only affects decimals=0, SQLite has no decimals parameter
|
|
@@ -98,6 +98,32 @@ class TrinoGenerator(PrestoGenerator):
|
|
|
98
98
|
branches.append("END CASE")
|
|
99
99
|
return " ".join(branches)
|
|
100
100
|
|
|
101
|
+
def whileblock_sql(self, expression: exp.WhileBlock) -> str:
|
|
102
|
+
label = expression.args.get("label")
|
|
103
|
+
label_sql = f"{self.sql(label)}: " if label else ""
|
|
104
|
+
condition = self.sql(expression, "this")
|
|
105
|
+
body = self.sql(expression, "body")
|
|
106
|
+
return f"{label_sql}WHILE {condition} DO {body}; END WHILE"
|
|
107
|
+
|
|
108
|
+
def loopblock_sql(self, expression: exp.LoopBlock) -> str:
|
|
109
|
+
label = expression.args.get("label")
|
|
110
|
+
label_sql = f"{self.sql(label)}: " if label else ""
|
|
111
|
+
body = self.sql(expression, "body")
|
|
112
|
+
return f"{label_sql}LOOP {body}; END LOOP"
|
|
113
|
+
|
|
114
|
+
def repeatblock_sql(self, expression: exp.RepeatBlock) -> str:
|
|
115
|
+
label = expression.args.get("label")
|
|
116
|
+
label_sql = f"{self.sql(label)}: " if label else ""
|
|
117
|
+
body = self.sql(expression, "body")
|
|
118
|
+
until = self.sql(expression, "until")
|
|
119
|
+
return f"{label_sql}REPEAT {body}; UNTIL {until} END REPEAT"
|
|
120
|
+
|
|
121
|
+
def leave_sql(self, expression: exp.Leave) -> str:
|
|
122
|
+
return f"LEAVE {self.sql(expression, 'this')}"
|
|
123
|
+
|
|
124
|
+
def iterate_sql(self, expression: exp.Iterate) -> str:
|
|
125
|
+
return f"ITERATE {self.sql(expression, 'this')}"
|
|
126
|
+
|
|
101
127
|
def jsonextract_sql(self, expression: exp.JSONExtract) -> str:
|
|
102
128
|
if not expression.args.get("json_query"):
|
|
103
129
|
return super().jsonextract_sql(expression)
|
|
@@ -385,8 +385,9 @@ class TypeAnnotator:
|
|
|
385
385
|
|
|
386
386
|
return {alias: column.type for alias, column in zip(alias_column_names, values)}
|
|
387
387
|
|
|
388
|
-
if isinstance(expression, exp.SetOperation) and
|
|
389
|
-
expression.
|
|
388
|
+
if isinstance(expression, exp.SetOperation) and (
|
|
389
|
+
expression.args.get("by_name")
|
|
390
|
+
or len(expression.this.selects) == len(expression.expression.selects)
|
|
390
391
|
):
|
|
391
392
|
return self._get_setop_column_types(expression)
|
|
392
393
|
|
|
@@ -522,7 +523,13 @@ class TypeAnnotator:
|
|
|
522
523
|
i = iter(dot_parts)
|
|
523
524
|
parent = expr.parent
|
|
524
525
|
while isinstance(parent, exp.Dot):
|
|
525
|
-
parent.expression
|
|
526
|
+
identifier = parent.expression
|
|
527
|
+
if isinstance(identifier, exp.Identifier):
|
|
528
|
+
# Rename in place to preserve the identifier's meta, e.g. token positions
|
|
529
|
+
identifier.set("this", next(i))
|
|
530
|
+
identifier.set("quoted", True)
|
|
531
|
+
else:
|
|
532
|
+
identifier.replace(exp.to_identifier(next(i), quoted=True))
|
|
526
533
|
parent = parent.parent
|
|
527
534
|
|
|
528
535
|
expr.meta.pop("dot_parts", None)
|
|
@@ -633,12 +640,16 @@ class TypeAnnotator:
|
|
|
633
640
|
|
|
634
641
|
col_types: dict[str, exp.DataType | exp.DType] = {}
|
|
635
642
|
|
|
636
|
-
# Validate that left and right have same number of projections
|
|
643
|
+
# Validate that left and right have same number of projections (BY NAME
|
|
644
|
+
# operations match columns by name, so their counts are allowed to differ)
|
|
637
645
|
if not (
|
|
638
646
|
isinstance(setop, exp.SetOperation)
|
|
639
647
|
and setop.this.selects
|
|
640
648
|
and setop.expression.selects
|
|
641
|
-
and
|
|
649
|
+
and (
|
|
650
|
+
setop.args.get("by_name")
|
|
651
|
+
or len(setop.this.selects) == len(setop.expression.selects)
|
|
652
|
+
)
|
|
642
653
|
):
|
|
643
654
|
return col_types
|
|
644
655
|
|
|
@@ -650,14 +661,18 @@ class TypeAnnotator:
|
|
|
650
661
|
continue
|
|
651
662
|
|
|
652
663
|
if set_op.args.get("by_name"):
|
|
664
|
+
# Columns missing from one side are filled with NULLs, so the other
|
|
665
|
+
# side's type is preserved (NULL is the identity for _maybe_coerce)
|
|
653
666
|
r_type_by_select = {s.alias_or_name: s.type for s in set_op.expression.selects}
|
|
654
667
|
setop_cols = {
|
|
655
668
|
s.alias_or_name: self._maybe_coerce(
|
|
656
669
|
t.cast(exp.DataType, s.type),
|
|
657
|
-
r_type_by_select.
|
|
670
|
+
r_type_by_select.pop(s.alias_or_name, exp.DType.NULL) or exp.DType.UNKNOWN,
|
|
658
671
|
)
|
|
659
672
|
for s in set_op.this.selects
|
|
660
673
|
}
|
|
674
|
+
for name, r_type in r_type_by_select.items():
|
|
675
|
+
setop_cols[name] = r_type or exp.DType.UNKNOWN
|
|
661
676
|
else:
|
|
662
677
|
setop_cols = {
|
|
663
678
|
ls.alias_or_name: self._maybe_coerce(
|
|
@@ -30,11 +30,13 @@ def canonicalize_internal_names(expression: E) -> E:
|
|
|
30
30
|
>>> canonicalize_internal_names(qualify(sqlglot.parse_one("WITH t AS (SELECT c1, c2 FROM c.db.src) SELECT * FROM t"), schema=schema)).sql()
|
|
31
31
|
'WITH "_t1" AS (SELECT "_t0"."c1" AS "_c0", "_t0"."c2" AS "_c1" FROM "c"."db"."src" AS "_t0") SELECT "_t1"."_c0" AS "c1", "_t1"."_c1" AS "c2" FROM "_t1" AS "_t1"'
|
|
32
32
|
"""
|
|
33
|
+
# Skip non-queries for now (e.g., UPDATE ... SET x = s.x FROM (SELECT ...) AS s)
|
|
34
|
+
if not isinstance(expression, exp.Query):
|
|
35
|
+
return expression
|
|
33
36
|
|
|
34
|
-
# Top-level output scopes: their aliases are the query's data contract.
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
# contribute.
|
|
37
|
+
# Top-level output scopes: their aliases are the query's data contract. Regular UNION takes names
|
|
38
|
+
# from the left branch; UNION BY NAME takes names from the union of all branches, so both sides of
|
|
39
|
+
# a by_name SetOperation contribute.
|
|
38
40
|
output_scope_exprs: set[int] = set()
|
|
39
41
|
stack: list[exp.Expr] = [expression]
|
|
40
42
|
while stack:
|
|
@@ -103,6 +103,11 @@ def eliminate_subqueries(expression: E) -> E:
|
|
|
103
103
|
|
|
104
104
|
if new_ctes:
|
|
105
105
|
query = expression.expression if isinstance(expression, exp.DDL) else expression
|
|
106
|
+
if not isinstance(query, exp.Query):
|
|
107
|
+
# This can be reached for DMLs, which shouldn't hold the WITH clause; attach it to
|
|
108
|
+
# the root query, which is also where any pre-existing CTEs in `new_ctes` came from
|
|
109
|
+
query = root.expression.unnest()
|
|
110
|
+
|
|
106
111
|
query.set("with_", exp.With(expressions=new_ctes, recursive=recursive))
|
|
107
112
|
|
|
108
113
|
return expression
|
|
@@ -131,7 +136,9 @@ def _eliminate_derived_table(
|
|
|
131
136
|
return None
|
|
132
137
|
|
|
133
138
|
expr_parent = scope.expression.parent
|
|
134
|
-
if not isinstance(expr_parent, exp.Subquery):
|
|
139
|
+
if not isinstance(expr_parent, exp.Subquery) or expr_parent is parent_scope.expression:
|
|
140
|
+
# In the latter case the wrapper is the parent scope's root, e.g., the FROM clause
|
|
141
|
+
# of a DML statement or a parenthesized DDL source, not one of its derived tables
|
|
135
142
|
return None
|
|
136
143
|
|
|
137
144
|
# Get rid of redundant exp.Subquery expressions, i.e. those that are just used as wrappers
|