sqlglot 30.32.0__tar.gz → 30.33.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.32.0 → sqlglot-30.33.0}/CHANGELOG.md +138 -0
- {sqlglot-30.32.0/sqlglot.egg-info → sqlglot-30.33.0}/PKG-INFO +3 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/bigquery.py +3 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/databricks.py +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/hive.py +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/presto.py +33 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/sqlite.py +2 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/math.py +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/query.py +4 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/string.py +4 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/temporal.py +2 -1
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generator.py +16 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/clickhouse.py +2 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/databricks.py +3 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/duckdb.py +74 -24
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/materialize.py +4 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/postgres.py +7 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/presto.py +14 -1
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/redshift.py +3 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/snowflake.py +3 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/spark.py +7 -1
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/spark2.py +18 -5
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/sqlite.py +11 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/tsql.py +10 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/merge_subqueries.py +123 -21
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/pushdown_predicates.py +34 -18
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify_columns.py +11 -15
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/scope.py +4 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/unnest_subqueries.py +22 -15
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parser.py +2 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/clickhouse.py +7 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/databricks.py +23 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/duckdb.py +2 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/presto.py +32 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/snowflake.py +2 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/sqlite.py +9 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/tsql.py +3 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/tokenizer_core.py +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/bigquery.py +16 -7
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/databricks.py +1 -0
- sqlglot-30.33.0/sqlglot/typing/sqlite.py +9 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.egg-info/SOURCES.txt +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.egg-info/requires.txt +2 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.egg-info/scm_file_list.json +1 -0
- sqlglot-30.33.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_bigquery.py +2 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_clickhouse.py +18 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_databricks.py +89 -2
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_dialect.py +3 -4
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_duckdb.py +107 -41
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_exasol.py +3 -10
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_hive.py +1 -1
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_materialize.py +6 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_postgres.py +5 -1
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_snowflake.py +16 -4
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_spark.py +36 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_sqlite.py +173 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_teradata.py +1 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_trino.py +47 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_tsql.py +9 -8
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/merge_subqueries.sql +38 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns.sql +39 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_optimizer.py +161 -0
- sqlglot-30.32.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.32.0 → sqlglot-30.33.0}/.gitignore +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/.gitmodules +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/.gitpod.yml +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/AGENTS.md +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/CLAUDE.md +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/LICENSE +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/MANIFEST.in +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/Makefile +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/README.md +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/pyproject.toml +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/setup.cfg +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/setup.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/duckdb.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/core.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/spark2.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/time.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/tokens.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglot.png +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_mysql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/helpers.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_build.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_diff.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_docs.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_errors.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_executor.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_generator.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_helper.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_optimize_cross_joins.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_parser.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_schema.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_serde.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_simplify_between.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_time.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_transpile.py +0 -0
- {sqlglot-30.32.0 → sqlglot-30.33.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,143 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.32.0] - 2026-11-16
|
|
5
|
+
### :sparkles: New Features
|
|
6
|
+
- [`466a644`](https://github.com/tobymao/sqlglot/commit/466a6443905f6684cfc38eea0422284231cd1182) - **Snowflake**: Fix type for Snowflake TO_VARIANT *(PR [#8979](https://github.com/tobymao/sqlglot/pull/8979) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
7
|
+
- [`931b4fb`](https://github.com/tobymao/sqlglot/commit/931b4fb425d452aec854f8c3cf213aa0229b4c73) - **teradata**: parse NAMED aliases *(PR [#8978](https://github.com/tobymao/sqlglot/pull/8978) by [@Walkeer](https://github.com/Walkeer))*
|
|
8
|
+
- [`539d7b9`](https://github.com/tobymao/sqlglot/commit/539d7b94dd553b1df478b46ed3a789383c5e82f1) - **Snowflake**: Handle Snowflake IS_ARRAY boolean type correctly *(PR [#9003](https://github.com/tobymao/sqlglot/pull/9003) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
9
|
+
- [`c226be9`](https://github.com/tobymao/sqlglot/commit/c226be91617b74ba2a5bf3edcedc9c561add7afa) - **Bigquery**: Add fix for BQ Extract DATETIME type *(PR [#9048](https://github.com/tobymao/sqlglot/pull/9048) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
10
|
+
- [`c4893ba`](https://github.com/tobymao/sqlglot/commit/c4893ba8c762947a397f0856b59cd104574f90ab) - **teradata**: parse XC hexadecimal character values [CODEX] *(PR [#9069](https://github.com/tobymao/sqlglot/pull/9069) by [@Walkeer](https://github.com/Walkeer))*
|
|
11
|
+
- [`834f494`](https://github.com/tobymao/sqlglot/commit/834f494633487450170ead2e34bd0be1081428e7) - **teradata**: parse XCV hexadecimal character literals [CODEX] *(PR [#9141](https://github.com/tobymao/sqlglot/pull/9141) by [@Walkeer](https://github.com/Walkeer))*
|
|
12
|
+
|
|
13
|
+
### :bug: Bug Fixes
|
|
14
|
+
- [`4a6fad3`](https://github.com/tobymao/sqlglot/commit/4a6fad3014a2de318a2223b896481acb8a37147a) - **mysql, spark**: return an empty string for a negative LEFT/RIGHT length in DuckDB [CLAUDE] *(PR [#8967](https://github.com/tobymao/sqlglot/pull/8967) by [@anishmehta24](https://github.com/anishmehta24))*
|
|
15
|
+
- [`6bff65f`](https://github.com/tobymao/sqlglot/commit/6bff65f64f943e64d08be11965d77f4a81386b0b) - **optimizer**: preserve NULL semantics when unnesting IN subqueries *(PR [#8990](https://github.com/tobymao/sqlglot/pull/8990) by [@georgesittas](https://github.com/georgesittas))*
|
|
16
|
+
- :arrow_lower_right: *fixes issue [#8984](https://github.com/tobymao/sqlglot/issues/8984) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
17
|
+
- [`9738cfb`](https://github.com/tobymao/sqlglot/commit/9738cfbb22378bb94aa6b9ac26bd0dc3a8692ff0) - **optimizer**: preserve uncorrelated EXISTS subqueries *(PR [#8993](https://github.com/tobymao/sqlglot/pull/8993) by [@georgesittas](https://github.com/georgesittas))*
|
|
18
|
+
- :arrow_lower_right: *fixes issue [#8987](https://github.com/tobymao/sqlglot/issues/8987) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
19
|
+
- [`c4130f4`](https://github.com/tobymao/sqlglot/commit/c4130f48d1bc4721682c89e0e413c212daa05581) - **optimizer**: guard string range simplification by column type *(PR [#8994](https://github.com/tobymao/sqlglot/pull/8994) by [@georgesittas](https://github.com/georgesittas))*
|
|
20
|
+
- :arrow_lower_right: *fixes issue [#8988](https://github.com/tobymao/sqlglot/issues/8988) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
21
|
+
- [`14f79fe`](https://github.com/tobymao/sqlglot/commit/14f79fe818bd5a2dbe5743fcc88ab05acb9a1055) - **optimizer**: preserve merged keys in chained USING joins [CODEX] *(PR [#8992](https://github.com/tobymao/sqlglot/pull/8992) by [@georgesittas](https://github.com/georgesittas))*
|
|
22
|
+
- :arrow_lower_right: *fixes issue [#8986](https://github.com/tobymao/sqlglot/issues/8986) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
23
|
+
- [`64edeec`](https://github.com/tobymao/sqlglot/commit/64edeecbee4be9d743d84fe06f8d920e34f03c43) - **optimizer**: preserve outer join NULLs when merging subqueries *(PR [#8995](https://github.com/tobymao/sqlglot/pull/8995) by [@georgesittas](https://github.com/georgesittas))*
|
|
24
|
+
- :arrow_lower_right: *fixes issue [#8983](https://github.com/tobymao/sqlglot/issues/8983) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
25
|
+
- [`600e73b`](https://github.com/tobymao/sqlglot/commit/600e73b05805b3dffd6189288b473cd45ce19d8c) - **duckdb**: preserve correlated ALL semantics *(PR [#8991](https://github.com/tobymao/sqlglot/pull/8991) by [@georgesittas](https://github.com/georgesittas))*
|
|
26
|
+
- :arrow_lower_right: *fixes issue [#8985](https://github.com/tobymao/sqlglot/issues/8985) opened by [@ananya-patel81](https://github.com/ananya-patel81)*
|
|
27
|
+
- [`0fcfc11`](https://github.com/tobymao/sqlglot/commit/0fcfc119b42d1103b97fd888cfda365629c8d676) - **schema**: avoid retaining queries in schema caches *(PR [#8999](https://github.com/tobymao/sqlglot/pull/8999) by [@georgesittas](https://github.com/georgesittas))*
|
|
28
|
+
- :arrow_lower_right: *fixes issue [#8997](https://github.com/tobymao/sqlglot/issues/8997) opened by [@NikitaYurasov](https://github.com/NikitaYurasov)*
|
|
29
|
+
- [`ddc22ff`](https://github.com/tobymao/sqlglot/commit/ddc22ffcdb8cef8f4fdaecdd69747906b2d0a907) - **snowflake**: resolve 'e' flag capture group default in REGEXP_SUBSTR / REGEXP_SUBSTR_ALL *(PR [#8961](https://github.com/tobymao/sqlglot/pull/8961) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
30
|
+
- [`715c4e3`](https://github.com/tobymao/sqlglot/commit/715c4e32d9bf349cab789f2e03b99b319563644d) - **optimizer**: preserve parenthesized joins *(PR [#9001](https://github.com/tobymao/sqlglot/pull/9001) by [@georgesittas](https://github.com/georgesittas))*
|
|
31
|
+
- :arrow_lower_right: *fixes issue [#9000](https://github.com/tobymao/sqlglot/issues/9000) opened by [@theblair](https://github.com/theblair)*
|
|
32
|
+
- [`39ea442`](https://github.com/tobymao/sqlglot/commit/39ea442e9b0fcbed8704b78b2a82563e41095af6) - **teradata**: handle overloaded TRUNC and DateTrunc transpilation *(PR [#8980](https://github.com/tobymao/sqlglot/pull/8980) by [@EduardoAndradeSLima](https://github.com/EduardoAndradeSLima))*
|
|
33
|
+
- [`9d77c91`](https://github.com/tobymao/sqlglot/commit/9d77c912450a80cf1423c8bc9e91994a750a53ee) - **mysql**: flag @> and <@ array operators as unsupported [CLAUDE] *(PR [#9012](https://github.com/tobymao/sqlglot/pull/9012) by [@zgurung](https://github.com/zgurung))*
|
|
34
|
+
- [`0ccd0ab`](https://github.com/tobymao/sqlglot/commit/0ccd0ab4542b53a8f6055da52b679db53ef3cc1f) - **parser**: require valid unit for interval + continuation *(PR [#9015](https://github.com/tobymao/sqlglot/pull/9015) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
|
|
35
|
+
- :arrow_lower_right: *fixes issue [#9014](https://github.com/tobymao/sqlglot/issues/9014) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
|
|
36
|
+
- [`233e6f3`](https://github.com/tobymao/sqlglot/commit/233e6f378f2b291628fa1dbf42dabf7491806066) - **generator**: prevent SELECT_KINDS leaks in compiled builds *(PR [#9026](https://github.com/tobymao/sqlglot/pull/9026) by [@georgesittas](https://github.com/georgesittas))*
|
|
37
|
+
- :arrow_lower_right: *fixes issue [#9019](https://github.com/tobymao/sqlglot/issues/9019) opened by [@arthurlaquieze](https://github.com/arthurlaquieze)*
|
|
38
|
+
- [`8e9f43a`](https://github.com/tobymao/sqlglot/commit/8e9f43a9919ef702ce478fad39ffac3ecef301ef) - **postgres**: avoid duplicate function parameter modes *(PR [#9020](https://github.com/tobymao/sqlglot/pull/9020) by [@georgesittas](https://github.com/georgesittas))*
|
|
39
|
+
- :arrow_lower_right: *fixes issue [#9008](https://github.com/tobymao/sqlglot/issues/9008) opened by [@rileythomp](https://github.com/rileythomp)*
|
|
40
|
+
- [`c111d0e`](https://github.com/tobymao/sqlglot/commit/c111d0e88d5de8cf782f80813c1c1185ef7cd001) - **databricks**: preserve UNNEST join semantics *(PR [#9025](https://github.com/tobymao/sqlglot/pull/9025) by [@georgesittas](https://github.com/georgesittas))*
|
|
41
|
+
- :arrow_lower_right: *fixes issue [#9018](https://github.com/tobymao/sqlglot/issues/9018) opened by [@swimming-potato](https://github.com/swimming-potato)*
|
|
42
|
+
- [`3463d9e`](https://github.com/tobymao/sqlglot/commit/3463d9ecab436616828f4fe0b20b0824608edf26) - **postgres**: parse CONVERT as charset conversion *(PR [#9024](https://github.com/tobymao/sqlglot/pull/9024) by [@georgesittas](https://github.com/georgesittas))*
|
|
43
|
+
- :arrow_lower_right: *fixes issue [#9016](https://github.com/tobymao/sqlglot/issues/9016) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
|
|
44
|
+
- [`c7be595`](https://github.com/tobymao/sqlglot/commit/c7be595d85b232e62bf0b39bd604a26fe4331f34) - preserve Snowflake ASOF join semantics when transpiling *(PR [#9029](https://github.com/tobymao/sqlglot/pull/9029) by [@georgesittas](https://github.com/georgesittas))*
|
|
45
|
+
- :arrow_lower_right: *fixes issue [#9027](https://github.com/tobymao/sqlglot/issues/9027) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
|
|
46
|
+
- [`5c473b2`](https://github.com/tobymao/sqlglot/commit/5c473b241c60a0f685a18bceb74466a2273a1e54) - **teradata**: preserve BYTEINT type identity [CODEX] *(PR [#9030](https://github.com/tobymao/sqlglot/pull/9030) by [@Walkeer](https://github.com/Walkeer))*
|
|
47
|
+
- [`8688c12`](https://github.com/tobymao/sqlglot/commit/8688c120ffee4c9b7d1ad2aa1373bfbe6d37a665) - preserve TRUNC calendar semantics across dialects *(PR [#9021](https://github.com/tobymao/sqlglot/pull/9021) by [@georgesittas](https://github.com/georgesittas))*
|
|
48
|
+
- [`3f22a0e`](https://github.com/tobymao/sqlglot/commit/3f22a0eef026441c27e718ee68ccacd959ca42e9) - **postgres**: preserve generate_series step semantics [CODEX] *(PR [#9023](https://github.com/tobymao/sqlglot/pull/9023) by [@georgesittas](https://github.com/georgesittas))*
|
|
49
|
+
- :arrow_lower_right: *fixes issue [#9017](https://github.com/tobymao/sqlglot/issues/9017) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
|
|
50
|
+
- [`7dbf610`](https://github.com/tobymao/sqlglot/commit/7dbf610a9be24ee725b037f6faf37541b85c7bcb) - **optimizer**: prevent predicate pushdown through DISTINCT ON *(PR [#9035](https://github.com/tobymao/sqlglot/pull/9035) by [@georgesittas](https://github.com/georgesittas))*
|
|
51
|
+
- :arrow_lower_right: *fixes issue [#9031](https://github.com/tobymao/sqlglot/issues/9031) opened by [@xgbtxy](https://github.com/xgbtxy)*
|
|
52
|
+
- [`24503a1`](https://github.com/tobymao/sqlglot/commit/24503a1f148795ff77a9fe6e99b28bdce20a2658) - **optimizer**: preserve positional joins during optimization *(PR [#9042](https://github.com/tobymao/sqlglot/pull/9042) by [@georgesittas](https://github.com/georgesittas))*
|
|
53
|
+
- :arrow_lower_right: *fixes issue [#9038](https://github.com/tobymao/sqlglot/issues/9038) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
|
|
54
|
+
- [`8c0c82e`](https://github.com/tobymao/sqlglot/commit/8c0c82e4b4cc083683942e38d69c266557ee97f0) - **teradata**: recognize CHARACTERS as character length [CODEX] *(PR [#9044](https://github.com/tobymao/sqlglot/pull/9044) by [@Walkeer](https://github.com/Walkeer))*
|
|
55
|
+
- [`6b2cef8`](https://github.com/tobymao/sqlglot/commit/6b2cef8a3c180478b4b265f6cc18f0c5346dd696) - **teradata**: recognize CURDATE() as current date [CODEX] *(PR [#9047](https://github.com/tobymao/sqlglot/pull/9047) by [@Walkeer](https://github.com/Walkeer))*
|
|
56
|
+
- [`0cac007`](https://github.com/tobymao/sqlglot/commit/0cac00719ffc0604fd7c63c9e230bc4925ae8e26) - **teradata**: omit empty parentheses from CURRENT_TIME [CODEX] *(PR [#9050](https://github.com/tobymao/sqlglot/pull/9050) by [@Walkeer](https://github.com/Walkeer))*
|
|
57
|
+
- [`e7e7f6c`](https://github.com/tobymao/sqlglot/commit/e7e7f6c45fdcdb5d56ecd4e90279e46503f331dd) - **optimizer**: preserve semi and anti join aliases in ON clauses *(PR [#9043](https://github.com/tobymao/sqlglot/pull/9043) by [@georgesittas](https://github.com/georgesittas))*
|
|
58
|
+
- :arrow_lower_right: *fixes issue [#9037](https://github.com/tobymao/sqlglot/issues/9037) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
|
|
59
|
+
- [`61f63f0`](https://github.com/tobymao/sqlglot/commit/61f63f029a533c11b7db3446ffb758e27440a30b) - **teradata**: recognize CURTIME alias [CODEX] *(PR [#9059](https://github.com/tobymao/sqlglot/pull/9059) by [@Walkeer](https://github.com/Walkeer))*
|
|
60
|
+
- [`573e3cc`](https://github.com/tobymao/sqlglot/commit/573e3cca4d5fe701a6451bf1f04f0c8b5be4fe1c) - **optimizer**: preserve filters around special joins *(PR [#9040](https://github.com/tobymao/sqlglot/pull/9040) by [@georgesittas](https://github.com/georgesittas))*
|
|
61
|
+
- :arrow_lower_right: *fixes issue [#9036](https://github.com/tobymao/sqlglot/issues/9036) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
|
|
62
|
+
- [`0f950e8`](https://github.com/tobymao/sqlglot/commit/0f950e8643318c71e356baa953f98a855af73c9e) - **teradata**: generate native DAYOFWEEK [CODEX] *(PR [#9064](https://github.com/tobymao/sqlglot/pull/9064) by [@Walkeer](https://github.com/Walkeer))*
|
|
63
|
+
- [`1357b56`](https://github.com/tobymao/sqlglot/commit/1357b5622dc80f9ba72187a02c7fa510e456ad12) - **duckdb**: count elapsed BigQuery timestamp units *(commit by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
64
|
+
- [`0d2f459`](https://github.com/tobymao/sqlglot/commit/0d2f459b9cd67bc4c2bf2853b09e0fe3b26426c9) - **parser**: parse qualified file format names in COPY INTO *(PR [#9054](https://github.com/tobymao/sqlglot/pull/9054) by [@zgurung](https://github.com/zgurung))*
|
|
65
|
+
- [`f7e901a`](https://github.com/tobymao/sqlglot/commit/f7e901a6fc848587ff461135ac7175984b6167d3) - **optimizer**: preserve single-row joins with USING, NATURAL, or outer sides [GEMINI] *(PR [#9053](https://github.com/tobymao/sqlglot/pull/9053) by [@xgbtxy](https://github.com/xgbtxy))*
|
|
66
|
+
- :arrow_lower_right: *fixes issue [#9052](https://github.com/tobymao/sqlglot/issues/9052) opened by [@xgbtxy](https://github.com/xgbtxy)*
|
|
67
|
+
- [`3c55eac`](https://github.com/tobymao/sqlglot/commit/3c55eacc64989f03eef1a99e96b738be2b0d3238) - **duckdb**: preserve timestamp difference overload semantics *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
68
|
+
- [`0e534d4`](https://github.com/tobymao/sqlglot/commit/0e534d4e74a8f2a7ff53870183609fae43649b58) - **parser**: gate multi-part interval addition behind dialect setting *(PR [#9057](https://github.com/tobymao/sqlglot/pull/9057) by [@ansh-rohilla](https://github.com/ansh-rohilla))*
|
|
69
|
+
- :arrow_lower_right: *fixes issue [#9055](https://github.com/tobymao/sqlglot/issues/9055) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
|
|
70
|
+
- [`4c0e538`](https://github.com/tobymao/sqlglot/commit/4c0e538fdd93d14d8f29a987fc1b8dc4d7c552e7) - **oracle**: eliminate SEMI/ANTI joins, map VAR_POP and APPROX_COUNT_DISTINCT *(PR [#9067](https://github.com/tobymao/sqlglot/pull/9067) by [@imsurya26](https://github.com/imsurya26))*
|
|
71
|
+
- :arrow_lower_right: *fixes issue [#9061](https://github.com/tobymao/sqlglot/issues/9061) opened by [@haorein](https://github.com/haorein)*
|
|
72
|
+
- [`91c120c`](https://github.com/tobymao/sqlglot/commit/91c120c0ba447b41c6810a959ec1490ed341b9ae) - **postgres**: preserve date and interval arithmetic result types *(PR [#9070](https://github.com/tobymao/sqlglot/pull/9070) by [@georgesittas](https://github.com/georgesittas))*
|
|
73
|
+
- :arrow_lower_right: *fixes issue [#9056](https://github.com/tobymao/sqlglot/issues/9056) opened by [@JabberWocky-22](https://github.com/JabberWocky-22)*
|
|
74
|
+
- [`ec96d31`](https://github.com/tobymao/sqlglot/commit/ec96d31244ac7df0fd5bee2063c65d2b7de049b2) - **redshift**: type annotation for Redshift AT TIME ZONE *(PR [#9071](https://github.com/tobymao/sqlglot/pull/9071) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
75
|
+
- [`968314b`](https://github.com/tobymao/sqlglot/commit/968314baa0b2eb3c66bf9ecfa3776cdac14dd044) - **redshift**: infer AT TIME ZONE types for DATE and TIMETZ *(PR [#9073](https://github.com/tobymao/sqlglot/pull/9073) by [@georgesittas](https://github.com/georgesittas))*
|
|
76
|
+
- [`76fcf25`](https://github.com/tobymao/sqlglot/commit/76fcf25549dc6a4ce59af6e1ee7f21e332243c65) - **clickhouse**: generate array sorts and logical aggregates *(PR [#9072](https://github.com/tobymao/sqlglot/pull/9072) by [@haorein](https://github.com/haorein))*
|
|
77
|
+
- :arrow_lower_right: *fixes issue [#9063](https://github.com/tobymao/sqlglot/issues/9063) opened by [@haorein](https://github.com/haorein)*
|
|
78
|
+
- [`38437a3`](https://github.com/tobymao/sqlglot/commit/38437a3bf91f908927f4980fbf6cb7963e523d8b) - **clickhouse**: preserve logical aggregate null and numeric semantics *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
79
|
+
- [`1965183`](https://github.com/tobymao/sqlglot/commit/19651830bda35784b85781767510d2dbee95b936) - **generator**: add ORDER BY to window functions that require it *(PR [#9066](https://github.com/tobymao/sqlglot/pull/9066) by [@baruchoxman](https://github.com/baruchoxman))*
|
|
80
|
+
- :arrow_lower_right: *fixes issue [#9065](https://github.com/tobymao/sqlglot/issues/9065) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
81
|
+
- [`79716c7`](https://github.com/tobymao/sqlglot/commit/79716c77ffb007c09482ee2ddcf08b8ccf4c127f) - **oracle**: keep VARIANCE and VAR_SAMP apart *(PR [#9075](https://github.com/tobymao/sqlglot/pull/9075) by [@haorein](https://github.com/haorein))*
|
|
82
|
+
- :arrow_lower_right: *fixes issue [#9060](https://github.com/tobymao/sqlglot/issues/9060) opened by [@haorein](https://github.com/haorein)*
|
|
83
|
+
- [`593835a`](https://github.com/tobymao/sqlglot/commit/593835aa3d804a3e399cce38f5c52a25e5e79a16) - **oracle**: preserve variance semantics for windows and empty inputs *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
84
|
+
- [`036030a`](https://github.com/tobymao/sqlglot/commit/036030a42170acd3ca3cc279fcb43656155fcf5c) - **generator**: preserve original variance function names *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
85
|
+
- [`06d6bcc`](https://github.com/tobymao/sqlglot/commit/06d6bcc5eaaaab52ddc32d736bdacc2e1d681c12) - **presto**: mark the third SLICE argument as a length [CLAUDE] *(PR [#9087](https://github.com/tobymao/sqlglot/pull/9087) by [@dayan02dev](https://github.com/dayan02dev))*
|
|
86
|
+
- [`b476d29`](https://github.com/tobymao/sqlglot/commit/b476d29f42eeabfd0c8a150b9239a344b02e68dd) - **sqlite**: preserve quoted PRAGMA identifiers [CODEX] *(PR [#9088](https://github.com/tobymao/sqlglot/pull/9088) by [@pengpengyi92](https://github.com/pengpengyi92))*
|
|
87
|
+
- [`b294f7f`](https://github.com/tobymao/sqlglot/commit/b294f7fa89c8a6f59d0c1c963777202d9ef59549) - **parser**: keep comments inside multi-word keywords *(PR [#9004](https://github.com/tobymao/sqlglot/pull/9004) by [@tobymao](https://github.com/tobymao))*
|
|
88
|
+
- :arrow_lower_right: *fixes issue [#8981](https://github.com/tobymao/sqlglot/issues/8981) opened by [@rileythomp](https://github.com/rileythomp)*
|
|
89
|
+
- [`3a25325`](https://github.com/tobymao/sqlglot/commit/3a25325d62b012eac714663dd359a9ed31768582) - **clickhouse**: raise ParseError for empty XOR calls [CODEX] *(PR [#9106](https://github.com/tobymao/sqlglot/pull/9106) by [@hector2394](https://github.com/hector2394))*
|
|
90
|
+
- :arrow_lower_right: *fixes issue [#9101](https://github.com/tobymao/sqlglot/issues/9101) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
|
|
91
|
+
- [`2ec8bcc`](https://github.com/tobymao/sqlglot/commit/2ec8bcc6091758ad67e27e84598d170f3ca8f8f2) - **parser**: distinguish conditionless JOIN from comma joins *(PR [#9076](https://github.com/tobymao/sqlglot/pull/9076) by [@georgesittas](https://github.com/georgesittas))*
|
|
92
|
+
- [`784c0d7`](https://github.com/tobymao/sqlglot/commit/784c0d787efea81de5ddfae83f65f9ddc73e6117) - **teradata**: simplify XC literal handling *(PR [#9125](https://github.com/tobymao/sqlglot/pull/9125) by [@georgesittas](https://github.com/georgesittas))*
|
|
93
|
+
- [`cf16865`](https://github.com/tobymao/sqlglot/commit/cf1686591b014c427e25edc84ba63776424db89c) - **tsql**: coerce boolean casts in predicate positions [CODEX] *(PR [#9127](https://github.com/tobymao/sqlglot/pull/9127) by [@hector2394](https://github.com/hector2394))*
|
|
94
|
+
- :arrow_lower_right: *fixes issue [#9102](https://github.com/tobymao/sqlglot/issues/9102) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
|
|
95
|
+
- [`913be7d`](https://github.com/tobymao/sqlglot/commit/913be7dbe897148ca516ac9de8f4c835d4ac5fa8) - **sqlite**: preserve unary plus affinity *(PR [#9126](https://github.com/tobymao/sqlglot/pull/9126) by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm))*
|
|
96
|
+
- :arrow_lower_right: *fixes issue [#9124](https://github.com/tobymao/sqlglot/issues/9124) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
|
|
97
|
+
- [`0f48d14`](https://github.com/tobymao/sqlglot/commit/0f48d1487a59dbc9ed78321d7a75950cca6addeb) - **optimizer**: don't decorrelate EXISTS predicates that use IS [CLAUDE] *(PR [#9121](https://github.com/tobymao/sqlglot/pull/9121) by [@hemtilva](https://github.com/hemtilva))*
|
|
98
|
+
- :arrow_lower_right: *fixes issue [#9120](https://github.com/tobymao/sqlglot/issues/9120) opened by [@hemtilva](https://github.com/hemtilva)*
|
|
99
|
+
- [`a97d8d6`](https://github.com/tobymao/sqlglot/commit/a97d8d63ebeaa5b9e2a94095f42df271b0ba4756) - **parser**: validate missing date arithmetic arguments *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
100
|
+
- :arrow_lower_right: *fixes issue [#9103](https://github.com/tobymao/sqlglot/issues/9103) opened by [@Sun-Wukhan](https://github.com/Sun-Wukhan)*
|
|
101
|
+
- [`ab10a79`](https://github.com/tobymao/sqlglot/commit/ab10a79f5966a72c66b0902926cef5f8168bb408) - **optimizer**: preserve parentheses under unary plus *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
102
|
+
- [`83d02ae`](https://github.com/tobymao/sqlglot/commit/83d02aeedd97366e0d9ebe6611047f7dbb40bebd) - **sqlite**: keep the exclusive end of RANGE in GENERATE_SERIES *(PR [#9123](https://github.com/tobymao/sqlglot/pull/9123) by [@DeepBuha06](https://github.com/DeepBuha06))*
|
|
103
|
+
- [`5b64475`](https://github.com/tobymao/sqlglot/commit/5b64475fc1ef950d3ae99d7d2d75de998342e378) - **bigquery**: type DATETIME_ADD/TIMESTAMP_ADD by their argument *(PR [#9117](https://github.com/tobymao/sqlglot/pull/9117) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
104
|
+
- [`1a9c2d0`](https://github.com/tobymao/sqlglot/commit/1a9c2d0607019e82c7defab7d6c50ec489737401) - **sqlite**: map JSON and JSONB casts to JSON function ([#9113](https://github.com/tobymao/sqlglot/pull/9113)) *(PR [#9116](https://github.com/tobymao/sqlglot/pull/9116) by [@Gowthamsuryagolla](https://github.com/Gowthamsuryagolla))*
|
|
105
|
+
- :arrow_lower_right: *fixes issue [#9113](https://github.com/tobymao/sqlglot/issues/9113) opened by [@bardrop](https://github.com/bardrop)*
|
|
106
|
+
- [`14b6900`](https://github.com/tobymao/sqlglot/commit/14b69001c86abfbcf821ade0706749af23c18937) - **generator**: concatenate CHR calls for multi-argument CHAR *(PR [#9119](https://github.com/tobymao/sqlglot/pull/9119) by [@EnesSoydan](https://github.com/EnesSoydan))*
|
|
107
|
+
- :arrow_lower_right: *fixes issue [#8542](https://github.com/tobymao/sqlglot/issues/8542) opened by [@ParamTanna](https://github.com/ParamTanna)*
|
|
108
|
+
- [`361f808`](https://github.com/tobymao/sqlglot/commit/361f808132984bedfdb42e0950b1298bdd66a427) - **optimizer**: keep parentheses for reversed DATE_TRUNC comparisons under NOT *(PR [#9108](https://github.com/tobymao/sqlglot/pull/9108) by [@parthdembla007](https://github.com/parthdembla007))*
|
|
109
|
+
- :arrow_lower_right: *fixes issue [#9107](https://github.com/tobymao/sqlglot/issues/9107) opened by [@parthdembla007](https://github.com/parthdembla007)*
|
|
110
|
+
- [`b385119`](https://github.com/tobymao/sqlglot/commit/b385119d78f976519a08d1e94de8f25805b1040b) - preserve property comments and refine SQLite JSON cast tests *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
111
|
+
- [`df4496e`](https://github.com/tobymao/sqlglot/commit/df4496e48f5dec0c1105e31bc758d207e967b6ae) - **duckdb**: keep NULL and empty arrays for LATERAL VIEW OUTER as LEFT JOIN UNNEST [CLAUDE] *(PR [#9091](https://github.com/tobymao/sqlglot/pull/9091) by [@dayan02dev](https://github.com/dayan02dev))*
|
|
112
|
+
- [`d78ad66`](https://github.com/tobymao/sqlglot/commit/d78ad66cbdfda24e0ce9a1c535c7beaa6df1e18d) - **bigquery**: stabilize INFORMATION_SCHEMA round trips [CODEX] *(PR [#9133](https://github.com/tobymao/sqlglot/pull/9133) by [@georgesittas](https://github.com/georgesittas))*
|
|
113
|
+
- [`708fc0b`](https://github.com/tobymao/sqlglot/commit/708fc0bd605ac36561071c6924927c1c382aca35) - **optimizer**: keep LEFT JOINs onto UNION ALL derived tables in eliminate_joins [CLAUDE] *(PR [#9092](https://github.com/tobymao/sqlglot/pull/9092) by [@anishmehta24](https://github.com/anishmehta24))*
|
|
114
|
+
- [`c8e5853`](https://github.com/tobymao/sqlglot/commit/c8e5853d9979b34c2a4aab5b66c46bd674b62c9c) - **duckdb**: only match binary POSITION on byte boundaries *(commit by [@krish-goradia](https://github.com/krish-goradia))*
|
|
115
|
+
- [`3b6c49c`](https://github.com/tobymao/sqlglot/commit/3b6c49c8e440d65c16663d5d78ac9b7064b2389c) - **clickhouse**: map formatDateTime specifiers that differ from strftime *(commit by [@DeepBuha06](https://github.com/DeepBuha06))*
|
|
116
|
+
- [`35916ab`](https://github.com/tobymao/sqlglot/commit/35916abf778be027b31faf00564cf126d8c7dbf0) - **clickhouse**: preserve escaped time format specifiers *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
117
|
+
- [`505c4a3`](https://github.com/tobymao/sqlglot/commit/505c4a35d1c99c118377d5ef2a7c15f9e6b8f421) - **hive**: preserve sub-day DATEADD units in Hive and Spark [CODEX] *(PR [#9085](https://github.com/tobymao/sqlglot/pull/9085) by [@georgesittas](https://github.com/georgesittas))*
|
|
118
|
+
- :arrow_lower_right: *fixes issue [#9083](https://github.com/tobymao/sqlglot/issues/9083) opened by [@ryuan-cz](https://github.com/ryuan-cz)*
|
|
119
|
+
- [`e31d209`](https://github.com/tobymao/sqlglot/commit/e31d209ee0a3ed5aa35da952328aa03d475ce75d) - **bigquery**: rewrite LIKE ... ESCAPE literal patterns to backslash escapes *(PR [#9095](https://github.com/tobymao/sqlglot/pull/9095) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
120
|
+
- [`ae3d013`](https://github.com/tobymao/sqlglot/commit/ae3d0139e760fe7bec499cd6fba3a53d727b6f8b) - **bigquery**: cast zoneless Presto/Trino AT TIME ZONE operand to TIMESTAMP *(PR [#9097](https://github.com/tobymao/sqlglot/pull/9097) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
121
|
+
- [`8802c5a`](https://github.com/tobymao/sqlglot/commit/8802c5a7c9745703a29a824f4e245d44671ad940) - **generator**: keep the lambda of Spark's EXISTS(array, lambda) *(PR [#9140](https://github.com/tobymao/sqlglot/pull/9140) by [@EnesSoydan](https://github.com/EnesSoydan))*
|
|
122
|
+
- :arrow_lower_right: *fixes issue [#9032](https://github.com/tobymao/sqlglot/issues/9032) opened by [@Ankitkj1999](https://github.com/Ankitkj1999)*
|
|
123
|
+
- [`997b7cf`](https://github.com/tobymao/sqlglot/commit/997b7cfeb8cef2b361208bb72df7eead792cc0db) - **optimizer**: preserve BETWEEN SYMMETRIC semantics [CODEX] *(PR [#9142](https://github.com/tobymao/sqlglot/pull/9142) by [@Ramji-Purwar](https://github.com/Ramji-Purwar))*
|
|
124
|
+
- [`fccb238`](https://github.com/tobymao/sqlglot/commit/fccb2380b247f652e668d6508f1a3d2ff9a8eee2) - stop walking into udtf for walk_in_scope *(PR [#9099](https://github.com/tobymao/sqlglot/pull/9099) by [@barakalon](https://github.com/barakalon))*
|
|
125
|
+
- [`8c0dcfe`](https://github.com/tobymao/sqlglot/commit/8c0dcfe6872d5fbe1b65f62eb2b3269930dd3e55) - **sqlite**: omit default separator for DISTINCT aggregates [CODEX] *(PR [#9147](https://github.com/tobymao/sqlglot/pull/9147) by [@prathamchoksi](https://github.com/prathamchoksi))*
|
|
126
|
+
- :arrow_lower_right: *fixes issue [#9146](https://github.com/tobymao/sqlglot/issues/9146) opened by [@prathamchoksi](https://github.com/prathamchoksi)*
|
|
127
|
+
- [`152f69d`](https://github.com/tobymao/sqlglot/commit/152f69da577c9e9af7ee90c625668c23e576ef1c) - **optimizer**: retain conditional CROSS JOIN predicates [CODEX] *(PR [#9149](https://github.com/tobymao/sqlglot/pull/9149) by [@Ramji-Purwar](https://github.com/Ramji-Purwar))*
|
|
128
|
+
- [`0424c5d`](https://github.com/tobymao/sqlglot/commit/0424c5d9fcc007239a2324ca93e6cecfc74b5b67) - **duckdb**: preserve SQLite NULL group_concat separators [CODEX] *(PR [#9144](https://github.com/tobymao/sqlglot/pull/9144) by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm))*
|
|
129
|
+
- :arrow_lower_right: *fixes issue [#9143](https://github.com/tobymao/sqlglot/issues/9143) opened by [@vanshbarfiwala-lgtm](https://github.com/vanshbarfiwala-lgtm)*
|
|
130
|
+
- [`34ac378`](https://github.com/tobymao/sqlglot/commit/34ac378866650d732a1de72c96058078938c95f3) - **optimizer**: preserve NULL semantics when decorrelating IN subqueries *(PR [#9151](https://github.com/tobymao/sqlglot/pull/9151) by [@geooo109](https://github.com/geooo109))*
|
|
131
|
+
- :arrow_lower_right: *fixes issue [#9122](https://github.com/tobymao/sqlglot/issues/9122) opened by [@hemtilva](https://github.com/hemtilva)*
|
|
132
|
+
- [`798a1d7`](https://github.com/tobymao/sqlglot/commit/798a1d77270da43041b37b4f5166252571f1243f) - **redshift**: preserve date unit expressions *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
133
|
+
|
|
134
|
+
### :zap: Performance Improvements
|
|
135
|
+
- [`6332eff`](https://github.com/tobymao/sqlglot/commit/6332eff5414991744a5055bacafdadbd4db5ae57) - **expressions**: shallow-copy immutable meta in deepcopy [CLAUDE] *(PR [#9013](https://github.com/tobymao/sqlglot/pull/9013) by [@g4lb](https://github.com/g4lb))*
|
|
136
|
+
|
|
137
|
+
### :wrench: Chores
|
|
138
|
+
- [`d95ad4f`](https://github.com/tobymao/sqlglot/commit/d95ad4f026f37a9083c697819ac4247ed919ceee) - sync conditionless join fixtures *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
139
|
+
|
|
140
|
+
|
|
4
141
|
## [v30.31.0] - 2026-11-10
|
|
5
142
|
### :boom: BREAKING CHANGES
|
|
6
143
|
- 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))*:
|
|
@@ -16710,3 +16847,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16710
16847
|
[v30.29.0]: https://github.com/tobymao/sqlglot/compare/v30.28.0...v30.29.0
|
|
16711
16848
|
[v30.30.0]: https://github.com/tobymao/sqlglot/compare/v30.29.0...v30.30.0
|
|
16712
16849
|
[v30.31.0]: https://github.com/tobymao/sqlglot/compare/v30.30.0...v30.31.0
|
|
16850
|
+
[v30.32.0]: https://github.com/tobymao/sqlglot/compare/v30.31.0...v30.32.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.33.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.33.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.33.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.33.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 33, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g0936dbe91'
|
|
@@ -70,6 +70,9 @@ class BigQuery(Dialect):
|
|
|
70
70
|
# Preserve %E6S instead of expanding to %T.%f - since both %E6S & %T.%f are semantically different in BigQuery
|
|
71
71
|
# %E6S is semantically different from %T.%f: %E6S works as a single atomic specifier for seconds with microseconds, while %T.%f expands incorrectly and fails to parse.
|
|
72
72
|
"%H:%M:%S.%f": "%H:%M:%E6S",
|
|
73
|
+
# Milliseconds are only written, so BigQuery's own %E3S is read and kept as is
|
|
74
|
+
"%S.%f_three": "%E3S",
|
|
75
|
+
"%H:%M:%S.%f_three": "%H:%M:%E3S",
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
FORMAT_MAPPING = {
|
|
@@ -12,6 +12,7 @@ from sqlglot.dialects.mysql import MySQL
|
|
|
12
12
|
from sqlglot.generators.presto import PrestoGenerator
|
|
13
13
|
from sqlglot.parsers.presto import PrestoParser
|
|
14
14
|
from sqlglot.tokens import TokenType
|
|
15
|
+
from sqlglot.trie import new_trie
|
|
15
16
|
from sqlglot.typing.presto import EXPRESSION_METADATA
|
|
16
17
|
|
|
17
18
|
|
|
@@ -34,6 +35,38 @@ class Presto(Dialect):
|
|
|
34
35
|
|
|
35
36
|
TIME_MAPPING = MySQL.TIME_MAPPING
|
|
36
37
|
|
|
38
|
+
# FORMAT_DATETIME's Joda patterns, which DATE_FORMAT's MySQL codes can't always express, e.g. SSS.
|
|
39
|
+
# Fields that would format differently elsewhere are left out: fractions of a second other than
|
|
40
|
+
# ss.SSS (Joda keeps only milliseconds, and BigQuery writes them only with seconds), z and Z
|
|
41
|
+
# (other dialects don't keep the zone) and d (BigQuery pads it with a space).
|
|
42
|
+
# https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html
|
|
43
|
+
JODA_TIME_MAPPING = {
|
|
44
|
+
"yyyy": "%Y",
|
|
45
|
+
"yy": "%y",
|
|
46
|
+
"MMMM": "%B",
|
|
47
|
+
"MMM": "%b",
|
|
48
|
+
"MM": "%m",
|
|
49
|
+
"M": "%-m",
|
|
50
|
+
"dd": "%d",
|
|
51
|
+
"DDD": "%j",
|
|
52
|
+
"D": "%-j",
|
|
53
|
+
"EEEE": "%A",
|
|
54
|
+
"EEE": "%a",
|
|
55
|
+
"a": "%p",
|
|
56
|
+
"HH": "%H",
|
|
57
|
+
"H": "%-H",
|
|
58
|
+
"hh": "%I",
|
|
59
|
+
"h": "%-I",
|
|
60
|
+
"mm": "%M",
|
|
61
|
+
"m": "%-M",
|
|
62
|
+
"ss": "%S",
|
|
63
|
+
"s": "%-S",
|
|
64
|
+
"ss.SSS": "%S.%f_three",
|
|
65
|
+
}
|
|
66
|
+
JODA_TIME_TRIE = new_trie(JODA_TIME_MAPPING)
|
|
67
|
+
INVERSE_JODA_TIME_MAPPING = {v: k for k, v in JODA_TIME_MAPPING.items()}
|
|
68
|
+
INVERSE_JODA_TIME_TRIE = new_trie(INVERSE_JODA_TIME_MAPPING)
|
|
69
|
+
|
|
37
70
|
# https://github.com/trinodb/trino/issues/17
|
|
38
71
|
# https://github.com/trinodb/trino/issues/12289
|
|
39
72
|
# https://github.com/prestodb/presto/issues/2863
|
|
@@ -10,6 +10,7 @@ from sqlglot.dialects.dialect import (
|
|
|
10
10
|
from sqlglot.generators.sqlite import SQLiteGenerator
|
|
11
11
|
from sqlglot.parsers.sqlite import SQLiteParser
|
|
12
12
|
from sqlglot.tokens import TokenType
|
|
13
|
+
from sqlglot.typing.sqlite import EXPRESSION_METADATA
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class SQLite(Dialect):
|
|
@@ -28,6 +29,7 @@ class SQLite(Dialect):
|
|
|
28
29
|
CONCAT_WS_COALESCE = True
|
|
29
30
|
INTERSECT_BINDS_TIGHTER_THAN_UNION_AND_EXCEPT = False
|
|
30
31
|
NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
|
|
32
|
+
EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
|
|
31
33
|
|
|
32
34
|
class Tokenizer(tokens.Tokenizer):
|
|
33
35
|
IDENTIFIERS = ['"', ("[", "]"), "`"]
|
|
@@ -51,7 +51,9 @@ class EndsWith(Expression, Func):
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
class Format(Expression, Func):
|
|
54
|
-
|
|
54
|
+
"""Formats values using printf syntax, or brace syntax when is_fmt is set."""
|
|
55
|
+
|
|
56
|
+
arg_types = {"this": True, "expressions": False, "is_fmt": False}
|
|
55
57
|
is_var_len_args = True
|
|
56
58
|
|
|
57
59
|
|
|
@@ -253,7 +255,7 @@ class Trim(Expression, Func):
|
|
|
253
255
|
|
|
254
256
|
|
|
255
257
|
class Unicode(Expression, Func):
|
|
256
|
-
arg_types = {"this": True, "empty_is_zero": False}
|
|
258
|
+
arg_types = {"this": True, "empty_is_zero": False, "empty_is_null": False}
|
|
257
259
|
|
|
258
260
|
|
|
259
261
|
class Upper(Expression, Func):
|
|
@@ -504,7 +504,8 @@ class TimeStrToUnix(Expression, Func):
|
|
|
504
504
|
|
|
505
505
|
|
|
506
506
|
class TimeToStr(Expression, Func):
|
|
507
|
-
|
|
507
|
+
# joda: parsed from Presto/Trino's FORMAT_DATETIME, which DATE_FORMAT can't always express
|
|
508
|
+
arg_types = {"this": True, "format": True, "culture": False, "zone": False, "joda": False}
|
|
508
509
|
|
|
509
510
|
|
|
510
511
|
class TimeToTimeStr(Expression, Func):
|
|
@@ -4116,6 +4116,18 @@ class Generator:
|
|
|
4116
4116
|
|
|
4117
4117
|
return escaped
|
|
4118
4118
|
|
|
4119
|
+
def format_sql(self, expression: exp.Format) -> str:
|
|
4120
|
+
if (
|
|
4121
|
+
expression.args.get("is_fmt")
|
|
4122
|
+
and expression.this.is_string
|
|
4123
|
+
and not expression.expressions
|
|
4124
|
+
and not any(c in expression.name for c in "{}")
|
|
4125
|
+
):
|
|
4126
|
+
return self.sql(expression.this)
|
|
4127
|
+
|
|
4128
|
+
self._warn_unsupported_arg(expression, "is_fmt")
|
|
4129
|
+
return self.function_fallback_sql(expression)
|
|
4130
|
+
|
|
4119
4131
|
def formatjson_sql(self, expression: exp.FormatJson) -> str:
|
|
4120
4132
|
return f"{self.sql(expression, 'this')} FORMAT JSON"
|
|
4121
4133
|
|
|
@@ -4474,6 +4486,10 @@ class Generator:
|
|
|
4474
4486
|
def command_sql(self, expression: exp.Command) -> str:
|
|
4475
4487
|
return f"{self.sql(expression, 'this')} {expression.text('expression').strip()}"
|
|
4476
4488
|
|
|
4489
|
+
def optimize_sql(self, expression: exp.Optimize) -> str:
|
|
4490
|
+
self.unsupported("OPTIMIZE is only supported in Databricks")
|
|
4491
|
+
return f"OPTIMIZE {self.sql(expression, 'this')}"
|
|
4492
|
+
|
|
4477
4493
|
def comment_sql(self, expression: exp.Comment) -> str:
|
|
4478
4494
|
this = self.sql(expression, "this")
|
|
4479
4495
|
kind = expression.args["kind"]
|
|
@@ -385,9 +385,9 @@ class ClickHouseGenerator(generator.Generator):
|
|
|
385
385
|
exp.Xor: lambda self, e: self.func("xor", e.this, e.expression),
|
|
386
386
|
exp.MD5Digest: rename_func("MD5"),
|
|
387
387
|
exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
|
|
388
|
-
exp.SHA:
|
|
388
|
+
exp.SHA: lambda self, e: self.func("LOWER", self.func("HEX", self.func("SHA1", e.this))),
|
|
389
389
|
exp.SHA1Digest: rename_func("SHA1"),
|
|
390
|
-
exp.SHA2: sha256_sql,
|
|
390
|
+
exp.SHA2: lambda self, e: self.func("LOWER", self.func("HEX", sha256_sql(self, e))),
|
|
391
391
|
exp.SHA2Digest: sha2_digest_sql,
|
|
392
392
|
exp.Split: lambda self, e: self.func(
|
|
393
393
|
"splitByString", e.args.get("expression"), e.this, e.args.get("limit")
|
|
@@ -212,3 +212,6 @@ class DatabricksGenerator(SparkGenerator):
|
|
|
212
212
|
def clusterproperty_sql(self, expression):
|
|
213
213
|
this = self.sql(expression, "this") or f"({self.expressions(expression, flat=True)})"
|
|
214
214
|
return f"CLUSTER BY {this}"
|
|
215
|
+
|
|
216
|
+
def optimize_sql(self, expression: exp.Optimize) -> str:
|
|
217
|
+
return f"OPTIMIZE {self.sql(expression, 'this')}"
|
|
@@ -2259,7 +2259,7 @@ class DuckDBGenerator(generator.Generator):
|
|
|
2259
2259
|
SUBSTR(h, 1, 8) || '-' ||
|
|
2260
2260
|
SUBSTR(h, 9, 4) || '-' ||
|
|
2261
2261
|
'5' || SUBSTR(h, 14, 3) || '-' ||
|
|
2262
|
-
|
|
2262
|
+
PRINTF('%02x', CAST('0x' || SUBSTR(h, 17, 2) AS INT) & 63 | 128) || SUBSTR(h, 19, 2) || '-' ||
|
|
2263
2263
|
SUBSTR(h, 21, 12)
|
|
2264
2264
|
)
|
|
2265
2265
|
FROM (
|
|
@@ -2813,32 +2813,56 @@ class DuckDBGenerator(generator.Generator):
|
|
|
2813
2813
|
|
|
2814
2814
|
def strposition_sql(self, expression: exp.StrPosition) -> str:
|
|
2815
2815
|
this = expression.this
|
|
2816
|
-
substr = expression.args
|
|
2816
|
+
substr = expression.args["substr"]
|
|
2817
2817
|
position = expression.args.get("position")
|
|
2818
|
+
clamp_position = expression.args.get("clamp_position")
|
|
2819
|
+
|
|
2820
|
+
if clamp_position and position:
|
|
2821
|
+
position = exp.If(
|
|
2822
|
+
this=exp.LTE(this=position, expression=exp.Literal.number(0)),
|
|
2823
|
+
true=exp.Literal.number(1),
|
|
2824
|
+
false=position.copy(),
|
|
2825
|
+
)
|
|
2818
2826
|
|
|
2819
2827
|
# For BINARY/BLOB: DuckDB's STRPOS doesn't support BLOB types
|
|
2820
2828
|
if _is_binary(this):
|
|
2829
|
+
haystack: exp.Expr = exp.Hex(this=this)
|
|
2830
|
+
offset: exp.Expr = exp.Literal.number(0)
|
|
2831
|
+
if position:
|
|
2832
|
+
# Bound the arithmetic too: DuckDB may fold unreachable CASE branches.
|
|
2833
|
+
limit = exp.func("COALESCE", exp.ByteLength(this=this), 0) + 1
|
|
2834
|
+
offset = exp.Least(this=position, expressions=[limit], ignore_nulls=True) - 1
|
|
2835
|
+
haystack = exp.Substring(this=haystack, start=offset * 2 + 1)
|
|
2836
|
+
|
|
2821
2837
|
# Match whole bytes, counting a two-character sentinel as the first byte.
|
|
2822
2838
|
prefix = exp.RegexpExtract(
|
|
2823
|
-
this=exp.DPipe(this=exp.Literal.string("xx"), expression=
|
|
2839
|
+
this=exp.DPipe(this=exp.Literal.string("xx"), expression=haystack),
|
|
2824
2840
|
expression=exp.DPipe(
|
|
2825
2841
|
this=exp.Literal.string("^(xx(?:..)*?)"), expression=exp.Hex(this=substr)
|
|
2826
2842
|
),
|
|
2827
2843
|
group=exp.Literal.number(1),
|
|
2828
2844
|
)
|
|
2829
|
-
|
|
2845
|
+
result: exp.Expr = exp.paren(exp.Length(this=prefix) // 2)
|
|
2846
|
+
if position:
|
|
2847
|
+
result = (
|
|
2848
|
+
exp.case()
|
|
2849
|
+
.when(
|
|
2850
|
+
exp.or_(
|
|
2851
|
+
this.is_(exp.null()), substr.is_(exp.null()), position.is_(exp.null())
|
|
2852
|
+
),
|
|
2853
|
+
exp.null(),
|
|
2854
|
+
)
|
|
2855
|
+
.when(
|
|
2856
|
+
position > exp.func("GREATEST", exp.ByteLength(this=this), 1),
|
|
2857
|
+
exp.Literal.number(0),
|
|
2858
|
+
)
|
|
2859
|
+
.else_(exp.func("COALESCE", exp.func("NULLIF", result, 0) + offset, 0))
|
|
2860
|
+
)
|
|
2861
|
+
return self.sql(result)
|
|
2830
2862
|
|
|
2831
|
-
|
|
2832
|
-
if expression.args.get("clamp_position") and position:
|
|
2863
|
+
if clamp_position and position:
|
|
2833
2864
|
expression = expression.copy()
|
|
2834
|
-
expression.set(
|
|
2835
|
-
"position",
|
|
2836
|
-
exp.If(
|
|
2837
|
-
this=exp.LTE(this=position, expression=exp.Literal.number(0)),
|
|
2838
|
-
true=exp.Literal.number(1),
|
|
2839
|
-
false=position.copy(),
|
|
2840
|
-
),
|
|
2841
|
-
)
|
|
2865
|
+
expression.set("position", position)
|
|
2842
2866
|
|
|
2843
2867
|
return strposition_sql(self, expression)
|
|
2844
2868
|
|
|
@@ -2964,6 +2988,9 @@ class DuckDBGenerator(generator.Generator):
|
|
|
2964
2988
|
return self.func("JSON", arg)
|
|
2965
2989
|
|
|
2966
2990
|
def unicode_sql(self, expression: exp.Unicode) -> str:
|
|
2991
|
+
if expression.args.get("empty_is_null"):
|
|
2992
|
+
return self.func("NULLIF", self.func("UNICODE", expression.this), "-1")
|
|
2993
|
+
|
|
2967
2994
|
if expression.args.get("empty_is_zero"):
|
|
2968
2995
|
return self.sql(
|
|
2969
2996
|
exp.case()
|
|
@@ -3920,13 +3947,13 @@ class DuckDBGenerator(generator.Generator):
|
|
|
3920
3947
|
upper = expression.args.get("upper")
|
|
3921
3948
|
|
|
3922
3949
|
if lower and upper:
|
|
3923
|
-
#
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
return self.sql(
|
|
3950
|
+
# Build 64 random bits in integer arithmetic to preserve the low bits and
|
|
3951
|
+
# avoid overflow when the inclusive range spans signed BIGINT's limits.
|
|
3952
|
+
random_bits = exp.cast(exp.Floor(this=exp.Rand() * (1 << 32)), exp.DType.INT128)
|
|
3953
|
+
random = random_bits * (1 << 32) + random_bits.copy()
|
|
3954
|
+
lower = exp.cast(lower, exp.DType.INT128)
|
|
3955
|
+
upper = exp.cast(upper, exp.DType.INT128)
|
|
3956
|
+
return self.sql(exp.cast(random % (upper - lower + 1) + lower, exp.DType.BIGINT))
|
|
3930
3957
|
|
|
3931
3958
|
# Default DuckDB behavior - just return RANDOM() as float
|
|
3932
3959
|
return "RANDOM()"
|
|
@@ -4640,10 +4667,22 @@ class DuckDBGenerator(generator.Generator):
|
|
|
4640
4667
|
return self.sql(result_expr)
|
|
4641
4668
|
|
|
4642
4669
|
def format_sql(self, expression: exp.Format) -> str:
|
|
4643
|
-
if expression.
|
|
4644
|
-
return self.func("FORMAT",
|
|
4670
|
+
if expression.args.get("is_fmt"):
|
|
4671
|
+
return self.func("FORMAT", expression.this, *expression.expressions)
|
|
4645
4672
|
|
|
4646
|
-
|
|
4673
|
+
fmt = expression.name
|
|
4674
|
+
if expression.this.is_string and fmt == "%S" and len(expression.expressions) == 1:
|
|
4675
|
+
return self.func(
|
|
4676
|
+
"UPPER", self.func("FORMAT", exp.Literal.string("{}"), expression.expressions[0])
|
|
4677
|
+
)
|
|
4678
|
+
|
|
4679
|
+
if expression.this.is_string and "%s" in fmt and "%" not in re.sub(r"%%|%s", "", fmt):
|
|
4680
|
+
# Use brace formatting to support non-string %s arguments, as in PostgreSQL.
|
|
4681
|
+
fmt = fmt.replace("{", "{{").replace("}", "}}")
|
|
4682
|
+
fmt = re.sub(r"%%|%s", lambda m: "%" if m[0] == "%%" else "{}", fmt)
|
|
4683
|
+
return self.func("FORMAT", exp.Literal.string(fmt), *expression.expressions)
|
|
4684
|
+
|
|
4685
|
+
return self.func("PRINTF", expression.this, *expression.expressions)
|
|
4647
4686
|
|
|
4648
4687
|
def hexstring_sql(
|
|
4649
4688
|
self, expression: exp.HexString, binary_function_repr: str | None = None
|
|
@@ -4795,6 +4834,17 @@ class DuckDBGenerator(generator.Generator):
|
|
|
4795
4834
|
decimals = expression.args.get("decimals")
|
|
4796
4835
|
truncate = expression.args.get("truncate")
|
|
4797
4836
|
|
|
4837
|
+
if decimals is not None and expression.args.get("negative_decimals_are_zero"):
|
|
4838
|
+
if decimals.is_int:
|
|
4839
|
+
decimals = exp.Literal.number(max(0, decimals.to_py()))
|
|
4840
|
+
else:
|
|
4841
|
+
# DuckDB's DECIMAL overload requires constant precision; SQLite rounds doubles.
|
|
4842
|
+
this = exp.cast(this, exp.DType.DOUBLE)
|
|
4843
|
+
# Preserve NULL precision, which GREATEST(decimals, 0) would replace with 0.
|
|
4844
|
+
decimals = exp.If(
|
|
4845
|
+
this=decimals < 0, true=exp.Literal.number(0), false=decimals.copy()
|
|
4846
|
+
)
|
|
4847
|
+
|
|
4798
4848
|
# DuckDB requires the scale (decimals) argument to be an INT
|
|
4799
4849
|
# Some dialects (e.g., Snowflake) allow non-integer scales and cast to an integer internally
|
|
4800
4850
|
if decimals is not None and expression.args.get("casts_non_integer_decimals"):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from sqlglot import exp
|
|
4
|
+
from sqlglot.generator import Generator
|
|
4
5
|
from sqlglot.helper import seq_get
|
|
5
6
|
from sqlglot.generators.postgres import PostgresGenerator
|
|
6
7
|
|
|
@@ -34,6 +35,9 @@ class MaterializeGenerator(PostgresGenerator):
|
|
|
34
35
|
exp.PrimaryKeyColumnConstraint: lambda self, e: "",
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
def arraysize_sql(self, expression: exp.ArraySize) -> str:
|
|
39
|
+
return Generator.arraysize_sql(self, expression)
|
|
40
|
+
|
|
37
41
|
def propertyeq_sql(self, expression: exp.PropertyEQ) -> str:
|
|
38
42
|
return self.binary(expression, "=>")
|
|
39
43
|
|
|
@@ -320,6 +320,13 @@ class PostgresGenerator(generator.Generator):
|
|
|
320
320
|
|
|
321
321
|
return sql
|
|
322
322
|
|
|
323
|
+
def arraysize_sql(self, expression: exp.ArraySize) -> str:
|
|
324
|
+
# ARRAY_LENGTH(arr, 1) returns NULL for an empty array, whereas CARDINALITY returns 0
|
|
325
|
+
if not expression.expression:
|
|
326
|
+
return self.func("CARDINALITY", expression.this)
|
|
327
|
+
|
|
328
|
+
return super().arraysize_sql(expression)
|
|
329
|
+
|
|
323
330
|
def star_sql(self, expression: exp.Star) -> str:
|
|
324
331
|
if self.STAR_EXCEPT == "EXCEPT" and expression.args.get("except_"):
|
|
325
332
|
self.unsupported("PostgreSQL does not support EXCEPT in the SELECT projection")
|