sqlglot 30.30.0__tar.gz → 30.31.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.30.0 → sqlglot-30.31.0}/CHANGELOG.md +44 -0
- {sqlglot-30.30.0/sqlglot.egg-info → sqlglot-30.31.0}/PKG-INFO +3 -3
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/bigquery.py +1 -32
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/dialect.py +107 -33
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/doris.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/duckdb.py +17 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/fabric.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/hive.py +5 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/mysql.py +6 -3
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/postgres.py +8 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/presto.py +6 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/singlestore.py +7 -3
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/snowflake.py +5 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/spark.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/spark2.py +7 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/sqlite.py +8 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/starrocks.py +5 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/teradata.py +5 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/tsql.py +6 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/core.py +23 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/properties.py +4 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generator.py +28 -9
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/bigquery.py +1 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/clickhouse.py +13 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/druid.py +2 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/duckdb.py +6 -4
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/exasol.py +2 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/oracle.py +2 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/postgres.py +7 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/redshift.py +7 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/spark2.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/sqlite.py +29 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/teradata.py +10 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify_columns.py +83 -15
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/resolver.py +46 -10
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/simplify.py +15 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parser.py +37 -23
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/presto.py +8 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/spark.py +5 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/sqlite.py +8 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/teradata.py +56 -12
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/schema.py +4 -2
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/tokens.py +2 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/__init__.py +9 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/bigquery.py +30 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/snowflake.py +1 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.egg-info/requires.txt +2 -2
- sqlglot-30.31.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_bigquery.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_clickhouse.py +26 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_databricks.py +12 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_dialect.py +50 -5
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_hive.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_mysql.py +33 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_oracle.py +13 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_postgres.py +31 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_presto.py +38 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_redshift.py +21 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_snowflake.py +10 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_spark.py +7 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_sqlite.py +106 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_teradata.py +129 -1
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/identity.sql +1 -5
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/normalize_identifiers.sql +9 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns.sql +203 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/simplify.sql +33 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_generator.py +17 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_lineage.py +10 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_optimizer.py +136 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_schema.py +11 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_transpile.py +3 -0
- sqlglot-30.30.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.30.0 → sqlglot-30.31.0}/.gitignore +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/.gitmodules +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/.gitpod.yml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/AGENTS.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/CLAUDE.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/LICENSE +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/MANIFEST.in +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/Makefile +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/README.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/pyproject.toml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/setup.cfg +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/setup.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/query.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/clickhouse.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/duckdb.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/snowflake.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/spark2.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/time.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/tokenizer_core.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglot.png +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_duckdb.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/helpers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_build.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_diff.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_docs.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_errors.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_executor.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_helper.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_parser.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_serde.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_time.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.31.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.30.0] - 2026-11-06
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`2609055`](https://github.com/tobymao/sqlglot/commit/26090558386544da0932d78945c24ca97e303e31) - respect input column precedence in HAVING and QUALIFY *(PR [#8898](https://github.com/tobymao/sqlglot/pull/8898) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
respect input column precedence in HAVING and QUALIFY (#8898)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### :sparkles: New Features
|
|
12
|
+
- [`11bb075`](https://github.com/tobymao/sqlglot/commit/11bb0753404272d35dd82656cdaaf632713f0df6) - **Snowflake**: Fix snowflake TO_CHAR type and update integration tests *(PR [#8900](https://github.com/tobymao/sqlglot/pull/8900) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
13
|
+
- [`5574695`](https://github.com/tobymao/sqlglot/commit/55746950bc05108548b9f3029ebe66fb3ac3903b) - **Bigquery**: Add fix for BQ UNNEST offset type *(PR [#8911](https://github.com/tobymao/sqlglot/pull/8911) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
14
|
+
- [`70315ab`](https://github.com/tobymao/sqlglot/commit/70315ab81b2c3d14f0e14e6abfb81ca47731e070) - **snowflake**: support ignore grants *(PR [#8917](https://github.com/tobymao/sqlglot/pull/8917) by [@asarama](https://github.com/asarama))*
|
|
15
|
+
- :arrow_lower_right: *addresses issue [#8916](https://github.com/tobymao/sqlglot/issues/8916) opened by [@asarama](https://github.com/asarama)*
|
|
16
|
+
|
|
17
|
+
### :bug: Bug Fixes
|
|
18
|
+
- [`bd21922`](https://github.com/tobymao/sqlglot/commit/bd219221d26d01c962a99c64bf20f52317d07e80) - **optimizer**: do not hoist subqueries across anonymous function boundaries *(PR [#8884](https://github.com/tobymao/sqlglot/pull/8884) by [@treysp](https://github.com/treysp))*
|
|
19
|
+
- [`20a6349`](https://github.com/tobymao/sqlglot/commit/20a6349f8122fecc98e388e762f8f364d7bfddb7) - **optimizer**: preserve subqueries with anonymous aggregates in query clauses *(PR [#8894](https://github.com/tobymao/sqlglot/pull/8894) by [@georgesittas](https://github.com/georgesittas))*
|
|
20
|
+
- [`87db60b`](https://github.com/tobymao/sqlglot/commit/87db60bfed0b67e1e1cb28fea5568cddc76042d9) - **optimizer**: preserve outer aliases in BY NAME set operations *(commit by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
21
|
+
- [`38fe7c9`](https://github.com/tobymao/sqlglot/commit/38fe7c90bb35c35321037fa4a8df09b4625aa611) - **optimizer**: preserve USING columns on qualified star expansion *(PR [#8893](https://github.com/tobymao/sqlglot/pull/8893) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
|
|
22
|
+
- :arrow_lower_right: *fixes issue [#8890](https://github.com/tobymao/sqlglot/issues/8890) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
23
|
+
- [`0b07964`](https://github.com/tobymao/sqlglot/commit/0b0796435cc284c47e48e87c9c11433f440aef35) - **duckdb**: only treat `_` between two digits as a digit separator [DEEPSEEK] *(PR [#8892](https://github.com/tobymao/sqlglot/pull/8892) by [@inchang-ing](https://github.com/inchang-ing))*
|
|
24
|
+
- :arrow_lower_right: *fixes issue [#8889](https://github.com/tobymao/sqlglot/issues/8889) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
25
|
+
- [`987ce0a`](https://github.com/tobymao/sqlglot/commit/987ce0a8e3f65ce41296dd65433eceab386e350a) - **optimizer**: skip predicate pushdown for set-returning functions *(PR [#8885](https://github.com/tobymao/sqlglot/pull/8885) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
26
|
+
- [`2663e6b`](https://github.com/tobymao/sqlglot/commit/2663e6b3d37a0dec2c7a92b977a8b45d7961eac0) - **optimizer**: Fix pushdown predicates for scalar aggregates *(PR [#8886](https://github.com/tobymao/sqlglot/pull/8886) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
27
|
+
- [`63065da`](https://github.com/tobymao/sqlglot/commit/63065dac2a204ca6b2b4a70ac7ef76b91804a8fc) - **optimizer**: preserve aggregation when pushing predicates into queries with HAVING, ORDER BY *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
28
|
+
- [`3c90c25`](https://github.com/tobymao/sqlglot/commit/3c90c25c06e12070bac56eafb02d44d4bf546cb3) - **duckdb**: distinguish top-n min and max aggregates *(PR [#8896](https://github.com/tobymao/sqlglot/pull/8896) by [@georgesittas](https://github.com/georgesittas))*
|
|
29
|
+
- :arrow_lower_right: *fixes issue [#8888](https://github.com/tobymao/sqlglot/issues/8888) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
30
|
+
- [`8604b18`](https://github.com/tobymao/sqlglot/commit/8604b1832612bf2ff3fc8ef359043bc61306fb3a) - **parser**: support TABLE query shorthand *(PR [#8897](https://github.com/tobymao/sqlglot/pull/8897) by [@georgesittas](https://github.com/georgesittas))*
|
|
31
|
+
- :arrow_lower_right: *fixes issue [#8891](https://github.com/tobymao/sqlglot/issues/8891) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
32
|
+
- [`2609055`](https://github.com/tobymao/sqlglot/commit/26090558386544da0932d78945c24ca97e303e31) - **optimizer**: respect input column precedence in HAVING and QUALIFY *(PR [#8898](https://github.com/tobymao/sqlglot/pull/8898) by [@georgesittas](https://github.com/georgesittas))*
|
|
33
|
+
- :arrow_lower_right: *fixes issue [#8887](https://github.com/tobymao/sqlglot/issues/8887) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
34
|
+
- [`d1a3ab0`](https://github.com/tobymao/sqlglot/commit/d1a3ab0430e0373d614db901ed99d543ea27b6e2) - **optimizer**: avoid quadratic table resolution in pushdown_dnf ([#8906](https://github.com/tobymao/sqlglot/pull/8906)) *(PR [#8908](https://github.com/tobymao/sqlglot/pull/8908) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
|
|
35
|
+
- :arrow_lower_right: *fixes issue [#8906](https://github.com/tobymao/sqlglot/issues/8906) opened by [@sebastianbreguel](https://github.com/sebastianbreguel)*
|
|
36
|
+
- [`8a0b36a`](https://github.com/tobymao/sqlglot/commit/8a0b36a1229d40e67b42f2c4627bca5306077c02) - **databricks**: drop timestamp precision Databricks doesn't support [CLAUDE] *(PR [#8905](https://github.com/tobymao/sqlglot/pull/8905) by [@ksaiharshavinay](https://github.com/ksaiharshavinay))*
|
|
37
|
+
- :arrow_lower_right: *fixes issue [#8903](https://github.com/tobymao/sqlglot/issues/8903) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
38
|
+
- [`b33976b`](https://github.com/tobymao/sqlglot/commit/b33976b6d5395044dc521ed7efcaba8325cb8c77) - **duckdb**: align Snowflake TIME_SLICE transpilation to epoch origin *(PR [#8899](https://github.com/tobymao/sqlglot/pull/8899) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
39
|
+
- [`509ca56`](https://github.com/tobymao/sqlglot/commit/509ca56b21456f867e353efb7cf15b7a9a662959) - **duckdb**: preserve Snowflake and BigQuery regex extraction semantics *(commit by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
40
|
+
- [`4f4674e`](https://github.com/tobymao/sqlglot/commit/4f4674e9b54f1e519af477e04dc3075f0d0dc13a) - **hive**: support PARTITION BY EXCLUDING in windows *(PR [#8912](https://github.com/tobymao/sqlglot/pull/8912) by [@barakalon](https://github.com/barakalon))*
|
|
41
|
+
- [`79ba138`](https://github.com/tobymao/sqlglot/commit/79ba1384dc19024fae84cf4da9bfb271ecb6c332) - **sqlite**: do not mark DAY unit as unsupported in DATEDIFF *(PR [#8914](https://github.com/tobymao/sqlglot/pull/8914) by [@EduardoAndradeSLima](https://github.com/EduardoAndradeSLima))*
|
|
42
|
+
- [`f511cf1`](https://github.com/tobymao/sqlglot/commit/f511cf1e5aa94aa86f081cdb95ef1627cbc8862f) - **snowflake**: grants property handling *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
43
|
+
- [`8486881`](https://github.com/tobymao/sqlglot/commit/848688117ba6c5a74f9bf4f1b87b522c693ced22) - **spark**: preserve CREATE TABLE data source options *(PR [#8919](https://github.com/tobymao/sqlglot/pull/8919) by [@georgesittas](https://github.com/georgesittas))*
|
|
44
|
+
- :arrow_lower_right: *fixes issue [#8918](https://github.com/tobymao/sqlglot/issues/8918) opened by [@1w323](https://github.com/1w323)*
|
|
45
|
+
|
|
46
|
+
|
|
4
47
|
## [v30.29.0] - 2026-11-03
|
|
5
48
|
### :boom: BREAKING CHANGES
|
|
6
49
|
- due to [`1cbcaf6`](https://github.com/tobymao/sqlglot/commit/1cbcaf65566159b21c77488931f343ae1abac2a1) - preserve row presence when decorrelating scalar aggregates *(PR [#8851](https://github.com/tobymao/sqlglot/pull/8851) by [@treysp](https://github.com/treysp))*:
|
|
@@ -16607,3 +16650,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16607
16650
|
[v30.26.0]: https://github.com/tobymao/sqlglot/compare/v30.25.0...v30.26.0
|
|
16608
16651
|
[v30.27.0]: https://github.com/tobymao/sqlglot/compare/v30.26.0...v30.27.0
|
|
16609
16652
|
[v30.29.0]: https://github.com/tobymao/sqlglot/compare/v30.28.0...v30.29.0
|
|
16653
|
+
[v30.30.0]: https://github.com/tobymao/sqlglot/compare/v30.29.0...v30.30.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.31.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
34
34
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
35
35
|
Requires-Dist: pyperf; extra == "dev"
|
|
36
36
|
Provides-Extra: c
|
|
37
|
-
Requires-Dist: sqlglotc==30.
|
|
37
|
+
Requires-Dist: sqlglotc==30.31.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.31.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '30.
|
|
22
|
-
__version_tuple__ = version_tuple = (30,
|
|
21
|
+
__version__ = version = '30.31.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 31, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g447a8a892'
|
|
@@ -6,11 +6,9 @@ import typing as t
|
|
|
6
6
|
from sqlglot.optimizer.annotate_types import TypeAnnotator
|
|
7
7
|
|
|
8
8
|
from sqlglot import exp, jsonpath, tokens
|
|
9
|
-
from sqlglot._typing import E
|
|
10
9
|
from sqlglot.parsers.bigquery import BigQueryParser
|
|
11
10
|
from sqlglot.generators.bigquery import BigQueryGenerator
|
|
12
11
|
from sqlglot.dialects.dialect import (
|
|
13
|
-
ASCII_LOWER,
|
|
14
12
|
Dialect,
|
|
15
13
|
NormalizationStrategy,
|
|
16
14
|
)
|
|
@@ -51,7 +49,7 @@ class BigQuery(Dialect):
|
|
|
51
49
|
INITCAP_DEFAULT_DELIMITER_CHARS = ' \t\n\r\f\v\\[\\](){}/|<>!?@"^#$&~_,.:;*%+\\-'
|
|
52
50
|
|
|
53
51
|
# https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#case_sensitivity
|
|
54
|
-
NORMALIZATION_STRATEGY = NormalizationStrategy.
|
|
52
|
+
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES
|
|
55
53
|
ASCII_ONLY_NORMALIZATION = True
|
|
56
54
|
|
|
57
55
|
# bigquery udfs are case sensitive
|
|
@@ -132,35 +130,6 @@ class BigQuery(Dialect):
|
|
|
132
130
|
|
|
133
131
|
EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
|
|
134
132
|
|
|
135
|
-
def normalize_identifier(self, expression: E) -> E:
|
|
136
|
-
if (
|
|
137
|
-
isinstance(expression, exp.Identifier)
|
|
138
|
-
and self.normalization_strategy is NormalizationStrategy.CASE_INSENSITIVE
|
|
139
|
-
):
|
|
140
|
-
parent = expression.parent
|
|
141
|
-
while isinstance(parent, exp.Dot):
|
|
142
|
-
parent = parent.parent
|
|
143
|
-
|
|
144
|
-
# In BigQuery, CTEs are case-insensitive, but UDF and table names are case-sensitive
|
|
145
|
-
# by default. The following check uses a heuristic to detect tables based on whether
|
|
146
|
-
# they are qualified. This should generally be correct, because tables in BigQuery
|
|
147
|
-
# must be qualified with at least a dataset, unless @@dataset_id is set.
|
|
148
|
-
case_sensitive = (
|
|
149
|
-
isinstance(parent, exp.UserDefinedFunction)
|
|
150
|
-
or (
|
|
151
|
-
isinstance(parent, exp.Table)
|
|
152
|
-
and parent.db
|
|
153
|
-
and (parent.meta_get("quoted_table") or not parent.meta_get("maybe_column"))
|
|
154
|
-
)
|
|
155
|
-
or expression.meta_get("is_table")
|
|
156
|
-
)
|
|
157
|
-
if not case_sensitive:
|
|
158
|
-
expression.set("this", expression.this.translate(ASCII_LOWER))
|
|
159
|
-
|
|
160
|
-
return t.cast(E, expression)
|
|
161
|
-
|
|
162
|
-
return super().normalize_identifier(expression)
|
|
163
|
-
|
|
164
133
|
class JSONPathTokenizer(jsonpath.JSONPathTokenizer):
|
|
165
134
|
VAR_TOKENS = {
|
|
166
135
|
*jsonpath.JSONPathTokenizer.VAR_TOKENS,
|
|
@@ -151,6 +151,10 @@ class NormalizationStrategy(str, AutoName):
|
|
|
151
151
|
CASE_INSENSITIVE_UPPERCASE = auto()
|
|
152
152
|
"""Always case-insensitive (uppercase), regardless of quotes."""
|
|
153
153
|
|
|
154
|
+
CASE_INSENSITIVE_EXCEPT_TABLES = auto()
|
|
155
|
+
"""Case-insensitive (lowercase) regardless of quotes, except table and UDF names, which are
|
|
156
|
+
case-sensitive, e.g. BigQuery's."""
|
|
157
|
+
|
|
154
158
|
|
|
155
159
|
class UsingColumnOrder(str, AutoName):
|
|
156
160
|
"""Where star expansion places the columns of a `USING` or `NATURAL` join."""
|
|
@@ -165,6 +169,22 @@ class UsingColumnOrder(str, AutoName):
|
|
|
165
169
|
"""Where the left table has them (e.g. DuckDB)."""
|
|
166
170
|
|
|
167
171
|
|
|
172
|
+
class AliasPrecedence(str, AutoName):
|
|
173
|
+
"""Lookup precedence for input columns and projection aliases."""
|
|
174
|
+
|
|
175
|
+
ALIAS = auto()
|
|
176
|
+
"""Prefer aliases, e.g. SELECT a AS b FROM t ORDER BY b sorts by a."""
|
|
177
|
+
|
|
178
|
+
SOURCE = auto()
|
|
179
|
+
"""Prefer inputs, e.g. SELECT a AS b FROM t ORDER BY b + 1 uses t.b."""
|
|
180
|
+
|
|
181
|
+
GROUPED_SOURCE = auto()
|
|
182
|
+
"""Prefer grouped inputs or aggregate arguments to aliases, e.g. GROUP BY b HAVING b > 0."""
|
|
183
|
+
|
|
184
|
+
MERGED_SOURCE = auto()
|
|
185
|
+
"""Merged keys win: t JOIN u USING (b) CROSS JOIN v ORDER BY b + 1 uses the USING key."""
|
|
186
|
+
|
|
187
|
+
|
|
168
188
|
# "Strict" dialects (e.g. modern Hive, Spark 3+) map their zero-padded MM/dd/HH/hh/mm/ss to these in
|
|
169
189
|
# TIME_MAPPING so they roundtrip, since a lax %m/%d renders non-padded there for parse expressions
|
|
170
190
|
# (see HiveGenerator.format_time).
|
|
@@ -488,7 +508,7 @@ class Dialect(metaclass=_Dialect):
|
|
|
488
508
|
"""
|
|
489
509
|
|
|
490
510
|
SAFE_DIVISION = False
|
|
491
|
-
"""Whether division by zero throws an error (`False`) or returns NULL (`True`)."""
|
|
511
|
+
"""Whether division or modulo by zero throws an error (`False`) or returns NULL (`True`)."""
|
|
492
512
|
|
|
493
513
|
CONCAT_COALESCE = False
|
|
494
514
|
"""A `NULL` arg in `CONCAT` yields `NULL` by default, but in some dialects it yields an empty string."""
|
|
@@ -592,11 +612,14 @@ class Dialect(metaclass=_Dialect):
|
|
|
592
612
|
EXPAND_ONLY_GROUP_ALIAS_REF = False
|
|
593
613
|
"""Whether alias reference expansion before qualification should only happen for the GROUP BY clause."""
|
|
594
614
|
|
|
595
|
-
|
|
596
|
-
"""
|
|
615
|
+
COLUMN_ALIAS_PRECEDENCE: dict[Type[exp.Expr], AliasPrecedence] = {}
|
|
616
|
+
"""Alias lookup policies for HAVING, QUALIFY, ORDER BY and DISTINCT ON.
|
|
597
617
|
|
|
598
|
-
|
|
599
|
-
|
|
618
|
+
Unspecified clauses prefer aliases. GROUPED_SOURCE prefers grouped input columns and
|
|
619
|
+
input columns inside aggregates, then aliases. MERGED_SOURCE prefers merged USING keys
|
|
620
|
+
over other input columns. Standalone ORDER BY / DISTINCT ON names prefer aliases
|
|
621
|
+
regardless of their clause's expression precedence.
|
|
622
|
+
"""
|
|
600
623
|
|
|
601
624
|
ANNOTATE_ALL_SCOPES = False
|
|
602
625
|
"""Whether to annotate all scopes during optimization. Used by BigQuery for UNNEST support."""
|
|
@@ -669,6 +692,15 @@ class Dialect(metaclass=_Dialect):
|
|
|
669
692
|
SELECT t FROM my_table AS t -- Returns entire row as a struct
|
|
670
693
|
"""
|
|
671
694
|
|
|
695
|
+
OUTER_COLUMNS_SHADOW_TABLE_ALIASES = False
|
|
696
|
+
"""
|
|
697
|
+
Whether a column of an outer query takes precedence over a same-named table alias of the
|
|
698
|
+
current query, when a table is referenced as a column.
|
|
699
|
+
|
|
700
|
+
For example, in Postgres the subquery's `x` is the outer column `t.x`, not the row of `x`:
|
|
701
|
+
SELECT (SELECT x FROM (SELECT 1 AS y) AS x) FROM (SELECT 2 AS x) AS t
|
|
702
|
+
"""
|
|
703
|
+
|
|
672
704
|
SUPPORTS_STRUCT_STAR_EXPANSION = False
|
|
673
705
|
"""
|
|
674
706
|
Whether the dialect supports expanding struct fields using star notation (e.g., struct_col.*).
|
|
@@ -1152,6 +1184,18 @@ class Dialect(metaclass=_Dialect):
|
|
|
1152
1184
|
# Does not currently take dialect state into account
|
|
1153
1185
|
return hash(type(self))
|
|
1154
1186
|
|
|
1187
|
+
def column_alias_precedence(
|
|
1188
|
+
self, clause: exp.Expr, expression: exp.Expr | None = None
|
|
1189
|
+
) -> AliasPrecedence:
|
|
1190
|
+
"""Resolve clause precedence, accounting for standalone output references."""
|
|
1191
|
+
if (
|
|
1192
|
+
isinstance(clause, (exp.Order, exp.Distinct))
|
|
1193
|
+
and expression is not None
|
|
1194
|
+
and isinstance(expression.unnest(), exp.Column)
|
|
1195
|
+
):
|
|
1196
|
+
return AliasPrecedence.ALIAS
|
|
1197
|
+
return self.COLUMN_ALIAS_PRECEDENCE.get(type(clause), AliasPrecedence.ALIAS)
|
|
1198
|
+
|
|
1155
1199
|
def normalize_identifier(self, expression: E) -> E:
|
|
1156
1200
|
"""
|
|
1157
1201
|
Transforms an identifier in a way that resembles how it'd be resolved by this dialect.
|
|
@@ -1171,41 +1215,63 @@ class Dialect(metaclass=_Dialect):
|
|
|
1171
1215
|
SQLGlot aims to understand and handle all of these different behaviors gracefully, so
|
|
1172
1216
|
that it can analyze queries in the optimizer and successfully capture their semantics.
|
|
1173
1217
|
"""
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1218
|
+
if not isinstance(expression, exp.Identifier):
|
|
1219
|
+
return expression
|
|
1220
|
+
|
|
1221
|
+
strategy = self.normalization_strategy
|
|
1222
|
+
if strategy is NormalizationStrategy.CASE_SENSITIVE:
|
|
1223
|
+
return expression
|
|
1224
|
+
|
|
1225
|
+
if strategy is NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES:
|
|
1226
|
+
parent = expression.parent
|
|
1227
|
+
while isinstance(parent, exp.Dot):
|
|
1228
|
+
parent = parent.parent
|
|
1229
|
+
|
|
1230
|
+
# Table and UDF names are case-sensitive. Tables are detected by whether they're
|
|
1231
|
+
# qualified, which is generally correct for BigQuery, whose tables must be qualified
|
|
1232
|
+
# with at least a dataset, unless @@dataset_id is set.
|
|
1233
|
+
if (
|
|
1234
|
+
isinstance(parent, exp.UserDefinedFunction)
|
|
1235
|
+
or (
|
|
1236
|
+
isinstance(parent, exp.Table)
|
|
1237
|
+
and parent.db
|
|
1238
|
+
and (parent.meta_get("quoted_table") or not parent.meta_get("maybe_column"))
|
|
1183
1239
|
)
|
|
1184
|
-
|
|
1185
|
-
):
|
|
1186
|
-
if self.normalization_strategy in (
|
|
1187
|
-
NormalizationStrategy.UPPERCASE,
|
|
1188
|
-
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1240
|
+
or expression.meta_get("is_table")
|
|
1189
1241
|
):
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
normalized = (
|
|
1197
|
-
expression.this.translate(ASCII_LOWER)
|
|
1198
|
-
if self.ASCII_ONLY_NORMALIZATION
|
|
1199
|
-
else expression.this.lower()
|
|
1200
|
-
)
|
|
1242
|
+
return expression
|
|
1243
|
+
elif expression.quoted and strategy not in (
|
|
1244
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1245
|
+
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1246
|
+
):
|
|
1247
|
+
return expression
|
|
1201
1248
|
|
|
1202
|
-
|
|
1249
|
+
if strategy in (
|
|
1250
|
+
NormalizationStrategy.UPPERCASE,
|
|
1251
|
+
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1252
|
+
):
|
|
1253
|
+
normalized = (
|
|
1254
|
+
expression.this.translate(ASCII_UPPER)
|
|
1255
|
+
if self.ASCII_ONLY_NORMALIZATION
|
|
1256
|
+
else expression.this.upper()
|
|
1257
|
+
)
|
|
1258
|
+
else:
|
|
1259
|
+
normalized = (
|
|
1260
|
+
expression.this.translate(ASCII_LOWER)
|
|
1261
|
+
if self.ASCII_ONLY_NORMALIZATION
|
|
1262
|
+
else expression.this.lower()
|
|
1263
|
+
)
|
|
1264
|
+
|
|
1265
|
+
expression.set("this", normalized)
|
|
1203
1266
|
|
|
1204
1267
|
return expression
|
|
1205
1268
|
|
|
1206
1269
|
def case_sensitive(self, text: str) -> bool:
|
|
1207
1270
|
"""Checks if text contains any case sensitive characters, based on the dialect's rules."""
|
|
1208
|
-
if self.normalization_strategy
|
|
1271
|
+
if self.normalization_strategy in (
|
|
1272
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1273
|
+
NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES,
|
|
1274
|
+
):
|
|
1209
1275
|
return False
|
|
1210
1276
|
|
|
1211
1277
|
unsafe = (
|
|
@@ -1326,6 +1392,11 @@ def rename_func(name: str) -> t.Callable[[Generator, exp.Expr], str]:
|
|
|
1326
1392
|
return lambda self, expression: self.func(name, *flatten(expression.args.values()))
|
|
1327
1393
|
|
|
1328
1394
|
|
|
1395
|
+
def mod_func_sql(self: Generator, expression: exp.Mod) -> str:
|
|
1396
|
+
self.nullif_zero_divisor(expression)
|
|
1397
|
+
return self.func("MOD", expression.this, expression.expression)
|
|
1398
|
+
|
|
1399
|
+
|
|
1329
1400
|
def bracket_to_element_at_sql(self: Generator, expression: exp.Bracket) -> str:
|
|
1330
1401
|
index = seq_get(
|
|
1331
1402
|
apply_index_offset(
|
|
@@ -2086,7 +2157,10 @@ def regexp_extract_sql(
|
|
|
2086
2157
|
@unsupported_args("position", "occurrence", "modifiers")
|
|
2087
2158
|
def regexp_replace_sql(self: Generator, expression: exp.RegexpReplace) -> str:
|
|
2088
2159
|
return self.func(
|
|
2089
|
-
"REGEXP_REPLACE",
|
|
2160
|
+
"REGEXP_REPLACE",
|
|
2161
|
+
expression.this,
|
|
2162
|
+
expression.expression,
|
|
2163
|
+
expression.args.get("replacement") or exp.Literal.string(""),
|
|
2090
2164
|
)
|
|
2091
2165
|
|
|
2092
2166
|
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from sqlglot import exp
|
|
4
|
+
from sqlglot.dialects.dialect import AliasPrecedence
|
|
3
5
|
from sqlglot.dialects.mysql import MySQL
|
|
4
6
|
from sqlglot.generators.doris import DorisGenerator
|
|
5
7
|
from sqlglot.parsers.doris import DorisParser
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
class Doris(MySQL):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
12
|
+
**MySQL.COLUMN_ALIAS_PRECEDENCE,
|
|
13
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
14
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
15
|
+
}
|
|
11
16
|
DATE_FORMAT = "'yyyy-MM-dd'"
|
|
12
17
|
DATEINT_FORMAT = "'yyyyMMdd'"
|
|
13
18
|
TIME_FORMAT = "'yyyy-MM-dd HH:mm:ss'"
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
from sqlglot import exp, tokens
|
|
5
5
|
|
|
6
6
|
from sqlglot.dialects.dialect import (
|
|
7
|
+
AliasPrecedence,
|
|
7
8
|
Dialect,
|
|
8
9
|
NormalizationStrategy,
|
|
9
10
|
UsingColumnOrder,
|
|
@@ -22,8 +23,12 @@ class DuckDB(Dialect):
|
|
|
22
23
|
CONCAT_WS_COALESCE = True
|
|
23
24
|
SUPPORTS_ORDER_BY_ALL = True
|
|
24
25
|
SUPPORTS_LIMIT_ALL = True
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
27
|
+
exp.Distinct: AliasPrecedence.MERGED_SOURCE,
|
|
28
|
+
exp.Having: AliasPrecedence.GROUPED_SOURCE,
|
|
29
|
+
exp.Order: AliasPrecedence.MERGED_SOURCE,
|
|
30
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
31
|
+
}
|
|
27
32
|
SUPPORTS_FIXED_SIZE_ARRAYS = True
|
|
28
33
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
29
34
|
QUERY_RESULTS_ARE_STRUCTS = True
|
|
@@ -62,6 +67,16 @@ class DuckDB(Dialect):
|
|
|
62
67
|
"%f_nine": "%n",
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
def column_alias_precedence(
|
|
71
|
+
self, clause: exp.Expr, expression: exp.Expr | None = None
|
|
72
|
+
) -> AliasPrecedence:
|
|
73
|
+
if isinstance(clause, (exp.Order, exp.Distinct)) and expression is not None:
|
|
74
|
+
expression = expression.unnest()
|
|
75
|
+
# OrderBinder also recognizes one COLLATE around a projection reference.
|
|
76
|
+
if isinstance(expression, exp.Collate):
|
|
77
|
+
expression = expression.this
|
|
78
|
+
return super().column_alias_precedence(clause, expression)
|
|
79
|
+
|
|
65
80
|
def to_json_path(self, path: exp.Expr | None) -> exp.Expr | None:
|
|
66
81
|
if isinstance(path, exp.Literal):
|
|
67
82
|
# DuckDB also supports the JSON pointer syntax, where every path starts with a `/`.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
from sqlglot
|
|
4
|
+
from sqlglot import exp
|
|
5
|
+
from sqlglot.dialects.dialect import AliasPrecedence, NormalizationStrategy
|
|
5
6
|
from sqlglot.dialects.tsql import TSQL
|
|
6
7
|
from sqlglot.generators.fabric import FabricGenerator
|
|
7
8
|
from sqlglot.parsers.fabric import FabricParser
|
|
@@ -28,7 +29,11 @@ class Fabric(TSQL):
|
|
|
28
29
|
- T-SQL Surface Area: https://learn.microsoft.com/en-us/fabric/data-warehouse/tsql-surface-area
|
|
29
30
|
"""
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
33
|
+
**TSQL.COLUMN_ALIAS_PRECEDENCE,
|
|
34
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
35
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
36
|
+
}
|
|
32
37
|
|
|
33
38
|
# Fabric is case-sensitive unlike T-SQL which is case-insensitive
|
|
34
39
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_SENSITIVE
|
|
@@ -5,6 +5,7 @@ from collections import defaultdict
|
|
|
5
5
|
|
|
6
6
|
from sqlglot import exp, jsonpath, tokens
|
|
7
7
|
from sqlglot.dialects.dialect import (
|
|
8
|
+
AliasPrecedence,
|
|
8
9
|
Dialect,
|
|
9
10
|
NormalizationStrategy,
|
|
10
11
|
)
|
|
@@ -20,7 +21,10 @@ class Hive(Dialect):
|
|
|
20
21
|
IDENTIFIERS_CAN_START_WITH_DIGIT = True
|
|
21
22
|
SUPPORTS_USER_DEFINED_TYPES = False
|
|
22
23
|
SAFE_DIVISION = True
|
|
23
|
-
|
|
24
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
25
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
26
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
27
|
+
}
|
|
24
28
|
CONCAT_WS_COALESCE = True
|
|
25
29
|
ARRAY_AGG_INCLUDES_NULLS = None
|
|
26
30
|
REGEXP_EXTRACT_DEFAULT_GROUP = 1
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from sqlglot import tokens
|
|
3
|
+
from sqlglot import exp, tokens
|
|
4
4
|
from sqlglot.dialects.dialect import (
|
|
5
|
+
AliasPrecedence,
|
|
5
6
|
Dialect,
|
|
6
7
|
NormalizationStrategy,
|
|
7
8
|
UsingColumnOrder,
|
|
@@ -31,8 +32,10 @@ class MySQL(Dialect):
|
|
|
31
32
|
CONCAT_WS_COALESCE = True
|
|
32
33
|
SUPPORTS_USER_DEFINED_TYPES = False
|
|
33
34
|
SAFE_DIVISION = True
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
36
|
+
exp.Having: AliasPrecedence.GROUPED_SOURCE,
|
|
37
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
38
|
+
}
|
|
36
39
|
SAFE_TO_ELIMINATE_DOUBLE_NEGATION = False
|
|
37
40
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
38
41
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from sqlglot import exp, tokens
|
|
4
|
-
from sqlglot.dialects.dialect import Dialect
|
|
4
|
+
from sqlglot.dialects.dialect import AliasPrecedence, Dialect
|
|
5
5
|
from sqlglot.generators.postgres import PostgresGenerator
|
|
6
6
|
from sqlglot.parsers.postgres import PostgresParser
|
|
7
7
|
from sqlglot.tokens import TokenType
|
|
@@ -20,10 +20,16 @@ class Postgres(Dialect):
|
|
|
20
20
|
CONCAT_WS_COALESCE = True
|
|
21
21
|
NULL_ORDERING = "nulls_are_large"
|
|
22
22
|
SUPPORTS_LIMIT_ALL = True
|
|
23
|
-
|
|
23
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
24
|
+
exp.Distinct: AliasPrecedence.SOURCE,
|
|
25
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
26
|
+
exp.Order: AliasPrecedence.SOURCE,
|
|
27
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
28
|
+
}
|
|
24
29
|
TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
|
|
25
30
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
26
31
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
32
|
+
OUTER_COLUMNS_SHADOW_TABLE_ALIASES = True
|
|
27
33
|
|
|
28
34
|
DEFAULT_FUNCTIONS_COLUMN_NAMES = {
|
|
29
35
|
exp.ExplodingGenerateSeries: "generate_series",
|
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing as t
|
|
4
4
|
|
|
5
|
-
from sqlglot import tokens
|
|
5
|
+
from sqlglot import exp, tokens
|
|
6
6
|
from sqlglot.dialects.dialect import (
|
|
7
|
+
AliasPrecedence,
|
|
7
8
|
Dialect,
|
|
8
9
|
NormalizationStrategy,
|
|
9
10
|
)
|
|
@@ -23,7 +24,10 @@ class Presto(Dialect):
|
|
|
23
24
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
24
25
|
LOG_BASE_FIRST: bool | None = None
|
|
25
26
|
SUPPORTS_LIMIT_ALL = True
|
|
26
|
-
|
|
27
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
28
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
29
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
30
|
+
}
|
|
27
31
|
SUPPORTS_VALUES_DEFAULT = False
|
|
28
32
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
29
33
|
UUID_IS_STRING_TYPE = False
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
from sqlglot import TokenType
|
|
1
|
+
from sqlglot import exp, TokenType
|
|
2
|
+
from sqlglot.dialects.dialect import AliasPrecedence
|
|
2
3
|
from sqlglot.dialects.mysql import MySQL
|
|
3
4
|
from sqlglot.generators.singlestore import SingleStoreGenerator
|
|
4
5
|
from sqlglot.parsers.singlestore import SingleStoreParser, cast_to_time6
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class SingleStore(MySQL):
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
10
|
+
**MySQL.COLUMN_ALIAS_PRECEDENCE,
|
|
11
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
12
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
13
|
+
}
|
|
10
14
|
SUPPORTS_ORDER_BY_ALL = True
|
|
11
15
|
|
|
12
16
|
MYSQL_INVERSE_TIME_MAPPING = MySQL.INVERSE_TIME_MAPPING
|
|
@@ -4,6 +4,7 @@ from itertools import product
|
|
|
4
4
|
|
|
5
5
|
from sqlglot import exp, jsonpath, tokens
|
|
6
6
|
from sqlglot.dialects.dialect import (
|
|
7
|
+
AliasPrecedence,
|
|
7
8
|
Dialect,
|
|
8
9
|
NormalizationStrategy,
|
|
9
10
|
)
|
|
@@ -24,7 +25,10 @@ class Snowflake(Dialect):
|
|
|
24
25
|
TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
|
|
25
26
|
SUPPORTS_USER_DEFINED_TYPES = False
|
|
26
27
|
PREFER_CTE_ALIAS_COLUMN = True
|
|
27
|
-
|
|
28
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
29
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
30
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
31
|
+
}
|
|
28
32
|
SUPPORTS_POSITIONAL_COLUMN_REFS = True
|
|
29
33
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
30
34
|
COPY_PARAMS_ARE_CSV = False
|
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing as t
|
|
4
4
|
|
|
5
|
+
from sqlglot import exp
|
|
6
|
+
from sqlglot.dialects.dialect import AliasPrecedence
|
|
5
7
|
from sqlglot.dialects.spark2 import Spark2
|
|
6
8
|
from sqlglot.generators.spark import SparkGenerator
|
|
7
9
|
from sqlglot.parsers.spark import SparkParser
|
|
@@ -10,8 +12,11 @@ from sqlglot.typing.spark import EXPRESSION_METADATA
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class Spark(Spark2):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
16
|
+
**Spark2.COLUMN_ALIAS_PRECEDENCE,
|
|
17
|
+
exp.Having: AliasPrecedence.GROUPED_SOURCE,
|
|
18
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
19
|
+
}
|
|
15
20
|
SUPPORTS_ORDER_BY_ALL = True
|
|
16
21
|
SUPPORTS_LIMIT_ALL = True
|
|
17
22
|
SUPPORTS_NULL_TYPE = True
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from sqlglot import exp
|
|
4
|
+
from sqlglot.dialects.dialect import AliasPrecedence
|
|
3
5
|
from sqlglot.dialects.hive import Hive
|
|
4
6
|
from sqlglot.generators.spark2 import Spark2Generator
|
|
5
7
|
from sqlglot.parsers.spark2 import Spark2Parser
|
|
@@ -9,7 +11,11 @@ from sqlglot.typing.spark2 import EXPRESSION_METADATA
|
|
|
9
11
|
|
|
10
12
|
class Spark2(Hive):
|
|
11
13
|
ALTER_TABLE_SUPPORTS_CASCADE = False
|
|
12
|
-
|
|
14
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
15
|
+
**Hive.COLUMN_ALIAS_PRECEDENCE,
|
|
16
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
17
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
18
|
+
}
|
|
13
19
|
INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = True
|
|
14
20
|
|
|
15
21
|
EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
|