sqlglot 30.30.0__tar.gz → 30.32.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.32.0}/CHANGELOG.md +103 -0
- {sqlglot-30.30.0/sqlglot.egg-info → sqlglot-30.32.0}/PKG-INFO +3 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/bigquery.py +1 -32
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/clickhouse.py +8 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/dialect.py +235 -39
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/doris.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/duckdb.py +17 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/fabric.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/hive.py +5 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/mysql.py +6 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/oracle.py +2 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/postgres.py +8 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/presto.py +6 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/singlestore.py +7 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/snowflake.py +5 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/spark.py +7 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/spark2.py +7 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/sqlite.py +8 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/starrocks.py +5 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/teradata.py +8 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/tsql.py +6 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/aggregate.py +8 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/array.py +1 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/core.py +41 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/properties.py +4 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/query.py +9 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/string.py +2 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/temporal.py +15 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generator.py +168 -27
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/athena.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/bigquery.py +55 -4
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/clickhouse.py +37 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/databricks.py +66 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/dremio.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/drill.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/druid.py +3 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/duckdb.py +109 -26
- sqlglot-30.32.0/sqlglot/generators/dune.py +16 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/exasol.py +17 -14
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/hive.py +26 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/mysql.py +9 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/oracle.py +18 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/postgres.py +13 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/presto.py +14 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/redshift.py +20 -5
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/singlestore.py +0 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/snowflake.py +20 -6
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/spark.py +12 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/spark2.py +9 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/sqlite.py +43 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/tableau.py +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/teradata.py +29 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/trino.py +1 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/tsql.py +23 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/annotate_types.py +2 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/eliminate_joins.py +16 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/merge_subqueries.py +68 -5
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/optimize_joins.py +23 -7
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/pushdown_predicates.py +10 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/qualify_columns.py +136 -28
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/qualify_tables.py +2 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/resolver.py +59 -10
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/scope.py +17 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/simplify.py +56 -10
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/unnest_subqueries.py +42 -36
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parser.py +94 -39
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/bigquery.py +26 -6
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/clickhouse.py +16 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/duckdb.py +14 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/exasol.py +5 -5
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/hive.py +1 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/mysql.py +6 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/oracle.py +8 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/postgres.py +19 -10
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/presto.py +15 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/snowflake.py +19 -4
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/spark.py +5 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/spark2.py +6 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/sqlite.py +22 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/teradata.py +167 -12
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/schema.py +60 -40
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/tokenizer_core.py +17 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/tokens.py +2 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/transforms.py +26 -20
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/__init__.py +19 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/bigquery.py +62 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/postgres.py +19 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/redshift.py +14 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/snowflake.py +8 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.egg-info/SOURCES.txt +2 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.egg-info/requires.txt +2 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.egg-info/scm_file_list.json +2 -0
- sqlglot-30.32.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_bigquery.py +214 -6
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_clickhouse.py +79 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_databricks.py +110 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_dialect.py +137 -7
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_duckdb.py +125 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_exasol.py +39 -20
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_hive.py +25 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_mysql.py +105 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_oracle.py +129 -17
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_postgres.py +262 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_presto.py +51 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_redshift.py +41 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_snowflake.py +156 -17
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_spark.py +91 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_sqlite.py +290 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_starrocks.py +1 -1
- sqlglot-30.32.0/tests/dialects/test_teradata.py +1074 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_tsql.py +60 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/identity.sql +1 -5
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/annotate_functions.sql +24 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/eliminate_joins.sql +105 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +2 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/isolate_table_selects.sql +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/merge_subqueries.sql +153 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/normalize_identifiers.sql +9 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/optimize_joins.sql +15 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/optimizer.sql +42 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/pushdown_predicates.sql +89 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/pushdown_projections.sql +1 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/qualify_columns.sql +287 -2
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/qualify_tables.sql +4 -4
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/simplify.sql +59 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/unnest_subqueries.sql +59 -6
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_build.py +15 -1
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_generator.py +41 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_lineage.py +10 -0
- sqlglot-30.32.0/tests/test_optimize_cross_joins.py +53 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_optimizer.py +629 -24
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_parser.py +19 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_schema.py +128 -0
- sqlglot-30.32.0/tests/test_simplify_between.py +63 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_tokens.py +21 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_transpile.py +35 -0
- sqlglot-30.30.0/sqlglot/generators/dune.py +0 -14
- sqlglot-30.30.0/sqlglot.egg-info/scm_version.json +0 -8
- sqlglot-30.30.0/tests/dialects/test_teradata.py +0 -446
- {sqlglot-30.30.0 → sqlglot-30.32.0}/.gitignore +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/.gitmodules +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/.gitpod.yml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/AGENTS.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/CLAUDE.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/LICENSE +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/MANIFEST.in +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/Makefile +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/README.md +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/pyproject.toml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/setup.cfg +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/setup.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/time.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglot.png +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/helpers.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_diff.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_docs.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_errors.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_executor.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_helper.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_serde.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_time.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.30.0 → sqlglot-30.32.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,107 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.31.0] - 2026-11-10
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`56525f7`](https://github.com/tobymao/sqlglot/commit/56525f74855190c45b102e7f0aee7d6d80d3a480) - NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES *(PR [#8935](https://github.com/tobymao/sqlglot/pull/8935) by [@barakalon](https://github.com/barakalon))*:
|
|
7
|
+
|
|
8
|
+
NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES (#8935)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### :sparkles: New Features
|
|
12
|
+
- [`062a971`](https://github.com/tobymao/sqlglot/commit/062a971e79e2a77a6d1084bbd3d901a1b25540f3) - **teradata**: parse EXECUTE macro calls [CODEX] *(PR [#8948](https://github.com/tobymao/sqlglot/pull/8948) by [@Walkeer](https://github.com/Walkeer))*
|
|
13
|
+
- :arrow_lower_right: *addresses issue [#8947](https://github.com/tobymao/sqlglot/issues/8947) opened by [@Walkeer](https://github.com/Walkeer)*
|
|
14
|
+
- [`1ddb63b`](https://github.com/tobymao/sqlglot/commit/1ddb63b02509f7f6446edfb4026dd2967966a8a3) - **Bigquery**: Preserve struct type inside array in bigquery *(PR [#8921](https://github.com/tobymao/sqlglot/pull/8921) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
15
|
+
- [`4f6e8d8`](https://github.com/tobymao/sqlglot/commit/4f6e8d87ad6a8fcdcca490f1c0d36d54103aa40f) - **Snowflake**: Support Snowflake TO_JSON varchar type *(PR [#8975](https://github.com/tobymao/sqlglot/pull/8975) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
16
|
+
- [`c14c969`](https://github.com/tobymao/sqlglot/commit/c14c9698e28527103b8a5cfe1c183d1334291d98) - **teradata**: parse TITLE display headings [CODEX] *(PR [#8974](https://github.com/tobymao/sqlglot/pull/8974) by [@Walkeer](https://github.com/Walkeer))*
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fixes
|
|
19
|
+
- [`b74097a`](https://github.com/tobymao/sqlglot/commit/b74097a1abddbdfefdf1ec4f470e4ea71bfddbc5) - **tokenizer**: parse SAVEPOINT and RELEASE as commands *(PR [#8920](https://github.com/tobymao/sqlglot/pull/8920) by [@chinmayajha](https://github.com/chinmayajha))*
|
|
20
|
+
- [`4269a98`](https://github.com/tobymao/sqlglot/commit/4269a98ac893364c8ae32529357c2d97a583dfa4) - **sqlite**: parse underscore digit separators in numbers [CLAUDE] *(PR [#8923](https://github.com/tobymao/sqlglot/pull/8923) by [@chinmayajha](https://github.com/chinmayajha))*
|
|
21
|
+
- [`b99f5d5`](https://github.com/tobymao/sqlglot/commit/b99f5d58b1773276544b513e072273789cf2549a) - **sqlite**: keep STRICT and parse WITHOUT ROWID table options [CLAUDE] *(PR [#8925](https://github.com/tobymao/sqlglot/pull/8925) by [@chinmayajha](https://github.com/chinmayajha))*
|
|
22
|
+
- [`dae5a7c`](https://github.com/tobymao/sqlglot/commit/dae5a7c533039f6a38d160bd67f23bfcad3670e7) - **sqlite**: parse REINDEX as a command [CLAUDE] *(PR [#8929](https://github.com/tobymao/sqlglot/pull/8929) by [@chinmayajha](https://github.com/chinmayajha))*
|
|
23
|
+
- [`56525f7`](https://github.com/tobymao/sqlglot/commit/56525f74855190c45b102e7f0aee7d6d80d3a480) - NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TALBES *(PR [#8935](https://github.com/tobymao/sqlglot/pull/8935) by [@barakalon](https://github.com/barakalon))*
|
|
24
|
+
- [`4a60ec8`](https://github.com/tobymao/sqlglot/commit/4a60ec83a8f60e4776ab002e750d7506d273db89) - **databricks**: parse TIMESTAMP WITHOUT TIME ZONE into TIMESTAMP_NTZ *(PR [#8926](https://github.com/tobymao/sqlglot/pull/8926) by [@treysp](https://github.com/treysp))*
|
|
25
|
+
- [`8a06b18`](https://github.com/tobymao/sqlglot/commit/8a06b18aa63de673c7ad4f2fd304d68e87438573) - **presto**: preserve DATE_TRUNC input type when transpiling to DuckDB *(PR [#8945](https://github.com/tobymao/sqlglot/pull/8945) by [@baruchoxman](https://github.com/baruchoxman))*
|
|
26
|
+
- :arrow_lower_right: *fixes issue [#8944](https://github.com/tobymao/sqlglot/issues/8944) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
27
|
+
- [`cfda786`](https://github.com/tobymao/sqlglot/commit/cfda7864eaa2557348657358ec7ede6b5650f4aa) - **generator**: warn on slices in dialects with bracket-quoted identifiers *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
28
|
+
- [`cf60275`](https://github.com/tobymao/sqlglot/commit/cf6027514078544cbc3c1a470072946285efa475) - **redshift**: drop DISTKEY/SORTKEY/DISTSTYLE when generating other dialects *(PR [#8938](https://github.com/tobymao/sqlglot/pull/8938) by [@zgurung](https://github.com/zgurung))*
|
|
29
|
+
- :arrow_lower_right: *fixes issue [#8937](https://github.com/tobymao/sqlglot/issues/8937) opened by [@zgurung](https://github.com/zgurung)*
|
|
30
|
+
- [`ff1c85d`](https://github.com/tobymao/sqlglot/commit/ff1c85d05f90008582582209801e901a2bbbf394) - **teradata**: set NORMALIZATION_STRATEGY to CASE_INSENSITIVE *(PR [#8940](https://github.com/tobymao/sqlglot/pull/8940) by [@EduardoAndradeSLima](https://github.com/EduardoAndradeSLima))*
|
|
31
|
+
- :arrow_lower_right: *fixes issue [#8932](https://github.com/tobymao/sqlglot/issues/8932) opened by [@Bhavaneda](https://github.com/Bhavaneda)*
|
|
32
|
+
- [`5197166`](https://github.com/tobymao/sqlglot/commit/5197166a2aeee4dfd9aa62ed59f9962eb070dead) - **clickhouse**: parenthesize multi-row VALUES relations *(PR [#8943](https://github.com/tobymao/sqlglot/pull/8943) by [@yzhu-liftoff](https://github.com/yzhu-liftoff))*
|
|
33
|
+
- :arrow_lower_right: *fixes issue [#8942](https://github.com/tobymao/sqlglot/issues/8942) opened by [@yzhu-liftoff](https://github.com/yzhu-liftoff)*
|
|
34
|
+
- [`b032279`](https://github.com/tobymao/sqlglot/commit/b0322790534dfcbd51f8d6bba3fb48e6e811e45f) - **postgres**: report unsupported star EXCEPT *(PR [#8933](https://github.com/tobymao/sqlglot/pull/8933) by [@lss680455-create](https://github.com/lss680455-create))*
|
|
35
|
+
- :arrow_lower_right: *fixes issue [#8928](https://github.com/tobymao/sqlglot/issues/8928) opened by [@notlakshitha](https://github.com/notlakshitha)*
|
|
36
|
+
- [`3457400`](https://github.com/tobymao/sqlglot/commit/3457400b5d5a1888fc8b4327c0eab04e4cc989f4) - **redshift**: preserve star exclusion in strict transpilation modes *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
37
|
+
- [`19d1cc7`](https://github.com/tobymao/sqlglot/commit/19d1cc7ea29224cd9adcdbf59bf5dedd6ae5c6d2) - **sqlite**: transpile DATE_SUB to DATE with a negated modifier [CLAUDE] *(PR [#8931](https://github.com/tobymao/sqlglot/pull/8931) by [@dvsnehal](https://github.com/dvsnehal))*
|
|
38
|
+
- [`1300a99`](https://github.com/tobymao/sqlglot/commit/1300a99feb80551fa86d39eb8bed2210188fcb8e) - handle omitted REGEXP_REPLACE replacement *(PR [#8952](https://github.com/tobymao/sqlglot/pull/8952) by [@georgesittas](https://github.com/georgesittas))*
|
|
39
|
+
- :arrow_lower_right: *fixes issue [#8934](https://github.com/tobymao/sqlglot/issues/8934) opened by [@lss680455-create](https://github.com/lss680455-create)*
|
|
40
|
+
- [`5a8f468`](https://github.com/tobymao/sqlglot/commit/5a8f4686b536050a9be0b337be9b55cab26c0cb6) - preserve safe division guards for typed integers *(PR [#8950](https://github.com/tobymao/sqlglot/pull/8950) by [@georgesittas](https://github.com/georgesittas))*
|
|
41
|
+
- :arrow_lower_right: *fixes issue [#8946](https://github.com/tobymao/sqlglot/issues/8946) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
|
|
42
|
+
- [`0503702`](https://github.com/tobymao/sqlglot/commit/0503702e2e183483ba6fc581c746f2eaf1ed3d46) - **duckdb**: parse generated INITCAP SQL with the DuckDB dialect [WORKBUDDY] *(PR [#8959](https://github.com/tobymao/sqlglot/pull/8959) by [@inchang-ing](https://github.com/inchang-ing))*
|
|
43
|
+
- :arrow_lower_right: *fixes issue [#8955](https://github.com/tobymao/sqlglot/issues/8955) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
|
|
44
|
+
- [`e3963f5`](https://github.com/tobymao/sqlglot/commit/e3963f55bb49a335e23cdfb14f991f0aae4472b4) - **spark**: handle a 0 start and a negative length in SUBSTRING for DuckDB [CLAUDE] *(PR [#8966](https://github.com/tobymao/sqlglot/pull/8966) by [@anishmehta24](https://github.com/anishmehta24))*
|
|
45
|
+
- [`20b1a60`](https://github.com/tobymao/sqlglot/commit/20b1a60c46cd96c08772c4147d0f68bff46667ee) - **optimizer**: preserve source bindings in ORDER BY expressions [CODEX] *(PR [#8951](https://github.com/tobymao/sqlglot/pull/8951) by [@georgesittas](https://github.com/georgesittas))*
|
|
46
|
+
- :arrow_lower_right: *fixes issue [#8927](https://github.com/tobymao/sqlglot/issues/8927) opened by [@AndreMuraro](https://github.com/AndreMuraro)*
|
|
47
|
+
- [`6922013`](https://github.com/tobymao/sqlglot/commit/69220135b19802256402fde01bd34f35034db69d) - **postgres**: preserve omitted REGEXP_REPLACE replacement [CODEX] *(PR [#8969](https://github.com/tobymao/sqlglot/pull/8969) by [@hector2394](https://github.com/hector2394))*
|
|
48
|
+
- :arrow_lower_right: *fixes issue [#8968](https://github.com/tobymao/sqlglot/issues/8968) opened by [@Cyber-Marty](https://github.com/Cyber-Marty)*
|
|
49
|
+
- [`547fee8`](https://github.com/tobymao/sqlglot/commit/547fee896acb63c6bfd13147968a0e564feb45e9) - **optimizer**: don't simplify zoned DATE_TRUNC/TIMESTAMP_TRUNC [CLAUDE] *(PR [#8971](https://github.com/tobymao/sqlglot/pull/8971) by [@talzel](https://github.com/talzel))*
|
|
50
|
+
- :arrow_lower_right: *fixes issue [#8970](https://github.com/tobymao/sqlglot/issues/8970) opened by [@talzel](https://github.com/talzel)*
|
|
51
|
+
- [`7740638`](https://github.com/tobymao/sqlglot/commit/774063800ff49f08a2f3ce459427e717878a66b6) - **schema**: invalidate all cached lookups in MappingSchema.add_table *(PR [#8960](https://github.com/tobymao/sqlglot/pull/8960) by [@zgurung](https://github.com/zgurung))*
|
|
52
|
+
- [`0c1b5ee`](https://github.com/tobymao/sqlglot/commit/0c1b5ee65056ffd90b68705f469b8d36fc459b13) - **generator**: guard modulo by zero when transpiling from safe-division dialects *(PR [#8973](https://github.com/tobymao/sqlglot/pull/8973) by [@georgesittas](https://github.com/georgesittas))*
|
|
53
|
+
- :arrow_lower_right: *fixes issue [#8953](https://github.com/tobymao/sqlglot/issues/8953) opened by [@IAMVENEETH](https://github.com/IAMVENEETH)*
|
|
54
|
+
- [`326acdc`](https://github.com/tobymao/sqlglot/commit/326acdccf40182186bb3cd69f71a63f40c4f5c9d) - **teradata**: preserve nested TITLE function calls *(PR [#8976](https://github.com/tobymao/sqlglot/pull/8976) by [@georgesittas](https://github.com/georgesittas))*
|
|
55
|
+
- [`447a8a8`](https://github.com/tobymao/sqlglot/commit/447a8a8929835a82ead76d7c6d7e104df344ab36) - **optimizer**: resolve outer columns before inner table aliases in postgres *(PR [#8972](https://github.com/tobymao/sqlglot/pull/8972) by [@georgesittas](https://github.com/georgesittas))*
|
|
56
|
+
- :arrow_lower_right: *fixes issue [#8936](https://github.com/tobymao/sqlglot/issues/8936) opened by [@laravioli](https://github.com/laravioli)*
|
|
57
|
+
|
|
58
|
+
### :zap: Performance Improvements
|
|
59
|
+
- [`e0a6385`](https://github.com/tobymao/sqlglot/commit/e0a638553ade104a05f38b5ea94564f462c03a32) - **optimizer**: skip comparison pairs that can never combine in simplify [CLAUDE] *(PR [#8965](https://github.com/tobymao/sqlglot/pull/8965) by [@deadstrobe5](https://github.com/deadstrobe5))*
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [v30.30.0] - 2026-11-06
|
|
63
|
+
### :boom: BREAKING CHANGES
|
|
64
|
+
- 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))*:
|
|
65
|
+
|
|
66
|
+
respect input column precedence in HAVING and QUALIFY (#8898)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### :sparkles: New Features
|
|
70
|
+
- [`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))*
|
|
71
|
+
- [`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))*
|
|
72
|
+
- [`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))*
|
|
73
|
+
- :arrow_lower_right: *addresses issue [#8916](https://github.com/tobymao/sqlglot/issues/8916) opened by [@asarama](https://github.com/asarama)*
|
|
74
|
+
|
|
75
|
+
### :bug: Bug Fixes
|
|
76
|
+
- [`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))*
|
|
77
|
+
- [`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))*
|
|
78
|
+
- [`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))*
|
|
79
|
+
- [`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))*
|
|
80
|
+
- :arrow_lower_right: *fixes issue [#8890](https://github.com/tobymao/sqlglot/issues/8890) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
81
|
+
- [`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))*
|
|
82
|
+
- :arrow_lower_right: *fixes issue [#8889](https://github.com/tobymao/sqlglot/issues/8889) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
83
|
+
- [`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))*
|
|
84
|
+
- [`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))*
|
|
85
|
+
- [`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))*
|
|
86
|
+
- [`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))*
|
|
87
|
+
- :arrow_lower_right: *fixes issue [#8888](https://github.com/tobymao/sqlglot/issues/8888) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
88
|
+
- [`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))*
|
|
89
|
+
- :arrow_lower_right: *fixes issue [#8891](https://github.com/tobymao/sqlglot/issues/8891) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
90
|
+
- [`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))*
|
|
91
|
+
- :arrow_lower_right: *fixes issue [#8887](https://github.com/tobymao/sqlglot/issues/8887) opened by [@AlexanderNenninger](https://github.com/AlexanderNenninger)*
|
|
92
|
+
- [`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))*
|
|
93
|
+
- :arrow_lower_right: *fixes issue [#8906](https://github.com/tobymao/sqlglot/issues/8906) opened by [@sebastianbreguel](https://github.com/sebastianbreguel)*
|
|
94
|
+
- [`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))*
|
|
95
|
+
- :arrow_lower_right: *fixes issue [#8903](https://github.com/tobymao/sqlglot/issues/8903) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
96
|
+
- [`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))*
|
|
97
|
+
- [`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))*
|
|
98
|
+
- [`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))*
|
|
99
|
+
- [`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))*
|
|
100
|
+
- [`f511cf1`](https://github.com/tobymao/sqlglot/commit/f511cf1e5aa94aa86f081cdb95ef1627cbc8862f) - **snowflake**: grants property handling *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
101
|
+
- [`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))*
|
|
102
|
+
- :arrow_lower_right: *fixes issue [#8918](https://github.com/tobymao/sqlglot/issues/8918) opened by [@1w323](https://github.com/1w323)*
|
|
103
|
+
|
|
104
|
+
|
|
4
105
|
## [v30.29.0] - 2026-11-03
|
|
5
106
|
### :boom: BREAKING CHANGES
|
|
6
107
|
- 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 +16708,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16607
16708
|
[v30.26.0]: https://github.com/tobymao/sqlglot/compare/v30.25.0...v30.26.0
|
|
16608
16709
|
[v30.27.0]: https://github.com/tobymao/sqlglot/compare/v30.26.0...v30.27.0
|
|
16609
16710
|
[v30.29.0]: https://github.com/tobymao/sqlglot/compare/v30.28.0...v30.29.0
|
|
16711
|
+
[v30.30.0]: https://github.com/tobymao/sqlglot/compare/v30.29.0...v30.30.0
|
|
16712
|
+
[v30.31.0]: https://github.com/tobymao/sqlglot/compare/v30.30.0...v30.31.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.32.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.32.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.32.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.32.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 32, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g798a1d772'
|
|
@@ -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,
|
|
@@ -24,6 +24,14 @@ class ClickHouse(Dialect):
|
|
|
24
24
|
IDENTIFIERS_CAN_START_WITH_DIGIT = True
|
|
25
25
|
HEX_STRING_IS_INTEGER_TYPE = True
|
|
26
26
|
|
|
27
|
+
# https://clickhouse.com/docs/sql-reference/functions/date-time-functions#formatDateTime
|
|
28
|
+
TIME_MAPPING = {
|
|
29
|
+
"%%": "%%",
|
|
30
|
+
"%M": "%B",
|
|
31
|
+
"%i": "%M",
|
|
32
|
+
"%W": "%A",
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
# https://github.com/ClickHouse/ClickHouse/issues/33935#issue-1112165779
|
|
28
36
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_SENSITIVE
|
|
29
37
|
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import importlib
|
|
4
4
|
import logging
|
|
5
|
+
import re
|
|
5
6
|
import string
|
|
6
7
|
import typing as t
|
|
7
8
|
import sys
|
|
@@ -151,6 +152,10 @@ class NormalizationStrategy(str, AutoName):
|
|
|
151
152
|
CASE_INSENSITIVE_UPPERCASE = auto()
|
|
152
153
|
"""Always case-insensitive (uppercase), regardless of quotes."""
|
|
153
154
|
|
|
155
|
+
CASE_INSENSITIVE_EXCEPT_TABLES = auto()
|
|
156
|
+
"""Case-insensitive (lowercase) regardless of quotes, except table and UDF names, which are
|
|
157
|
+
case-sensitive, e.g. BigQuery's."""
|
|
158
|
+
|
|
154
159
|
|
|
155
160
|
class UsingColumnOrder(str, AutoName):
|
|
156
161
|
"""Where star expansion places the columns of a `USING` or `NATURAL` join."""
|
|
@@ -165,6 +170,22 @@ class UsingColumnOrder(str, AutoName):
|
|
|
165
170
|
"""Where the left table has them (e.g. DuckDB)."""
|
|
166
171
|
|
|
167
172
|
|
|
173
|
+
class AliasPrecedence(str, AutoName):
|
|
174
|
+
"""Lookup precedence for input columns and projection aliases."""
|
|
175
|
+
|
|
176
|
+
ALIAS = auto()
|
|
177
|
+
"""Prefer aliases, e.g. SELECT a AS b FROM t ORDER BY b sorts by a."""
|
|
178
|
+
|
|
179
|
+
SOURCE = auto()
|
|
180
|
+
"""Prefer inputs, e.g. SELECT a AS b FROM t ORDER BY b + 1 uses t.b."""
|
|
181
|
+
|
|
182
|
+
GROUPED_SOURCE = auto()
|
|
183
|
+
"""Prefer grouped inputs or aggregate arguments to aliases, e.g. GROUP BY b HAVING b > 0."""
|
|
184
|
+
|
|
185
|
+
MERGED_SOURCE = auto()
|
|
186
|
+
"""Merged keys win: t JOIN u USING (b) CROSS JOIN v ORDER BY b + 1 uses the USING key."""
|
|
187
|
+
|
|
188
|
+
|
|
168
189
|
# "Strict" dialects (e.g. modern Hive, Spark 3+) map their zero-padded MM/dd/HH/hh/mm/ss to these in
|
|
169
190
|
# TIME_MAPPING so they roundtrip, since a lax %m/%d renders non-padded there for parse expressions
|
|
170
191
|
# (see HiveGenerator.format_time).
|
|
@@ -488,7 +509,7 @@ class Dialect(metaclass=_Dialect):
|
|
|
488
509
|
"""
|
|
489
510
|
|
|
490
511
|
SAFE_DIVISION = False
|
|
491
|
-
"""Whether division by zero throws an error (`False`) or returns NULL (`True`)."""
|
|
512
|
+
"""Whether division or modulo by zero throws an error (`False`) or returns NULL (`True`)."""
|
|
492
513
|
|
|
493
514
|
CONCAT_COALESCE = False
|
|
494
515
|
"""A `NULL` arg in `CONCAT` yields `NULL` by default, but in some dialects it yields an empty string."""
|
|
@@ -592,11 +613,14 @@ class Dialect(metaclass=_Dialect):
|
|
|
592
613
|
EXPAND_ONLY_GROUP_ALIAS_REF = False
|
|
593
614
|
"""Whether alias reference expansion before qualification should only happen for the GROUP BY clause."""
|
|
594
615
|
|
|
595
|
-
|
|
596
|
-
"""
|
|
616
|
+
COLUMN_ALIAS_PRECEDENCE: dict[Type[exp.Expr], AliasPrecedence] = {}
|
|
617
|
+
"""Alias lookup policies for HAVING, QUALIFY, ORDER BY and DISTINCT ON.
|
|
597
618
|
|
|
598
|
-
|
|
599
|
-
|
|
619
|
+
Unspecified clauses prefer aliases. GROUPED_SOURCE prefers grouped input columns and
|
|
620
|
+
input columns inside aggregates, then aliases. MERGED_SOURCE prefers merged USING keys
|
|
621
|
+
over other input columns. Standalone ORDER BY / DISTINCT ON names prefer aliases
|
|
622
|
+
regardless of their clause's expression precedence.
|
|
623
|
+
"""
|
|
600
624
|
|
|
601
625
|
ANNOTATE_ALL_SCOPES = False
|
|
602
626
|
"""Whether to annotate all scopes during optimization. Used by BigQuery for UNNEST support."""
|
|
@@ -669,6 +693,15 @@ class Dialect(metaclass=_Dialect):
|
|
|
669
693
|
SELECT t FROM my_table AS t -- Returns entire row as a struct
|
|
670
694
|
"""
|
|
671
695
|
|
|
696
|
+
OUTER_COLUMNS_SHADOW_TABLE_ALIASES = False
|
|
697
|
+
"""
|
|
698
|
+
Whether a column of an outer query takes precedence over a same-named table alias of the
|
|
699
|
+
current query, when a table is referenced as a column.
|
|
700
|
+
|
|
701
|
+
For example, in Postgres the subquery's `x` is the outer column `t.x`, not the row of `x`:
|
|
702
|
+
SELECT (SELECT x FROM (SELECT 1 AS y) AS x) FROM (SELECT 2 AS x) AS t
|
|
703
|
+
"""
|
|
704
|
+
|
|
672
705
|
SUPPORTS_STRUCT_STAR_EXPANSION = False
|
|
673
706
|
"""
|
|
674
707
|
Whether the dialect supports expanding struct fields using star notation (e.g., struct_col.*).
|
|
@@ -1152,6 +1185,18 @@ class Dialect(metaclass=_Dialect):
|
|
|
1152
1185
|
# Does not currently take dialect state into account
|
|
1153
1186
|
return hash(type(self))
|
|
1154
1187
|
|
|
1188
|
+
def column_alias_precedence(
|
|
1189
|
+
self, clause: exp.Expr, expression: exp.Expr | None = None
|
|
1190
|
+
) -> AliasPrecedence:
|
|
1191
|
+
"""Resolve clause precedence, accounting for standalone output references."""
|
|
1192
|
+
if (
|
|
1193
|
+
isinstance(clause, (exp.Order, exp.Distinct))
|
|
1194
|
+
and expression is not None
|
|
1195
|
+
and isinstance(expression.unnest(), exp.Column)
|
|
1196
|
+
):
|
|
1197
|
+
return AliasPrecedence.ALIAS
|
|
1198
|
+
return self.COLUMN_ALIAS_PRECEDENCE.get(type(clause), AliasPrecedence.ALIAS)
|
|
1199
|
+
|
|
1155
1200
|
def normalize_identifier(self, expression: E) -> E:
|
|
1156
1201
|
"""
|
|
1157
1202
|
Transforms an identifier in a way that resembles how it'd be resolved by this dialect.
|
|
@@ -1171,41 +1216,63 @@ class Dialect(metaclass=_Dialect):
|
|
|
1171
1216
|
SQLGlot aims to understand and handle all of these different behaviors gracefully, so
|
|
1172
1217
|
that it can analyze queries in the optimizer and successfully capture their semantics.
|
|
1173
1218
|
"""
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1219
|
+
if not isinstance(expression, exp.Identifier):
|
|
1220
|
+
return expression
|
|
1221
|
+
|
|
1222
|
+
strategy = self.normalization_strategy
|
|
1223
|
+
if strategy is NormalizationStrategy.CASE_SENSITIVE:
|
|
1224
|
+
return expression
|
|
1225
|
+
|
|
1226
|
+
if strategy is NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES:
|
|
1227
|
+
parent = expression.parent
|
|
1228
|
+
while isinstance(parent, exp.Dot):
|
|
1229
|
+
parent = parent.parent
|
|
1230
|
+
|
|
1231
|
+
# Table and UDF names are case-sensitive. Tables are detected by whether they're
|
|
1232
|
+
# qualified, which is generally correct for BigQuery, whose tables must be qualified
|
|
1233
|
+
# with at least a dataset, unless @@dataset_id is set.
|
|
1234
|
+
if (
|
|
1235
|
+
isinstance(parent, exp.UserDefinedFunction)
|
|
1236
|
+
or (
|
|
1237
|
+
isinstance(parent, exp.Table)
|
|
1238
|
+
and parent.db
|
|
1239
|
+
and (parent.meta_get("quoted_table") or not parent.meta_get("maybe_column"))
|
|
1183
1240
|
)
|
|
1184
|
-
|
|
1185
|
-
):
|
|
1186
|
-
if self.normalization_strategy in (
|
|
1187
|
-
NormalizationStrategy.UPPERCASE,
|
|
1188
|
-
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1241
|
+
or expression.meta_get("is_table")
|
|
1189
1242
|
):
|
|
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
|
-
)
|
|
1243
|
+
return expression
|
|
1244
|
+
elif expression.quoted and strategy not in (
|
|
1245
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1246
|
+
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1247
|
+
):
|
|
1248
|
+
return expression
|
|
1201
1249
|
|
|
1202
|
-
|
|
1250
|
+
if strategy in (
|
|
1251
|
+
NormalizationStrategy.UPPERCASE,
|
|
1252
|
+
NormalizationStrategy.CASE_INSENSITIVE_UPPERCASE,
|
|
1253
|
+
):
|
|
1254
|
+
normalized = (
|
|
1255
|
+
expression.this.translate(ASCII_UPPER)
|
|
1256
|
+
if self.ASCII_ONLY_NORMALIZATION
|
|
1257
|
+
else expression.this.upper()
|
|
1258
|
+
)
|
|
1259
|
+
else:
|
|
1260
|
+
normalized = (
|
|
1261
|
+
expression.this.translate(ASCII_LOWER)
|
|
1262
|
+
if self.ASCII_ONLY_NORMALIZATION
|
|
1263
|
+
else expression.this.lower()
|
|
1264
|
+
)
|
|
1265
|
+
|
|
1266
|
+
expression.set("this", normalized)
|
|
1203
1267
|
|
|
1204
1268
|
return expression
|
|
1205
1269
|
|
|
1206
1270
|
def case_sensitive(self, text: str) -> bool:
|
|
1207
1271
|
"""Checks if text contains any case sensitive characters, based on the dialect's rules."""
|
|
1208
|
-
if self.normalization_strategy
|
|
1272
|
+
if self.normalization_strategy in (
|
|
1273
|
+
NormalizationStrategy.CASE_INSENSITIVE,
|
|
1274
|
+
NormalizationStrategy.CASE_INSENSITIVE_EXCEPT_TABLES,
|
|
1275
|
+
):
|
|
1209
1276
|
return False
|
|
1210
1277
|
|
|
1211
1278
|
unsafe = (
|
|
@@ -1326,6 +1393,11 @@ def rename_func(name: str) -> t.Callable[[Generator, exp.Expr], str]:
|
|
|
1326
1393
|
return lambda self, expression: self.func(name, *flatten(expression.args.values()))
|
|
1327
1394
|
|
|
1328
1395
|
|
|
1396
|
+
def mod_func_sql(self: Generator, expression: exp.Mod) -> str:
|
|
1397
|
+
self.nullif_zero_divisor(expression)
|
|
1398
|
+
return self.func("MOD", expression.this, expression.expression)
|
|
1399
|
+
|
|
1400
|
+
|
|
1329
1401
|
def bracket_to_element_at_sql(self: Generator, expression: exp.Bracket) -> str:
|
|
1330
1402
|
index = seq_get(
|
|
1331
1403
|
apply_index_offset(
|
|
@@ -1873,10 +1945,10 @@ def build_date_delta(
|
|
|
1873
1945
|
def build_date_delta_with_interval(
|
|
1874
1946
|
expression_class: Type[E],
|
|
1875
1947
|
default_unit: str | None = None,
|
|
1876
|
-
) -> t.Callable[[BuilderArgs], E
|
|
1877
|
-
def _builder(args: BuilderArgs) -> E
|
|
1948
|
+
) -> t.Callable[[BuilderArgs], E]:
|
|
1949
|
+
def _builder(args: BuilderArgs) -> E:
|
|
1878
1950
|
if len(args) < 2:
|
|
1879
|
-
return
|
|
1951
|
+
return expression_class(this=seq_get(args, 0))
|
|
1880
1952
|
|
|
1881
1953
|
interval = args[1]
|
|
1882
1954
|
|
|
@@ -2086,7 +2158,10 @@ def regexp_extract_sql(
|
|
|
2086
2158
|
@unsupported_args("position", "occurrence", "modifiers")
|
|
2087
2159
|
def regexp_replace_sql(self: Generator, expression: exp.RegexpReplace) -> str:
|
|
2088
2160
|
return self.func(
|
|
2089
|
-
"REGEXP_REPLACE",
|
|
2161
|
+
"REGEXP_REPLACE",
|
|
2162
|
+
expression.this,
|
|
2163
|
+
expression.expression,
|
|
2164
|
+
expression.args.get("replacement") or exp.Literal.string(""),
|
|
2090
2165
|
)
|
|
2091
2166
|
|
|
2092
2167
|
|
|
@@ -2164,6 +2239,100 @@ def build_trunc(
|
|
|
2164
2239
|
return exp.Anonymous(this="TRUNC", expressions=args)
|
|
2165
2240
|
|
|
2166
2241
|
|
|
2242
|
+
# https://docs.teradata.com/r/Lake-Working-with-SQL/SQL-Functions/SQL-Date-and-Time-Functions-and-Expressions/DateTime-and-Interval-Functions-and-Expressions/TRUNC-Date/TRUNC-Date-Syntax/ROUND-Date-and-TRUNC-Date-Argument-Types-and-Rules/TRUNC-and-ROUND-Date-Formats
|
|
2243
|
+
TRUNC_FORMAT_TO_UNIT = {
|
|
2244
|
+
"CC": "CENTURY",
|
|
2245
|
+
"SCC": "CENTURY",
|
|
2246
|
+
"SYYYY": "YEAR",
|
|
2247
|
+
"SYYY": "YEAR",
|
|
2248
|
+
"YYYY": "YEAR",
|
|
2249
|
+
"YEAR": "YEAR",
|
|
2250
|
+
"SYEAR": "YEAR",
|
|
2251
|
+
"YYY": "YEAR",
|
|
2252
|
+
"YY": "YEAR",
|
|
2253
|
+
"Y": "YEAR",
|
|
2254
|
+
"IYYY": "ISOYEAR",
|
|
2255
|
+
"IYY": "ISOYEAR",
|
|
2256
|
+
"IY": "ISOYEAR",
|
|
2257
|
+
"I": "ISOYEAR",
|
|
2258
|
+
"Q": "QUARTER",
|
|
2259
|
+
"MONTH": "MONTH",
|
|
2260
|
+
"MON": "MONTH",
|
|
2261
|
+
"MM": "MONTH",
|
|
2262
|
+
"RM": "MONTH",
|
|
2263
|
+
"DAY": "WEEK",
|
|
2264
|
+
"DY": "WEEK",
|
|
2265
|
+
"D": "WEEK",
|
|
2266
|
+
"IW": "ISOWEEK",
|
|
2267
|
+
# These weeks are anchored to the first day of the month/year, not a fixed weekday.
|
|
2268
|
+
"W": "WEEK_OF_MONTH",
|
|
2269
|
+
"WW": "WEEK_OF_YEAR",
|
|
2270
|
+
"DDD": "DAY",
|
|
2271
|
+
"DD": "DAY",
|
|
2272
|
+
"J": "DAY",
|
|
2273
|
+
"HH": "HOUR",
|
|
2274
|
+
"HH12": "HOUR",
|
|
2275
|
+
"HH24": "HOUR",
|
|
2276
|
+
"MI": "MINUTE",
|
|
2277
|
+
"SS": "SECOND",
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
def build_formatted_trunc(
|
|
2282
|
+
args: BuilderArgs, dialect: Dialect
|
|
2283
|
+
) -> exp.DateTrunc | exp.Trunc | exp.Anonymous:
|
|
2284
|
+
trunc = build_trunc(args, dialect, date_trunc_unabbreviate=False, default_date_trunc_unit="DD")
|
|
2285
|
+
if isinstance(trunc, exp.DateTrunc) and trunc.unit.is_string:
|
|
2286
|
+
unit = TRUNC_FORMAT_TO_UNIT.get(trunc.unit.name.upper())
|
|
2287
|
+
if unit == "ISOWEEK" or (unit == "WEEK" and dialect.WEEK_OFFSET):
|
|
2288
|
+
start = 1 if unit == "ISOWEEK" else week_offset_to_dow(dialect.WEEK_OFFSET)
|
|
2289
|
+
day = next(day for day, dow in WEEK_START_DAY_TO_DOW.items() if dow == start)
|
|
2290
|
+
trunc.set("unit", exp.WeekStart(this=exp.var(day)))
|
|
2291
|
+
elif unit:
|
|
2292
|
+
trunc.set("unit", exp.Literal.string(unit))
|
|
2293
|
+
return trunc
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
UNIT_TO_TRUNC_FORMAT = {
|
|
2297
|
+
"CENTURY": "CC",
|
|
2298
|
+
"YEAR": "YEAR",
|
|
2299
|
+
"YY": "YEAR",
|
|
2300
|
+
"YYYY": "YEAR",
|
|
2301
|
+
"ISOYEAR": "IYYY",
|
|
2302
|
+
"QUARTER": "Q",
|
|
2303
|
+
"MONTH": "MONTH",
|
|
2304
|
+
"MM": "MONTH",
|
|
2305
|
+
"MON": "MONTH",
|
|
2306
|
+
"WEEK": "IW",
|
|
2307
|
+
"WEEK_OF_MONTH": "W",
|
|
2308
|
+
"WEEK_OF_YEAR": "WW",
|
|
2309
|
+
"ISOWEEK": "IW",
|
|
2310
|
+
"DAY": "DD",
|
|
2311
|
+
"HOUR": "HH",
|
|
2312
|
+
"MINUTE": "MI",
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
@unsupported_args("zone", "century_from_zero")
|
|
2317
|
+
def date_trunc_to_trunc_sql(self: Generator, expression: exp.DateTrunc) -> str:
|
|
2318
|
+
unit = expression.unit
|
|
2319
|
+
if isinstance(unit, exp.WeekStart):
|
|
2320
|
+
if unit.name.upper() == "MONDAY":
|
|
2321
|
+
unit = exp.Literal.string("IW")
|
|
2322
|
+
else:
|
|
2323
|
+
self.weekstart_name(unit)
|
|
2324
|
+
unit = exp.Literal.string("DAY")
|
|
2325
|
+
elif isinstance(unit, (exp.Literal, exp.Var)):
|
|
2326
|
+
unit_name = unit.name.upper()
|
|
2327
|
+
mapped = UNIT_TO_TRUNC_FORMAT.get(unit_name)
|
|
2328
|
+
if mapped:
|
|
2329
|
+
unit = exp.Literal.string(mapped)
|
|
2330
|
+
else:
|
|
2331
|
+
self.unsupported(f"Unexpected interval unit: {unit_name}")
|
|
2332
|
+
|
|
2333
|
+
return self.func("TRUNC", expression.this, unit)
|
|
2334
|
+
|
|
2335
|
+
|
|
2167
2336
|
def any_value_to_max_sql(self: Generator, expression: exp.AnyValue) -> str:
|
|
2168
2337
|
return self.func("MAX", expression.this)
|
|
2169
2338
|
|
|
@@ -2318,11 +2487,23 @@ def unit_to_str(expression: exp.Expr, default: str = "DAY") -> exp.Expr | None:
|
|
|
2318
2487
|
|
|
2319
2488
|
|
|
2320
2489
|
def weekstart_unit_to_str(
|
|
2321
|
-
self: Generator,
|
|
2490
|
+
self: Generator,
|
|
2491
|
+
expression: exp.Expr,
|
|
2492
|
+
default: str = "DAY",
|
|
2493
|
+
*,
|
|
2494
|
+
century_from_zero: bool = False,
|
|
2322
2495
|
) -> exp.Expr | None:
|
|
2323
2496
|
unit = expression.args.get("unit")
|
|
2324
2497
|
if isinstance(unit, exp.WeekStart):
|
|
2325
2498
|
return exp.Literal.string(self.weekstart_name(unit))
|
|
2499
|
+
if isinstance(unit, exp.Literal) and unit.name.upper() in ("WEEK_OF_MONTH", "WEEK_OF_YEAR"):
|
|
2500
|
+
self.unsupported(f"Unexpected interval unit: {unit.name}")
|
|
2501
|
+
if (
|
|
2502
|
+
isinstance(unit, (exp.Literal, exp.Var))
|
|
2503
|
+
and map_date_part(unit).name.upper() == "CENTURY"
|
|
2504
|
+
and bool(expression.args.get("century_from_zero")) != century_from_zero
|
|
2505
|
+
):
|
|
2506
|
+
self.unsupported("Cannot preserve century boundaries starting at different years")
|
|
2326
2507
|
|
|
2327
2508
|
return unit_to_str(expression, default)
|
|
2328
2509
|
|
|
@@ -2330,7 +2511,7 @@ def weekstart_unit_to_str(
|
|
|
2330
2511
|
def unit_to_var(expression: exp.Expr, default: str = "DAY") -> exp.Expr | None:
|
|
2331
2512
|
unit = expression.args.get("unit")
|
|
2332
2513
|
|
|
2333
|
-
if
|
|
2514
|
+
if unit and not isinstance(unit, exp.Literal):
|
|
2334
2515
|
return unit
|
|
2335
2516
|
|
|
2336
2517
|
value = unit.name if unit else default
|
|
@@ -2697,6 +2878,15 @@ def build_like(expr_type: Type[E], not_like: bool = False) -> t.Callable[[Builde
|
|
|
2697
2878
|
return _builder
|
|
2698
2879
|
|
|
2699
2880
|
|
|
2881
|
+
def regexp_capture_group_count(pattern: exp.Expression | None) -> int | None:
|
|
2882
|
+
if pattern and (pattern.is_string or isinstance(pattern, exp.RawString)):
|
|
2883
|
+
try:
|
|
2884
|
+
return re.compile(pattern.name).groups
|
|
2885
|
+
except re.error:
|
|
2886
|
+
pass
|
|
2887
|
+
return None
|
|
2888
|
+
|
|
2889
|
+
|
|
2700
2890
|
def build_regexp_extract(expr_type: Type[E]) -> t.Callable[[BuilderArgs, Dialect], E]:
|
|
2701
2891
|
def _builder(args: BuilderArgs, dialect: Dialect) -> E:
|
|
2702
2892
|
# The "position" argument specifies the index of the string character to start matching from.
|
|
@@ -2719,7 +2909,9 @@ def build_regexp_extract(expr_type: Type[E]) -> t.Callable[[BuilderArgs, Dialect
|
|
|
2719
2909
|
return _builder
|
|
2720
2910
|
|
|
2721
2911
|
|
|
2722
|
-
def explode_to_unnest_sql(
|
|
2912
|
+
def explode_to_unnest_sql(
|
|
2913
|
+
self: Generator, expression: exp.Lateral, supports_left_join_unnest: bool = True
|
|
2914
|
+
) -> str:
|
|
2723
2915
|
this = expression.this
|
|
2724
2916
|
alias = expression.args.get("alias")
|
|
2725
2917
|
|
|
@@ -2752,6 +2944,10 @@ def explode_to_unnest_sql(self: Generator, expression: exp.Lateral) -> str:
|
|
|
2752
2944
|
)
|
|
2753
2945
|
|
|
2754
2946
|
if cross_join_expr:
|
|
2947
|
+
if expression.args.get("outer") or isinstance(this, exp.ExplodeOuter):
|
|
2948
|
+
if supports_left_join_unnest:
|
|
2949
|
+
return self.sql(exp.Join(this=cross_join_expr, side="LEFT", on=exp.true()))
|
|
2950
|
+
self.unsupported("LEFT JOIN UNNEST is not supported, NULL or empty arrays are dropped")
|
|
2755
2951
|
return self.sql(exp.Join(this=cross_join_expr, kind="cross"))
|
|
2756
2952
|
|
|
2757
2953
|
return self.lateral_sql(expression)
|