sqlglot 30.8.0__tar.gz → 30.9.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.8.0 → sqlglot-30.9.0}/CHANGELOG.md +104 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/Makefile +24 -2
- {sqlglot-30.8.0/sqlglot.egg-info → sqlglot-30.9.0}/PKG-INFO +4 -4
- {sqlglot-30.8.0 → sqlglot-30.9.0}/setup.py +1 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/_typing.py +11 -2
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/bigquery.py +10 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/dialect.py +5 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/duckdb.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/oracle.py +2 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/postgres.py +3 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/presto.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/spark.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/aggregate.py +1 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/core.py +33 -12
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/datatypes.py +17 -5
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/ddl.py +8 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/dml.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/functions.py +5 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/query.py +8 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/string.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generator.py +158 -13
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/clickhouse.py +1 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/duckdb.py +34 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/exasol.py +6 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/mysql.py +37 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/oracle.py +10 -2
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/sqlite.py +39 -10
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/tsql.py +18 -7
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/jsonpath.py +2 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/annotate_types.py +10 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/canonicalize.py +1 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/normalize.py +20 -10
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/pushdown_projections.py +12 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/simplify.py +31 -3
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/unnest_subqueries.py +10 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parser.py +121 -14
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/bigquery.py +22 -2
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/clickhouse.py +8 -3
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/duckdb.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/oracle.py +21 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/snowflake.py +14 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/spark2.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/tsql.py +72 -10
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/serde.py +1 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/tokenizer_core.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/tokens.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/__init__.py +14 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/bigquery.py +0 -9
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/duckdb.py +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/hive.py +6 -0
- sqlglot-30.9.0/sqlglot/typing/postgres.py +11 -0
- sqlglot-30.9.0/sqlglot/typing/redshift.py +17 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/snowflake.py +4 -0
- sqlglot-30.9.0/sqlglot/typing/spark2.py +81 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0/sqlglot.egg-info}/PKG-INFO +4 -4
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot.egg-info/SOURCES.txt +1 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot.egg-info/requires.txt +3 -3
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglotc/pyproject.toml +2 -2
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_bigquery.py +64 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_clickhouse.py +8 -6
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_dialect.py +12 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_duckdb.py +36 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_exasol.py +12 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_mysql.py +58 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_oracle.py +13 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_pipe_syntax.py +24 -8
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_postgres.py +41 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_spark.py +3 -3
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_sqlite.py +19 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_tsql.py +120 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/annotate_functions.sql +167 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/normalize.sql +3 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/optimizer.sql +2 -2
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/pushdown_projections.sql +16 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +7 -12
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/unnest_subqueries.sql +12 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/leakcheck.py +5 -1
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_expressions.py +6 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_jsonpath.py +8 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_optimizer.py +18 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_transpile.py +43 -0
- sqlglot-30.8.0/sqlglot/typing/redshift.py +0 -11
- sqlglot-30.8.0/sqlglot/typing/spark2.py +0 -86
- {sqlglot-30.8.0 → sqlglot-30.9.0}/.gitignore +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/.gitmodules +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/.gitpod.yml +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/AGENTS.md +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/CLAUDE.md +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/LICENSE +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/MANIFEST.in +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/README.md +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/pyproject.toml +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/setup.cfg +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/postgres.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/qualify_columns.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/sqlite.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/time.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglot.png +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_hive.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_snowflake.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/helpers.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_build.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_diff.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_docs.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_errors.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_executor.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_generator.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_helper.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_parser.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_schema.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_serde.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_time.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.8.0 → sqlglot-30.9.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,109 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.8.0] - 2026-05-13
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`6944a6c`](https://github.com/tobymao/sqlglot/commit/6944a6c3ff5a9d18f31ddab53239cbce2e702055) - Improve typing annotations for planner, schema, serde, and transforms modules *(PR [#7579](https://github.com/tobymao/sqlglot/pull/7579) by [@OutSquareCapital](https://github.com/OutSquareCapital))*:
|
|
7
|
+
|
|
8
|
+
Improve typing annotations for planner, schema, serde, and transforms modules (#7579)
|
|
9
|
+
|
|
10
|
+
- due to [`9d84348`](https://github.com/tobymao/sqlglot/commit/9d843482f1765f449dd21a4dcccff14aa0837ffe) - annotate MD5 for clickhouse *(PR [#7602](https://github.com/tobymao/sqlglot/pull/7602) by [@AbhishekASLK](https://github.com/AbhishekASLK))*:
|
|
11
|
+
|
|
12
|
+
annotate MD5 for clickhouse (#7602)
|
|
13
|
+
|
|
14
|
+
- due to [`d1147b6`](https://github.com/tobymao/sqlglot/commit/d1147b6ec3e97c55ee27fa8dc8079175328b16e3) - roundtrip for ST_MAKEPOINT / 4 parameters *(PR [#7605](https://github.com/tobymao/sqlglot/pull/7605) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
15
|
+
|
|
16
|
+
roundtrip for ST_MAKEPOINT / 4 parameters (#7605)
|
|
17
|
+
|
|
18
|
+
- due to [`4bd7d1d`](https://github.com/tobymao/sqlglot/commit/4bd7d1d02d35cc83a94d8a7ed5edbbff1d409483) - preserve NOT LIKE quantifiers during generation *(PR [#7611](https://github.com/tobymao/sqlglot/pull/7611) by [@bialkou](https://github.com/bialkou))*:
|
|
19
|
+
|
|
20
|
+
preserve NOT LIKE quantifiers during generation (#7611)
|
|
21
|
+
|
|
22
|
+
- due to [`fc6b87a`](https://github.com/tobymao/sqlglot/commit/fc6b87a3a533ab105f38f9f43abea4949de4e24e) - parse `CONVERT` into `Cast` instead of `TryCast` *(PR [#7609](https://github.com/tobymao/sqlglot/pull/7609) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
23
|
+
|
|
24
|
+
parse `CONVERT` into `Cast` instead of `TryCast` (#7609)
|
|
25
|
+
|
|
26
|
+
- due to [`b6d2c76`](https://github.com/tobymao/sqlglot/commit/b6d2c760b7cf3d965fef6d5809d87d07a1cc230a) - avoid pushdown projections for column dependent funcs *(PR [#7614](https://github.com/tobymao/sqlglot/pull/7614) by [@geooo109](https://github.com/geooo109))*:
|
|
27
|
+
|
|
28
|
+
avoid pushdown projections for column dependent funcs (#7614)
|
|
29
|
+
|
|
30
|
+
- due to [`a16f7d0`](https://github.com/tobymao/sqlglot/commit/a16f7d0aa2b5b6a505b65788d0a84bcfef4d3c8c) - disambiguate 2-arg date_add from 3-arg dateadd [CLAUDE] *(PR [#7588](https://github.com/tobymao/sqlglot/pull/7588) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*:
|
|
31
|
+
|
|
32
|
+
disambiguate 2-arg date_add from 3-arg dateadd [CLAUDE] (#7588)
|
|
33
|
+
|
|
34
|
+
- due to [`ae58fd1`](https://github.com/tobymao/sqlglot/commit/ae58fd10c33b05f4f5ae631d6b1ee0b88ba64e0a) - parse CREATE TYPE statements *(PR [#7616](https://github.com/tobymao/sqlglot/pull/7616) by [@devfros](https://github.com/devfros))*:
|
|
35
|
+
|
|
36
|
+
parse CREATE TYPE statements (#7616)
|
|
37
|
+
|
|
38
|
+
- due to [`8dcb2d3`](https://github.com/tobymao/sqlglot/commit/8dcb2d3599c5637dfa6a8438df8148d6706a5217) - register First and Last in Hive typing *(PR [#7623](https://github.com/tobymao/sqlglot/pull/7623) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*:
|
|
39
|
+
|
|
40
|
+
register First and Last in Hive typing (#7623)
|
|
41
|
+
|
|
42
|
+
- due to [`8ce7d78`](https://github.com/tobymao/sqlglot/commit/8ce7d78901994870b6569361dffaa4b9fd6dec54) - PIVOT qualify with alias + type annotation *(PR [#7586](https://github.com/tobymao/sqlglot/pull/7586) by [@geooo109](https://github.com/geooo109))*:
|
|
43
|
+
|
|
44
|
+
PIVOT qualify with alias + type annotation (#7586)
|
|
45
|
+
|
|
46
|
+
- due to [`c876570`](https://github.com/tobymao/sqlglot/commit/c8765701e0d4c87293409e5e0fe5d605f2286b3c) - roundtrip for HH12 time mapping *(PR [#7626](https://github.com/tobymao/sqlglot/pull/7626) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
47
|
+
|
|
48
|
+
roundtrip for HH12 time mapping (#7626)
|
|
49
|
+
|
|
50
|
+
- due to [`87cc106`](https://github.com/tobymao/sqlglot/commit/87cc1069e7703b77a5adde652154fcade16b8c26) - roundtrip support for CURRENT_USER_ID and USER *(PR [#7633](https://github.com/tobymao/sqlglot/pull/7633) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*:
|
|
51
|
+
|
|
52
|
+
roundtrip support for CURRENT_USER_ID and USER (#7633)
|
|
53
|
+
|
|
54
|
+
- due to [`c6615a9`](https://github.com/tobymao/sqlglot/commit/c6615a910953f8e07a9d4ec2269bb537c83f40ea) - propagate type through IgnoreNulls/RespectNulls wrappers [CLAUDE] *(PR [#7636](https://github.com/tobymao/sqlglot/pull/7636) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*:
|
|
55
|
+
|
|
56
|
+
propagate type through IgnoreNulls/RespectNulls wrappers [CLAUDE] (#7636)
|
|
57
|
+
|
|
58
|
+
- due to [`9e37283`](https://github.com/tobymao/sqlglot/commit/9e37283ab01b089c9b50b5cd59b3a1eaf24e98a1) - case-insensitive alias matching for LOCAL. prefix *(PR [#7631](https://github.com/tobymao/sqlglot/pull/7631) by [@antonireus](https://github.com/antonireus))*:
|
|
59
|
+
|
|
60
|
+
case-insensitive alias matching for LOCAL. prefix (#7631)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### :sparkles: New Features
|
|
64
|
+
- [`af5dc38`](https://github.com/tobymao/sqlglot/commit/af5dc38762552e7627e6f85e86345a5242855ed3) - **duckdb**: Add transpilation support for HEX_DECODE_STRING *(PR [#7590](https://github.com/tobymao/sqlglot/pull/7590) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
65
|
+
- [`9507aad`](https://github.com/tobymao/sqlglot/commit/9507aad7ba8ddef02adbe7fdf3098ead9c7ba1d6) - **duckdb**: Consolidate HEX_ENCODE_ into HEX function *(PR [#7603](https://github.com/tobymao/sqlglot/pull/7603) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
66
|
+
- [`9d84348`](https://github.com/tobymao/sqlglot/commit/9d843482f1765f449dd21a4dcccff14aa0837ffe) - **optimizer**: annotate MD5 for clickhouse *(PR [#7602](https://github.com/tobymao/sqlglot/pull/7602) by [@AbhishekASLK](https://github.com/AbhishekASLK))*
|
|
67
|
+
- [`ae58fd1`](https://github.com/tobymao/sqlglot/commit/ae58fd10c33b05f4f5ae631d6b1ee0b88ba64e0a) - **postgres**: parse CREATE TYPE statements *(PR [#7616](https://github.com/tobymao/sqlglot/pull/7616) by [@devfros](https://github.com/devfros))*
|
|
68
|
+
- :arrow_lower_right: *addresses issue [#7612](https://github.com/tobymao/sqlglot/issues/7612) opened by [@devfros](https://github.com/devfros)*
|
|
69
|
+
- [`80e0929`](https://github.com/tobymao/sqlglot/commit/80e0929cc1f105fbd060493ed094d4308e946063) - **parser**: handle `COLLATE` in nested types and `CAST` closes [#7624](https://github.com/tobymao/sqlglot/pull/7624) *(PR [#7630](https://github.com/tobymao/sqlglot/pull/7630) by [@georgesittas](https://github.com/georgesittas))*
|
|
70
|
+
- [`8ce7d78`](https://github.com/tobymao/sqlglot/commit/8ce7d78901994870b6569361dffaa4b9fd6dec54) - **optimizer**: PIVOT qualify with alias + type annotation *(PR [#7586](https://github.com/tobymao/sqlglot/pull/7586) by [@geooo109](https://github.com/geooo109))*
|
|
71
|
+
- [`cbd3576`](https://github.com/tobymao/sqlglot/commit/cbd3576a4b93e37148da4b93bcabe84fdd9f31c0) - **mysql**: Support `CHANGE COLUMN`. *(PR [#7638](https://github.com/tobymao/sqlglot/pull/7638) by [@burnison](https://github.com/burnison))*
|
|
72
|
+
|
|
73
|
+
### :bug: Bug Fixes
|
|
74
|
+
- [`593d5a3`](https://github.com/tobymao/sqlglot/commit/593d5a3691990182d69f2c790c8d1b3d23635502) - **redshift**: support ALL in aggregate funcs *(PR [#7592](https://github.com/tobymao/sqlglot/pull/7592) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
75
|
+
- [`b8bf13e`](https://github.com/tobymao/sqlglot/commit/b8bf13ef775551ebd1c5e4a46ca4f21bb3689679) - **redshift**: support OBJECT_TRANSFORM function *(PR [#7601](https://github.com/tobymao/sqlglot/pull/7601) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
76
|
+
- [`1206bea`](https://github.com/tobymao/sqlglot/commit/1206bea7715f3af8c6e65dbe8641002720217782) - **redshift**: parser issue for TOP N DISTINCT *(PR [#7594](https://github.com/tobymao/sqlglot/pull/7594) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
77
|
+
- [`d1147b6`](https://github.com/tobymao/sqlglot/commit/d1147b6ec3e97c55ee27fa8dc8079175328b16e3) - **redshift**: roundtrip for ST_MAKEPOINT / 4 parameters *(PR [#7605](https://github.com/tobymao/sqlglot/pull/7605) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
78
|
+
- [`b9f18ee`](https://github.com/tobymao/sqlglot/commit/b9f18eea6762f8ce03ff5a426db8195db375f455) - **sqlite**: support named CTE columns closes [#7617](https://github.com/tobymao/sqlglot/pull/7617) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
79
|
+
- [`c8b19aa`](https://github.com/tobymao/sqlglot/commit/c8b19aafe3e8b90ae7c67d816c1bedca86300192) - Parametrized bigdecimal mapping was being concatenated with params *(PR [#7584](https://github.com/tobymao/sqlglot/pull/7584) by [@themisvaltinos](https://github.com/themisvaltinos))*
|
|
80
|
+
- [`4bd7d1d`](https://github.com/tobymao/sqlglot/commit/4bd7d1d02d35cc83a94d8a7ed5edbbff1d409483) - **postgres**: preserve NOT LIKE quantifiers during generation *(PR [#7611](https://github.com/tobymao/sqlglot/pull/7611) by [@bialkou](https://github.com/bialkou))*
|
|
81
|
+
- [`fc6b87a`](https://github.com/tobymao/sqlglot/commit/fc6b87a3a533ab105f38f9f43abea4949de4e24e) - **redshift**: parse `CONVERT` into `Cast` instead of `TryCast` *(PR [#7609](https://github.com/tobymao/sqlglot/pull/7609) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
82
|
+
- [`b6d2c76`](https://github.com/tobymao/sqlglot/commit/b6d2c760b7cf3d965fef6d5809d87d07a1cc230a) - **optimizer**: avoid pushdown projections for column dependent funcs *(PR [#7614](https://github.com/tobymao/sqlglot/pull/7614) by [@geooo109](https://github.com/geooo109))*
|
|
83
|
+
- :arrow_lower_right: *fixes issue [#7607](https://github.com/tobymao/sqlglot/issues/7607) opened by [@ligfx](https://github.com/ligfx)*
|
|
84
|
+
- [`a16f7d0`](https://github.com/tobymao/sqlglot/commit/a16f7d0aa2b5b6a505b65788d0a84bcfef4d3c8c) - **databricks**: disambiguate 2-arg date_add from 3-arg dateadd [CLAUDE] *(PR [#7588](https://github.com/tobymao/sqlglot/pull/7588) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*
|
|
85
|
+
- [`6931eec`](https://github.com/tobymao/sqlglot/commit/6931eece4ec56f8b31d2026be41ebb071804adc9) - **redshift**: roundtrip fix ARRAY_CONTAINS *(PR [#7606](https://github.com/tobymao/sqlglot/pull/7606) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
86
|
+
- [`8dcb2d3`](https://github.com/tobymao/sqlglot/commit/8dcb2d3599c5637dfa6a8438df8148d6706a5217) - **annotate**: register First and Last in Hive typing *(PR [#7623](https://github.com/tobymao/sqlglot/pull/7623) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*
|
|
87
|
+
- [`a1fa154`](https://github.com/tobymao/sqlglot/commit/a1fa1546c926b2858cfc5adcfbd186731de40eba) - **parser**: from-first duckdb syntax improvement for pivot fixes [#7628](https://github.com/tobymao/sqlglot/pull/7628) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
88
|
+
- [`e7e1fb0`](https://github.com/tobymao/sqlglot/commit/e7e1fb0d3d16054c1076e9f0570b336643b371d8) - **parser**: issue with no parenthesis functions *(PR [#7621](https://github.com/tobymao/sqlglot/pull/7621) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
89
|
+
- [`b1aa0c5`](https://github.com/tobymao/sqlglot/commit/b1aa0c5fe951a6a2efb7f90c4ef2ed7a4c5ac200) - **redshift**: try_cast roundtrip *(PR [#7622](https://github.com/tobymao/sqlglot/pull/7622) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
90
|
+
- [`5525f3f`](https://github.com/tobymao/sqlglot/commit/5525f3fdec3c68ad374f39e8c30cdd38ee9b573b) - **sqlite**: prevent ALTER TABLE RENAME TO from falling back to Command *(PR [#7629](https://github.com/tobymao/sqlglot/pull/7629) by [@dedyoc](https://github.com/dedyoc))*
|
|
91
|
+
- :arrow_lower_right: *fixes issue [#7427](https://github.com/tobymao/sqlglot/issues/7427) opened by [@ppacac](https://github.com/ppacac)*
|
|
92
|
+
- [`c876570`](https://github.com/tobymao/sqlglot/commit/c8765701e0d4c87293409e5e0fe5d605f2286b3c) - **redshift**: roundtrip for HH12 time mapping *(PR [#7626](https://github.com/tobymao/sqlglot/pull/7626) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
93
|
+
- [`87cc106`](https://github.com/tobymao/sqlglot/commit/87cc1069e7703b77a5adde652154fcade16b8c26) - **redshift**: roundtrip support for CURRENT_USER_ID and USER *(PR [#7633](https://github.com/tobymao/sqlglot/pull/7633) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
94
|
+
- [`6329684`](https://github.com/tobymao/sqlglot/commit/63296846f6a7a683af21683acb24aad7a63bb3f5) - **parser**: allow WINDOW clause without FROM *(PR [#7640](https://github.com/tobymao/sqlglot/pull/7640) by [@1fanwang](https://github.com/1fanwang))*
|
|
95
|
+
- :arrow_lower_right: *fixes issue [#7438](https://github.com/tobymao/sqlglot/issues/7438) opened by [@ppacac](https://github.com/ppacac)*
|
|
96
|
+
- [`c6615a9`](https://github.com/tobymao/sqlglot/commit/c6615a910953f8e07a9d4ec2269bb537c83f40ea) - **annotate_types**: propagate type through IgnoreNulls/RespectNulls wrappers [CLAUDE] *(PR [#7636](https://github.com/tobymao/sqlglot/pull/7636) by [@RichardHughes-amp](https://github.com/RichardHughes-amp))*
|
|
97
|
+
- [`9e37283`](https://github.com/tobymao/sqlglot/commit/9e37283ab01b089c9b50b5cd59b3a1eaf24e98a1) - **exasol**: case-insensitive alias matching for LOCAL. prefix *(PR [#7631](https://github.com/tobymao/sqlglot/pull/7631) by [@antonireus](https://github.com/antonireus))*
|
|
98
|
+
|
|
99
|
+
### :recycle: Refactors
|
|
100
|
+
- [`6944a6c`](https://github.com/tobymao/sqlglot/commit/6944a6c3ff5a9d18f31ddab53239cbce2e702055) - Improve typing annotations for planner, schema, serde, and transforms modules *(PR [#7579](https://github.com/tobymao/sqlglot/pull/7579) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
|
|
101
|
+
- [`a2a9ba5`](https://github.com/tobymao/sqlglot/commit/a2a9ba59c15f63b6831674481af1ceb8420dc4de) - **schema**: cache `find` lookups in schema *(PR [#7615](https://github.com/tobymao/sqlglot/pull/7615) by [@georgesittas](https://github.com/georgesittas))*
|
|
102
|
+
- [`958b27d`](https://github.com/tobymao/sqlglot/commit/958b27d0f8f983326a5a480be3962d066f7639f3) - improve `optimizer::pushdown_predicates` typing *(PR [#7613](https://github.com/tobymao/sqlglot/pull/7613) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
|
|
103
|
+
- [`96716a6`](https://github.com/tobymao/sqlglot/commit/96716a6a2a2db13deed0749266ce449de5f9153d) - improve `optimizer::{eliminate_joins, eliminate_subqueries}` typing *(PR [#7618](https://github.com/tobymao/sqlglot/pull/7618) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
|
|
104
|
+
- [`7e7cf8b`](https://github.com/tobymao/sqlglot/commit/7e7cf8b06397ed440921d079a39112e073bcfa80) - make dialect in build_formatted_time optional, fetch it from parser *(PR [#7639](https://github.com/tobymao/sqlglot/pull/7639) by [@georgesittas](https://github.com/georgesittas))*
|
|
105
|
+
|
|
106
|
+
|
|
4
107
|
## [v30.7.0] - 2026-05-04
|
|
5
108
|
### :boom: BREAKING CHANGES
|
|
6
109
|
- due to [`68861d9`](https://github.com/tobymao/sqlglot/commit/68861d9f3aaa6c9ae405dacfa22117fb64a1d803) - support `DROP PRIMARY KEY`. *(PR [#7530](https://github.com/tobymao/sqlglot/pull/7530) by [@burnison](https://github.com/burnison))*:
|
|
@@ -14363,3 +14466,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
14363
14466
|
[v30.5.0]: https://github.com/tobymao/sqlglot/compare/v30.4.3...v30.5.0
|
|
14364
14467
|
[v30.6.0]: https://github.com/tobymao/sqlglot/compare/v30.5.0...v30.6.0
|
|
14365
14468
|
[v30.7.0]: https://github.com/tobymao/sqlglot/compare/v30.6.0...v30.7.0
|
|
14469
|
+
[v30.8.0]: https://github.com/tobymao/sqlglot/compare/v30.7.0...v30.8.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: install install-dev install-devc install-devc-release install-pre-commit bench bench-parse bench-transpile bench-optimize test test-fast unit testc unitc leakcheck style check docs docs-serve hidec showc clean resolve-integration-conflicts update-fixtures
|
|
1
|
+
.PHONY: install install-dev install-devc install-devc-release install-pre-commit bench bench-parse bench-transpile bench-optimize test test-fast test-branch unit testc unitc leakcheck style check docs docs-serve hidec showc clean resolve-integration-conflicts update-fixtures
|
|
2
2
|
|
|
3
3
|
ifdef UV
|
|
4
4
|
PIP := uv pip
|
|
@@ -81,6 +81,25 @@ test: hidec
|
|
|
81
81
|
test-fast:
|
|
82
82
|
python -m unittest --failfast
|
|
83
83
|
|
|
84
|
+
BRANCH_BASE ?= main
|
|
85
|
+
|
|
86
|
+
test-branch:
|
|
87
|
+
@changed_main=$$({ git diff origin/$(BRANCH_BASE)...HEAD --name-only 2>/dev/null; git diff HEAD --name-only; git diff --cached --name-only; } \
|
|
88
|
+
| sort -u | grep '^tests/.*\.py$$' | grep -v '__init__' | sed 's/\.py$$//' | tr '/' '.'); \
|
|
89
|
+
changed_int=$$({ git -C sqlglot-integration-tests log --name-only --format='' origin/HEAD..HEAD 2>/dev/null; git -C sqlglot-integration-tests diff HEAD --name-only 2>/dev/null; } \
|
|
90
|
+
| sort -u | grep '^tests/sqlglot/.*\.py$$' | grep -v '__init__'); \
|
|
91
|
+
if [ -z "$$changed_main" ] && [ -z "$$changed_int" ]; then \
|
|
92
|
+
echo "No test files changed vs $(BRANCH_BASE)"; exit 0; \
|
|
93
|
+
fi; \
|
|
94
|
+
if [ -n "$$changed_main" ]; then \
|
|
95
|
+
echo "Main tests:"; echo "$$changed_main" | tr ' ' '\n' | sed 's/^/ /'; \
|
|
96
|
+
python -m unittest $$changed_main || exit 1; \
|
|
97
|
+
fi; \
|
|
98
|
+
if [ -n "$$changed_int" ]; then \
|
|
99
|
+
echo "Integration tests:"; echo "$$changed_int" | tr ' ' '\n' | sed 's/^/ /'; \
|
|
100
|
+
cd sqlglot-integration-tests && PYTHONPATH=. pytest $$changed_int; \
|
|
101
|
+
fi
|
|
102
|
+
|
|
84
103
|
unit: hidec
|
|
85
104
|
trap '$(MAKE) showc' EXIT; SKIP_INTEGRATION=1 python -m unittest
|
|
86
105
|
|
|
@@ -95,7 +114,10 @@ leakcheck: install-devc
|
|
|
95
114
|
|
|
96
115
|
style:
|
|
97
116
|
pre-commit run --all-files
|
|
98
|
-
@if [ -f sqlglot-integration-tests/Makefile ]; then
|
|
117
|
+
@if [ -f sqlglot-integration-tests/Makefile ]; then \
|
|
118
|
+
MYPYPATH=$(abspath .) $(MAKE) -C sqlglot-integration-tests style && \
|
|
119
|
+
$(MAKE) -C sqlglot-integration-tests check-submodule; \
|
|
120
|
+
fi
|
|
99
121
|
|
|
100
122
|
check: style test testc
|
|
101
123
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.9.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,7 +19,7 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Provides-Extra: dev
|
|
21
21
|
Requires-Dist: duckdb>=0.6; extra == "dev"
|
|
22
|
-
Requires-Dist: sqlglot-mypy>=1.
|
|
22
|
+
Requires-Dist: sqlglot-mypy>=2.1.0.post2; python_version >= "3.10" and extra == "dev"
|
|
23
23
|
Requires-Dist: mypy; python_version < "3.10" and extra == "dev"
|
|
24
24
|
Requires-Dist: setuptools_scm; extra == "dev"
|
|
25
25
|
Requires-Dist: pandas; extra == "dev"
|
|
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
34
34
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
35
35
|
Requires-Dist: pyperf; extra == "dev"
|
|
36
36
|
Provides-Extra: c
|
|
37
|
-
Requires-Dist: sqlglotc==30.
|
|
37
|
+
Requires-Dist: sqlglotc==30.9.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.9.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -9,7 +9,7 @@ setup(
|
|
|
9
9
|
"duckdb>=0.6",
|
|
10
10
|
# sqlglot-mypy 1.20+ is the build dep for sqlglotc and only ships
|
|
11
11
|
# for py3.10+; on py3.9 just use upstream mypy for type checking.
|
|
12
|
-
"sqlglot-mypy >= 1.
|
|
12
|
+
"sqlglot-mypy >= 2.1.0.post2; python_version >= '3.10'",
|
|
13
13
|
"mypy; python_version < '3.10'",
|
|
14
14
|
"setuptools_scm",
|
|
15
15
|
"pandas",
|
|
@@ -4,9 +4,9 @@ import typing as t
|
|
|
4
4
|
from collections.abc import Mapping, Sequence
|
|
5
5
|
|
|
6
6
|
if t.TYPE_CHECKING:
|
|
7
|
-
from typing_extensions import ParamSpec
|
|
8
|
-
|
|
9
7
|
import sqlglot
|
|
8
|
+
from sqlglot import exp
|
|
9
|
+
from typing_extensions import ParamSpec
|
|
10
10
|
from sqlglot.dialects.dialect import DialectType
|
|
11
11
|
from sqlglot.errors import ErrorLevel
|
|
12
12
|
|
|
@@ -32,6 +32,15 @@ class ParserNoDialectArgs(t.TypedDict, total=False):
|
|
|
32
32
|
max_nodes: int
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
class DataTypeArgs(ParserNoDialectArgs, total=False):
|
|
36
|
+
expressions: list[exp.Expr] | None
|
|
37
|
+
nested: bool
|
|
38
|
+
values: list[exp.Expr] | None
|
|
39
|
+
kind: exp.Expr | str
|
|
40
|
+
nullable: bool
|
|
41
|
+
collate: exp.Identifier | exp.Column
|
|
42
|
+
|
|
43
|
+
|
|
35
44
|
class ParserArgs(ParserNoDialectArgs, _DialectArg, total=False):
|
|
36
45
|
pass
|
|
37
46
|
|
|
@@ -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.9.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 9, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g2f6434e2b'
|
|
@@ -72,18 +72,28 @@ class BigQuery(Dialect):
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
FORMAT_MAPPING = {
|
|
75
|
+
"dd": "%d",
|
|
75
76
|
"DD": "%d",
|
|
77
|
+
"mm": "%m",
|
|
76
78
|
"MM": "%m",
|
|
79
|
+
"mon": "%b",
|
|
77
80
|
"MON": "%b",
|
|
81
|
+
"month": "%B",
|
|
78
82
|
"MONTH": "%B",
|
|
83
|
+
"yyyy": "%Y",
|
|
79
84
|
"YYYY": "%Y",
|
|
85
|
+
"yy": "%y",
|
|
80
86
|
"YY": "%y",
|
|
81
87
|
"HH": "%I",
|
|
82
88
|
"HH12": "%I",
|
|
89
|
+
"hh24": "%H",
|
|
83
90
|
"HH24": "%H",
|
|
91
|
+
"mi": "%M",
|
|
84
92
|
"MI": "%M",
|
|
93
|
+
"ss": "%S",
|
|
85
94
|
"SS": "%S",
|
|
86
95
|
"SSSSS": "%f",
|
|
96
|
+
"tzh": "%z",
|
|
87
97
|
"TZH": "%z",
|
|
88
98
|
}
|
|
89
99
|
|
|
@@ -525,6 +525,11 @@ class Dialect(metaclass=_Dialect):
|
|
|
525
525
|
Whether ORDER BY ALL is supported (expands to all the selected columns) as in DuckDB, Spark3/Databricks
|
|
526
526
|
"""
|
|
527
527
|
|
|
528
|
+
SUPPORTS_LIMIT_ALL = False
|
|
529
|
+
"""
|
|
530
|
+
Whether LIMIT ALL is supported (equivalent to no limit) as in Postgres.
|
|
531
|
+
"""
|
|
532
|
+
|
|
528
533
|
PROJECTION_ALIASES_SHADOW_SOURCE_NAMES = False
|
|
529
534
|
"""
|
|
530
535
|
Whether projection alias names can shadow table/source names in GROUP BY and HAVING clauses.
|
|
@@ -70,6 +70,8 @@ class Oracle(Dialect):
|
|
|
70
70
|
KEYWORDS = {
|
|
71
71
|
**tokens.Tokenizer.KEYWORDS,
|
|
72
72
|
"(+)": TokenType.JOIN_MARKER,
|
|
73
|
+
# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Comparison-Conditions.html
|
|
74
|
+
"^=": TokenType.NEQ,
|
|
73
75
|
"BINARY_DOUBLE": TokenType.DOUBLE,
|
|
74
76
|
"BINARY_FLOAT": TokenType.FLOAT,
|
|
75
77
|
"BULK COLLECT INTO": TokenType.BULK_COLLECT_INTO,
|
|
@@ -5,14 +5,17 @@ from sqlglot.dialects.dialect import Dialect
|
|
|
5
5
|
from sqlglot.generators.postgres import PostgresGenerator
|
|
6
6
|
from sqlglot.parsers.postgres import PostgresParser
|
|
7
7
|
from sqlglot.tokens import TokenType
|
|
8
|
+
from sqlglot.typing.postgres import EXPRESSION_METADATA
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class Postgres(Dialect):
|
|
12
|
+
EXPRESSION_METADATA = EXPRESSION_METADATA.copy()
|
|
11
13
|
INDEX_OFFSET = 1
|
|
12
14
|
TYPED_DIVISION = True
|
|
13
15
|
CONCAT_COALESCE = True
|
|
14
16
|
CONCAT_WS_COALESCE = True
|
|
15
17
|
NULL_ORDERING = "nulls_are_large"
|
|
18
|
+
SUPPORTS_LIMIT_ALL = True
|
|
16
19
|
TIME_FORMAT = "'YYYY-MM-DD HH24:MI:SS'"
|
|
17
20
|
TABLESAMPLE_SIZE_IS_PERCENT = True
|
|
18
21
|
TABLES_REFERENCEABLE_AS_COLUMNS = True
|
|
@@ -88,6 +88,7 @@ class Expr:
|
|
|
88
88
|
_hash_raw_args: t.ClassVar[bool] = False
|
|
89
89
|
is_subquery: t.ClassVar[bool] = False
|
|
90
90
|
is_cast: t.ClassVar[bool] = False
|
|
91
|
+
is_data_type: t.ClassVar[bool] = False
|
|
91
92
|
|
|
92
93
|
args: dict[str, t.Any]
|
|
93
94
|
parent: Expr | None
|
|
@@ -837,26 +838,35 @@ class Expression(Expr):
|
|
|
837
838
|
def __hash__(self) -> int:
|
|
838
839
|
if self._hash is None:
|
|
839
840
|
nodes: list[Expr] = []
|
|
840
|
-
|
|
841
|
-
queue.append(self)
|
|
841
|
+
stack: list[Expr] = [self]
|
|
842
842
|
|
|
843
|
-
|
|
844
|
-
|
|
843
|
+
# Collect nodes, finding child expressions inline instead of via the
|
|
844
|
+
# iter_expressions generator (whose per-node generator object dominates the
|
|
845
|
+
# hash's cost). reversed(nodes) is a valid post-order regardless of DFS/BFS.
|
|
846
|
+
while stack:
|
|
847
|
+
node = stack.pop()
|
|
845
848
|
nodes.append(node)
|
|
846
849
|
|
|
847
|
-
for
|
|
848
|
-
if
|
|
849
|
-
|
|
850
|
+
for v in node.args.values():
|
|
851
|
+
if isinstance(v, Expr):
|
|
852
|
+
if v._hash is None:
|
|
853
|
+
stack.append(v)
|
|
854
|
+
elif type(v) is list:
|
|
855
|
+
for x in v:
|
|
856
|
+
if isinstance(x, Expr) and x._hash is None:
|
|
857
|
+
stack.append(x)
|
|
850
858
|
|
|
851
859
|
for node in reversed(nodes):
|
|
852
860
|
hash_ = hash(node.key)
|
|
853
861
|
|
|
854
862
|
if node._hash_raw_args:
|
|
855
|
-
for k
|
|
863
|
+
for k in sorted(node.args):
|
|
864
|
+
v = node.args[k]
|
|
856
865
|
if v:
|
|
857
866
|
hash_ = hash((hash_, k, v))
|
|
858
867
|
else:
|
|
859
|
-
for k
|
|
868
|
+
for k in sorted(node.args):
|
|
869
|
+
v = node.args[k]
|
|
860
870
|
vt = type(v)
|
|
861
871
|
|
|
862
872
|
if vt is list:
|
|
@@ -953,6 +963,8 @@ class Expression(Expr):
|
|
|
953
963
|
|
|
954
964
|
@property
|
|
955
965
|
def type(self) -> DataType | None:
|
|
966
|
+
if self.is_data_type:
|
|
967
|
+
return self # type: ignore[return-value]
|
|
956
968
|
if self.is_cast:
|
|
957
969
|
return self._type or self.to # type: ignore[attr-defined]
|
|
958
970
|
return self._type
|
|
@@ -1039,6 +1051,11 @@ class Expression(Expr):
|
|
|
1039
1051
|
return comments
|
|
1040
1052
|
|
|
1041
1053
|
def append(self, arg_key: str, value: t.Any) -> None:
|
|
1054
|
+
node: Expr | None = self
|
|
1055
|
+
while node and node._hash is not None:
|
|
1056
|
+
node._hash = None
|
|
1057
|
+
node = node.parent
|
|
1058
|
+
|
|
1042
1059
|
if type(self.args.get(arg_key)) is not list:
|
|
1043
1060
|
self.args[arg_key] = []
|
|
1044
1061
|
self._set_parent(arg_key, value)
|
|
@@ -2118,6 +2135,10 @@ class Distance(Expression, Binary):
|
|
|
2118
2135
|
pass
|
|
2119
2136
|
|
|
2120
2137
|
|
|
2138
|
+
class DistanceNd(Expression, Binary):
|
|
2139
|
+
pass
|
|
2140
|
+
|
|
2141
|
+
|
|
2121
2142
|
class Escape(Expression, Binary):
|
|
2122
2143
|
pass
|
|
2123
2144
|
|
|
@@ -2269,8 +2290,7 @@ class Or(Expression, Connector, Func):
|
|
|
2269
2290
|
|
|
2270
2291
|
|
|
2271
2292
|
class Xor(Expression, Connector, Func):
|
|
2272
|
-
arg_types = {"this":
|
|
2273
|
-
is_var_len_args = True
|
|
2293
|
+
arg_types = {"this": True, "expression": True, "round_input": False}
|
|
2274
2294
|
|
|
2275
2295
|
|
|
2276
2296
|
class Pow(Expression, Binary, Func):
|
|
@@ -2428,6 +2448,7 @@ QUERY_MODIFIERS = {
|
|
|
2428
2448
|
"settings": False,
|
|
2429
2449
|
"format": False,
|
|
2430
2450
|
"options": False,
|
|
2451
|
+
"for_": False,
|
|
2431
2452
|
}
|
|
2432
2453
|
|
|
2433
2454
|
|
|
@@ -2534,7 +2555,7 @@ def _to_s(node: t.Any, verbose: bool = False, level: int = 0, repr_str: bool = F
|
|
|
2534
2555
|
if isinstance(node, Expr):
|
|
2535
2556
|
args = {k: v for k, v in node.args.items() if (v is not None and v != []) or verbose}
|
|
2536
2557
|
|
|
2537
|
-
if (node.type or verbose) and
|
|
2558
|
+
if (node.type or verbose) and not node.is_data_type:
|
|
2538
2559
|
args["_type"] = node.type
|
|
2539
2560
|
if node.comments or verbose:
|
|
2540
2561
|
args["_comments"] = node.comments
|
|
@@ -8,6 +8,7 @@ from enum import auto
|
|
|
8
8
|
from sqlglot.helper import AutoName
|
|
9
9
|
from sqlglot.errors import ErrorLevel, ParseError
|
|
10
10
|
from sqlglot.expressions.core import (
|
|
11
|
+
Expr,
|
|
11
12
|
Expression,
|
|
12
13
|
_TimeUnit,
|
|
13
14
|
Identifier,
|
|
@@ -17,13 +18,18 @@ from sqlglot.expressions.core import (
|
|
|
17
18
|
from builtins import type as Type
|
|
18
19
|
|
|
19
20
|
if t.TYPE_CHECKING:
|
|
21
|
+
from sqlglot._typing import DataTypeArgs
|
|
20
22
|
from sqlglot.dialects.dialect import DialectType
|
|
21
|
-
from typing_extensions import Self
|
|
23
|
+
from typing_extensions import Self, Unpack
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
class DataTypeParam(Expression):
|
|
25
27
|
arg_types = {"this": True, "expression": False}
|
|
26
28
|
|
|
29
|
+
@property
|
|
30
|
+
def this(self) -> Expr:
|
|
31
|
+
return self.args["this"]
|
|
32
|
+
|
|
27
33
|
@property
|
|
28
34
|
def name(self) -> str:
|
|
29
35
|
return self.this.name
|
|
@@ -181,6 +187,8 @@ class DataType(Expression):
|
|
|
181
187
|
"collate": False,
|
|
182
188
|
}
|
|
183
189
|
|
|
190
|
+
is_data_type: t.ClassVar[bool] = True
|
|
191
|
+
|
|
184
192
|
Type: t.ClassVar[Type[DType]] = DType
|
|
185
193
|
|
|
186
194
|
STRUCT_TYPES: t.ClassVar[set[DType]] = {
|
|
@@ -331,7 +339,7 @@ class DataType(Expression):
|
|
|
331
339
|
dialect: DialectType = None,
|
|
332
340
|
udt: bool = False,
|
|
333
341
|
copy: bool = True,
|
|
334
|
-
**kwargs:
|
|
342
|
+
**kwargs: Unpack[DataTypeArgs],
|
|
335
343
|
) -> Self:
|
|
336
344
|
"""
|
|
337
345
|
Constructs a DataType object.
|
|
@@ -364,7 +372,11 @@ class DataType(Expression):
|
|
|
364
372
|
|
|
365
373
|
@classmethod
|
|
366
374
|
def from_str(
|
|
367
|
-
cls,
|
|
375
|
+
cls,
|
|
376
|
+
dtype: str,
|
|
377
|
+
dialect: DialectType = None,
|
|
378
|
+
udt: bool = False,
|
|
379
|
+
**kwargs: Unpack[DataTypeArgs],
|
|
368
380
|
) -> Self:
|
|
369
381
|
"""
|
|
370
382
|
Constructs a `DataType` object from a `str` representation.
|
|
@@ -405,10 +417,10 @@ class DataType(Expression):
|
|
|
405
417
|
Returns:
|
|
406
418
|
True, if and only if there is a type in `dtypes` which is equal to this DataType.
|
|
407
419
|
"""
|
|
408
|
-
self_is_nullable = self.args.get("nullable")
|
|
420
|
+
self_is_nullable: bool | None = self.args.get("nullable")
|
|
409
421
|
for dtype in dtypes:
|
|
410
422
|
other_type = DataType.build(dtype, copy=False, udt=True)
|
|
411
|
-
other_is_nullable = other_type.args.get("nullable")
|
|
423
|
+
other_is_nullable: bool | None = other_type.args.get("nullable")
|
|
412
424
|
if (
|
|
413
425
|
other_type.expressions
|
|
414
426
|
or (check_nullable and (self_is_nullable or other_is_nullable))
|
|
@@ -226,6 +226,14 @@ class UserDefinedFunction(Expression):
|
|
|
226
226
|
arg_types = {"this": True, "expressions": False, "wrapped": False}
|
|
227
227
|
|
|
228
228
|
|
|
229
|
+
class MacroOverloads(Expression):
|
|
230
|
+
arg_types = {"expressions": True}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class MacroOverload(Expression):
|
|
234
|
+
arg_types = {"this": True, "expressions": False, "is_table": False}
|
|
235
|
+
|
|
236
|
+
|
|
229
237
|
class CharacterSet(Expression):
|
|
230
238
|
arg_types = {"this": True, "default": False}
|
|
231
239
|
|
|
@@ -70,7 +70,7 @@ class Cast(Expression, Func):
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
class TryCast(Cast):
|
|
73
|
-
arg_types = {**Cast.arg_types, "requires_string": False}
|
|
73
|
+
arg_types = {**Cast.arg_types, "requires_string": False, "null_on_text_overflow": False}
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
class JSONCast(Cast):
|
|
@@ -436,6 +436,10 @@ class XMLElement(Expression, Func):
|
|
|
436
436
|
arg_types = {"this": True, "expressions": False, "evalname": False}
|
|
437
437
|
|
|
438
438
|
|
|
439
|
+
class GetIgnoreCase(Expression, Func):
|
|
440
|
+
arg_types = {"this": True, "expression": True}
|
|
441
|
+
|
|
442
|
+
|
|
439
443
|
class XMLGet(Expression, Func):
|
|
440
444
|
_sql_names = ["XMLGET"]
|
|
441
445
|
arg_types = {"this": True, "expression": True, "instance": False}
|
|
@@ -915,6 +915,11 @@ class QueryOption(Expression):
|
|
|
915
915
|
arg_types = {"this": True, "expression": False}
|
|
916
916
|
|
|
917
917
|
|
|
918
|
+
# FOR { XML | JSON } query modifier; `kind` is the discriminant ("XML" or "JSON").
|
|
919
|
+
class ForClause(Expression):
|
|
920
|
+
arg_types = {"kind": True, "expressions": False}
|
|
921
|
+
|
|
922
|
+
|
|
918
923
|
class WithTableHint(Expression):
|
|
919
924
|
arg_types = {"expressions": True}
|
|
920
925
|
|
|
@@ -1753,6 +1758,9 @@ class Pivot(Expression):
|
|
|
1753
1758
|
"default_on_null": False,
|
|
1754
1759
|
"into": False,
|
|
1755
1760
|
"with_": False,
|
|
1761
|
+
"identify_pivot_strings": False,
|
|
1762
|
+
"prefixed_pivot_columns": False,
|
|
1763
|
+
"pivot_column_naming": False,
|
|
1756
1764
|
}
|
|
1757
1765
|
|
|
1758
1766
|
@property
|