sqlglot 30.29.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.29.0 → sqlglot-30.31.0}/CHANGELOG.md +64 -0
- {sqlglot-30.29.0/sqlglot.egg-info → sqlglot-30.31.0}/PKG-INFO +3 -3
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/bigquery.py +1 -32
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/dialect.py +117 -29
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/doris.py +7 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/duckdb.py +19 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/fabric.py +8 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/hive.py +5 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/mysql.py +6 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/postgres.py +8 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/presto.py +6 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/singlestore.py +7 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/snowflake.py +6 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/spark.py +7 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/spark2.py +7 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/sqlite.py +8 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/starrocks.py +5 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/teradata.py +5 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/tsql.py +6 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/aggregate.py +2 -2
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/core.py +23 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/properties.py +12 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/query.py +21 -9
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/string.py +3 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/temporal.py +1 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generator.py +51 -10
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/bigquery.py +1 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/clickhouse.py +13 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/databricks.py +21 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/druid.py +2 -2
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/duckdb.py +50 -21
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/exasol.py +2 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/oracle.py +2 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/postgres.py +7 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/redshift.py +7 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/snowflake.py +7 -8
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/spark2.py +5 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/sqlite.py +30 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/teradata.py +10 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/annotate_types.py +11 -5
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/pushdown_predicates.py +26 -12
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify_columns.py +128 -26
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/resolver.py +46 -10
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/scope.py +21 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/simplify.py +15 -2
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/unnest_subqueries.py +17 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parser.py +76 -28
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/base.py +2 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/bigquery.py +5 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/duckdb.py +12 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/hive.py +5 -7
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/mysql.py +2 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/postgres.py +2 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/presto.py +10 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/snowflake.py +13 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/spark.py +5 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/spark2.py +13 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/sqlite.py +8 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/starrocks.py +3 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/teradata.py +56 -12
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/schema.py +4 -2
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/tokenizer_core.py +16 -2
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/tokens.py +2 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/__init__.py +18 -3
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/bigquery.py +30 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/snowflake.py +1 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/spark.py +0 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.29.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.29.0 → sqlglot-30.31.0}/tests/dialects/test_bigquery.py +14 -5
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_clickhouse.py +41 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_databricks.py +42 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_dialect.py +125 -5
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_duckdb.py +65 -5
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_hive.py +1 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_mysql.py +42 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_oracle.py +13 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_postgres.py +45 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_presto.py +39 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_redshift.py +21 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_snowflake.py +108 -11
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_spark.py +61 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_sqlite.py +110 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_starrocks.py +28 -3
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_teradata.py +129 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_trino.py +10 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/identity.sql +2 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/normalize_identifiers.sql +9 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns.sql +210 -1
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/simplify.sql +33 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/unnest_subqueries.sql +30 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_expressions.py +32 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_generator.py +28 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_lineage.py +10 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_optimizer.py +181 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_schema.py +11 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_transpile.py +3 -0
- sqlglot-30.29.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.29.0 → sqlglot-30.31.0}/.gitignore +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/.gitmodules +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/.gitpod.yml +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/AGENTS.md +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/CLAUDE.md +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/LICENSE +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/MANIFEST.in +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/Makefile +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/README.md +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/pyproject.toml +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/setup.cfg +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/setup.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/clickhouse.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/time.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglot.png +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/helpers.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_build.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_diff.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_docs.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_errors.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_executor.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_helper.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_parser.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_serde.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_time.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.29.0 → sqlglot-30.31.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,68 @@
|
|
|
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
|
+
|
|
47
|
+
## [v30.29.0] - 2026-11-03
|
|
48
|
+
### :boom: BREAKING CHANGES
|
|
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))*:
|
|
50
|
+
|
|
51
|
+
preserve row presence when decorrelating scalar aggregates (#8851)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### :sparkles: New Features
|
|
55
|
+
- [`007fe45`](https://github.com/tobymao/sqlglot/commit/007fe4504a85dced2659b43d6d8c42ce96d509a1) - **snowflake**: support SCOPED TEMPORARY objects *(PR [#8883](https://github.com/tobymao/sqlglot/pull/8883) by [@ramitmittal](https://github.com/ramitmittal))*
|
|
56
|
+
|
|
57
|
+
### :bug: Bug Fixes
|
|
58
|
+
- [`9619dd1`](https://github.com/tobymao/sqlglot/commit/9619dd185b2f7bbaa77d4ecb3abe44b83ac0905b) - **expression**: prevent unhandled ValueError in is_int on large exponents [GEMINI] *(PR [#8879](https://github.com/tobymao/sqlglot/pull/8879) by [@shadye-6](https://github.com/shadye-6))*
|
|
59
|
+
- :arrow_lower_right: *fixes issue [#8878](https://github.com/tobymao/sqlglot/issues/8878) opened by [@shadye-6](https://github.com/shadye-6)*
|
|
60
|
+
- [`c891966`](https://github.com/tobymao/sqlglot/commit/c89196682c0a3767894079aa2eac608a82db6296) - **optimizer**: fix merge_subqueries for constant projections having GROUP_BY_ALL *(PR [#8849](https://github.com/tobymao/sqlglot/pull/8849) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
61
|
+
- [`1cbcaf6`](https://github.com/tobymao/sqlglot/commit/1cbcaf65566159b21c77488931f343ae1abac2a1) - **optimizer**: preserve row presence when decorrelating scalar aggregates *(PR [#8851](https://github.com/tobymao/sqlglot/pull/8851) by [@treysp](https://github.com/treysp))*
|
|
62
|
+
- :arrow_lower_right: *fixes issue [#8752](https://github.com/tobymao/sqlglot/issues/8752) opened by [@wjjc1017](https://github.com/wjjc1017)*
|
|
63
|
+
- [`03ecb3e`](https://github.com/tobymao/sqlglot/commit/03ecb3ed161ff97872f61e20388f338d6b0f4871) - **optimizer**: skip decorrelation for anonymous funcs with unknown semantics *(PR [#8881](https://github.com/tobymao/sqlglot/pull/8881) by [@treysp](https://github.com/treysp))*
|
|
64
|
+
|
|
65
|
+
|
|
4
66
|
## [v30.27.0] - 2026-10-30
|
|
5
67
|
### :boom: BREAKING CHANGES
|
|
6
68
|
- due to [`5b7af1e`](https://github.com/tobymao/sqlglot/commit/5b7af1e765052d256aacb7d42624aee1a076fac4) - parse ~ as a partial regex match from DuckDB 2.0 [a mix of models in Hermes Agent] *(PR [#8840](https://github.com/tobymao/sqlglot/pull/8840) by [@ryanduguid](https://github.com/ryanduguid))*:
|
|
@@ -16587,3 +16649,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16587
16649
|
[v30.25.0]: https://github.com/tobymao/sqlglot/compare/v30.24.0...v30.25.0
|
|
16588
16650
|
[v30.26.0]: https://github.com/tobymao/sqlglot/compare/v30.25.0...v30.26.0
|
|
16589
16651
|
[v30.27.0]: https://github.com/tobymao/sqlglot/compare/v30.26.0...v30.27.0
|
|
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,6 +612,15 @@ 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
|
|
|
615
|
+
COLUMN_ALIAS_PRECEDENCE: dict[Type[exp.Expr], AliasPrecedence] = {}
|
|
616
|
+
"""Alias lookup policies for HAVING, QUALIFY, ORDER BY and DISTINCT ON.
|
|
617
|
+
|
|
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
|
+
"""
|
|
623
|
+
|
|
595
624
|
ANNOTATE_ALL_SCOPES = False
|
|
596
625
|
"""Whether to annotate all scopes during optimization. Used by BigQuery for UNNEST support."""
|
|
597
626
|
|
|
@@ -663,6 +692,15 @@ class Dialect(metaclass=_Dialect):
|
|
|
663
692
|
SELECT t FROM my_table AS t -- Returns entire row as a struct
|
|
664
693
|
"""
|
|
665
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
|
+
|
|
666
704
|
SUPPORTS_STRUCT_STAR_EXPANSION = False
|
|
667
705
|
"""
|
|
668
706
|
Whether the dialect supports expanding struct fields using star notation (e.g., struct_col.*).
|
|
@@ -802,6 +840,12 @@ class Dialect(metaclass=_Dialect):
|
|
|
802
840
|
REGEXP_EXTRACT_POSITION_OVERFLOW_RETURNS_NULL = True
|
|
803
841
|
"""Whether REGEXP_EXTRACT returns NULL when the position arg exceeds the string length."""
|
|
804
842
|
|
|
843
|
+
REGEXP_EXTRACT_NO_MATCH_RETURNS_NULL = True
|
|
844
|
+
"""Whether REGEXP_EXTRACT returns NULL rather than an empty string when the pattern does not match."""
|
|
845
|
+
|
|
846
|
+
REGEXP_EXTRACT_MISSING_GROUP_RETURNS_EMPTY = False
|
|
847
|
+
"""Whether REGEXP_EXTRACT returns an empty string for a non-participating capture group."""
|
|
848
|
+
|
|
805
849
|
SET_OP_DISTINCT_BY_DEFAULT: dict[Type[exp.Expr], bool | None] = {
|
|
806
850
|
exp.Except: True,
|
|
807
851
|
exp.Intersect: True,
|
|
@@ -1140,6 +1184,18 @@ class Dialect(metaclass=_Dialect):
|
|
|
1140
1184
|
# Does not currently take dialect state into account
|
|
1141
1185
|
return hash(type(self))
|
|
1142
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
|
+
|
|
1143
1199
|
def normalize_identifier(self, expression: E) -> E:
|
|
1144
1200
|
"""
|
|
1145
1201
|
Transforms an identifier in a way that resembles how it'd be resolved by this dialect.
|
|
@@ -1159,41 +1215,63 @@ class Dialect(metaclass=_Dialect):
|
|
|
1159
1215
|
SQLGlot aims to understand and handle all of these different behaviors gracefully, so
|
|
1160
1216
|
that it can analyze queries in the optimizer and successfully capture their semantics.
|
|
1161
1217
|
"""
|
|
1162
|
-
if (
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
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"))
|
|
1171
1239
|
)
|
|
1172
|
-
|
|
1173
|
-
):
|
|
1174
|
-
if self.normalization_strategy in (
|
|
1175
|
-
NormalizationStrategy.UPPERCASE,
|
|
1176
|
-
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1240
|
+
or expression.meta_get("is_table")
|
|
1177
1241
|
):
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
normalized = (
|
|
1185
|
-
expression.this.translate(ASCII_LOWER)
|
|
1186
|
-
if self.ASCII_ONLY_NORMALIZATION
|
|
1187
|
-
else expression.this.lower()
|
|
1188
|
-
)
|
|
1242
|
+
return expression
|
|
1243
|
+
elif expression.quoted and strategy not in (
|
|
1244
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1245
|
+
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1246
|
+
):
|
|
1247
|
+
return expression
|
|
1189
1248
|
|
|
1190
|
-
|
|
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)
|
|
1191
1266
|
|
|
1192
1267
|
return expression
|
|
1193
1268
|
|
|
1194
1269
|
def case_sensitive(self, text: str) -> bool:
|
|
1195
1270
|
"""Checks if text contains any case sensitive characters, based on the dialect's rules."""
|
|
1196
|
-
if self.normalization_strategy
|
|
1271
|
+
if self.normalization_strategy in (
|
|
1272
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1273
|
+
NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES,
|
|
1274
|
+
):
|
|
1197
1275
|
return False
|
|
1198
1276
|
|
|
1199
1277
|
unsafe = (
|
|
@@ -1314,6 +1392,11 @@ def rename_func(name: str) -> t.Callable[[Generator, exp.Expr], str]:
|
|
|
1314
1392
|
return lambda self, expression: self.func(name, *flatten(expression.args.values()))
|
|
1315
1393
|
|
|
1316
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
|
+
|
|
1317
1400
|
def bracket_to_element_at_sql(self: Generator, expression: exp.Bracket) -> str:
|
|
1318
1401
|
index = seq_get(
|
|
1319
1402
|
apply_index_offset(
|
|
@@ -2002,11 +2085,13 @@ def encode_decode_sql(
|
|
|
2002
2085
|
return self.func(name, expression.this, expression.args.get("replace") if replace else None)
|
|
2003
2086
|
|
|
2004
2087
|
|
|
2088
|
+
@unsupported_args("count")
|
|
2005
2089
|
def min_or_least(self: Generator, expression: exp.Min) -> str:
|
|
2006
2090
|
name = "LEAST" if expression.expressions else "MIN"
|
|
2007
2091
|
return rename_func(name)(self, expression)
|
|
2008
2092
|
|
|
2009
2093
|
|
|
2094
|
+
@unsupported_args("count")
|
|
2010
2095
|
def max_or_greatest(self: Generator, expression: exp.Max) -> str:
|
|
2011
2096
|
name = "GREATEST" if expression.expressions else "MAX"
|
|
2012
2097
|
return rename_func(name)(self, expression)
|
|
@@ -2072,7 +2157,10 @@ def regexp_extract_sql(
|
|
|
2072
2157
|
@unsupported_args("position", "occurrence", "modifiers")
|
|
2073
2158
|
def regexp_replace_sql(self: Generator, expression: exp.RegexpReplace) -> str:
|
|
2074
2159
|
return self.func(
|
|
2075
|
-
"REGEXP_REPLACE",
|
|
2160
|
+
"REGEXP_REPLACE",
|
|
2161
|
+
expression.this,
|
|
2162
|
+
expression.expression,
|
|
2163
|
+
expression.args.get("replacement") or exp.Literal.string(""),
|
|
2076
2164
|
)
|
|
2077
2165
|
|
|
2078
2166
|
|
|
@@ -1,11 +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):
|
|
11
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
12
|
+
**MySQL.COLUMN_ALIAS_PRECEDENCE,
|
|
13
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
14
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
15
|
+
}
|
|
9
16
|
DATE_FORMAT = "'yyyy-MM-dd'"
|
|
10
17
|
DATEINT_FORMAT = "'yyyyMMdd'"
|
|
11
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,6 +23,12 @@ class DuckDB(Dialect):
|
|
|
22
23
|
CONCAT_WS_COALESCE = True
|
|
23
24
|
SUPPORTS_ORDER_BY_ALL = True
|
|
24
25
|
SUPPORTS_LIMIT_ALL = True
|
|
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
|
+
}
|
|
25
32
|
SUPPORTS_FIXED_SIZE_ARRAYS = True
|
|
26
33
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
27
34
|
QUERY_RESULTS_ARE_STRUCTS = True
|
|
@@ -29,6 +36,8 @@ class DuckDB(Dialect):
|
|
|
29
36
|
NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
|
|
30
37
|
UUID_IS_STRING_TYPE = False
|
|
31
38
|
USING_COLUMN_ORDER = UsingColumnOrder.IN_PLACE
|
|
39
|
+
REGEXP_EXTRACT_NO_MATCH_RETURNS_NULL = False
|
|
40
|
+
REGEXP_EXTRACT_MISSING_GROUP_RETURNS_EMPTY = True
|
|
32
41
|
|
|
33
42
|
# https://duckdb.org/docs/sql/introduction.html#creating-a-new-table
|
|
34
43
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_INSENSITIVE
|
|
@@ -58,6 +67,16 @@ class DuckDB(Dialect):
|
|
|
58
67
|
"%f_nine": "%n",
|
|
59
68
|
}
|
|
60
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
|
+
|
|
61
80
|
def to_json_path(self, path: exp.Expr | None) -> exp.Expr | None:
|
|
62
81
|
if isinstance(path, exp.Literal):
|
|
63
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,6 +29,12 @@ 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
|
|
|
32
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
33
|
+
**TSQL.COLUMN_ALIAS_PRECEDENCE,
|
|
34
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
35
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
# Fabric is case-sensitive unlike T-SQL which is case-insensitive
|
|
32
39
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_SENSITIVE
|
|
33
40
|
|
|
@@ -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,6 +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
|
|
24
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
25
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
26
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
27
|
+
}
|
|
23
28
|
CONCAT_WS_COALESCE = True
|
|
24
29
|
ARRAY_AGG_INCLUDES_NULLS = None
|
|
25
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,6 +32,10 @@ class MySQL(Dialect):
|
|
|
31
32
|
CONCAT_WS_COALESCE = True
|
|
32
33
|
SUPPORTS_USER_DEFINED_TYPES = False
|
|
33
34
|
SAFE_DIVISION = True
|
|
35
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
36
|
+
exp.Having: AliasPrecedence.GROUPED_SOURCE,
|
|
37
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
38
|
+
}
|
|
34
39
|
SAFE_TO_ELIMINATE_DOUBLE_NEGATION = False
|
|
35
40
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
36
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,9 +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
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
24
|
+
exp.Distinct: AliasPrecedence.SOURCE,
|
|
25
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
26
|
+
exp.Order: AliasPrecedence.SOURCE,
|
|
27
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
28
|
+
}
|
|
23
29
|
TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
|
|
24
30
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
25
31
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
32
|
+
OUTER_COLUMNS_SHADOW_TABLE_ALIASES = True
|
|
26
33
|
|
|
27
34
|
DEFAULT_FUNCTIONS_COLUMN_NAMES = {
|
|
28
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,6 +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
|
|
27
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
28
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
29
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
30
|
+
}
|
|
26
31
|
SUPPORTS_VALUES_DEFAULT = False
|
|
27
32
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
28
33
|
UUID_IS_STRING_TYPE = False
|
|
@@ -1,10 +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):
|
|
9
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
10
|
+
**MySQL.COLUMN_ALIAS_PRECEDENCE,
|
|
11
|
+
exp.Having: AliasPrecedence.ALIAS,
|
|
12
|
+
exp.Qualify: AliasPrecedence.ALIAS,
|
|
13
|
+
}
|
|
8
14
|
SUPPORTS_ORDER_BY_ALL = True
|
|
9
15
|
|
|
10
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,6 +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
|
|
28
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
29
|
+
exp.Having: AliasPrecedence.SOURCE,
|
|
30
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
31
|
+
}
|
|
27
32
|
SUPPORTS_POSITIONAL_COLUMN_REFS = True
|
|
28
33
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
29
34
|
COPY_PARAMS_ARE_CSV = False
|
|
@@ -36,6 +41,7 @@ class Snowflake(Dialect):
|
|
|
36
41
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
37
42
|
UUID_IS_STRING_TYPE = True
|
|
38
43
|
STAR_ILIKE_BACKSLASH_ESCAPE = True
|
|
44
|
+
REGEXP_EXTRACT_MISSING_GROUP_RETURNS_EMPTY = True
|
|
39
45
|
|
|
40
46
|
# https://docs.snowflake.com/en/sql-reference/functions/split_to_table
|
|
41
47
|
DEFAULT_FUNCTIONS_COLUMN_NAMES = {
|
|
@@ -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,6 +12,11 @@ from sqlglot.typing.spark import EXPRESSION_METADATA
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class Spark(Spark2):
|
|
15
|
+
COLUMN_ALIAS_PRECEDENCE = {
|
|
16
|
+
**Spark2.COLUMN_ALIAS_PRECEDENCE,
|
|
17
|
+
exp.Having: AliasPrecedence.GROUPED_SOURCE,
|
|
18
|
+
exp.Qualify: AliasPrecedence.SOURCE,
|
|
19
|
+
}
|
|
13
20
|
SUPPORTS_ORDER_BY_ALL = True
|
|
14
21
|
SUPPORTS_LIMIT_ALL = True
|
|
15
22
|
SUPPORTS_NULL_TYPE = True
|