sqlglot 30.26.0__tar.gz → 30.27.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.26.0 → sqlglot-30.27.0}/CHANGELOG.md +67 -0
- {sqlglot-30.26.0/sqlglot.egg-info → sqlglot-30.27.0}/PKG-INFO +3 -3
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/duckdb.py +1 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/diff.py +44 -15
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/datatypes.py +1 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/sqlite.py +23 -14
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/helpers.py +15 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/merge_subqueries.py +8 -1
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/pushdown_projections.py +2 -17
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/unnest_subqueries.py +30 -12
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parser.py +9 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/duckdb.py +12 -1
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/tokenizer_core.py +1 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/tokens.py +1 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.egg-info/requires.txt +2 -2
- sqlglot-30.27.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_dialect.py +5 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_duckdb.py +15 -2
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_sqlite.py +88 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_diff.py +35 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_expressions.py +17 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_optimizer.py +0 -43
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_parser.py +63 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_schema.py +25 -0
- sqlglot-30.26.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.26.0 → sqlglot-30.27.0}/.gitignore +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/.gitmodules +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/.gitpod.yml +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/AGENTS.md +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/CLAUDE.md +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/LICENSE +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/MANIFEST.in +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/Makefile +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/README.md +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/pyproject.toml +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/setup.cfg +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/setup.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/bigquery.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/core.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/query.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generator.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/clickhouse.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/duckdb.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/postgres.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/presto.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/qualify_columns.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/clickhouse.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/snowflake.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/spark2.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/sqlite.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/time.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/bigquery.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglot.png +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_bigquery.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_clickhouse.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_hive.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_mysql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_postgres.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_snowflake.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_spark.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/helpers.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_build.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_docs.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_errors.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_executor.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_generator.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_helper.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_serde.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_time.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_transpile.py +0 -0
- {sqlglot-30.26.0 → sqlglot-30.27.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.26.0] - 2026-10-29
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`e54ad9a`](https://github.com/tobymao/sqlglot/commit/e54ad9aaedeb5e9b2be615ebd5f1ff40cfb854a2) - resolve set operation types during annotation [CODEX] *(PR [#8720](https://github.com/tobymao/sqlglot/pull/8720) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
resolve set operation types during annotation [CODEX] (#8720)
|
|
9
|
+
|
|
10
|
+
- due to [`86abcde`](https://github.com/tobymao/sqlglot/commit/86abcde38e32ddb04ab721ab0654473d51e0a783) - respect dialect `INTERSECT` precedence in set operations *(PR [#8704](https://github.com/tobymao/sqlglot/pull/8704) by [@treysp](https://github.com/treysp))*:
|
|
11
|
+
|
|
12
|
+
respect dialect `INTERSECT` precedence in set operations (#8704)
|
|
13
|
+
|
|
14
|
+
- due to [`a20a4d9`](https://github.com/tobymao/sqlglot/commit/a20a4d9e5eb3e5cf33d69148d40c25737b32d437) - parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] *(PR [#8813](https://github.com/tobymao/sqlglot/pull/8813) by [@Tyagiquamar](https://github.com/Tyagiquamar))*:
|
|
15
|
+
|
|
16
|
+
parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] (#8813)
|
|
17
|
+
|
|
18
|
+
- due to [`41287a2`](https://github.com/tobymao/sqlglot/commit/41287a2d7ff6ede9fab62fc645922957788e443b) - accept unquoted keyword identifiers *(PR [#8816](https://github.com/tobymao/sqlglot/pull/8816) by [@georgesittas](https://github.com/georgesittas))*:
|
|
19
|
+
|
|
20
|
+
accept unquoted keyword identifiers (#8816)
|
|
21
|
+
|
|
22
|
+
- due to [`a32ef63`](https://github.com/tobymao/sqlglot/commit/a32ef6365267049425dd93f45eb7af361466b854) - propagate nested unknown types *(PR [#8818](https://github.com/tobymao/sqlglot/pull/8818) by [@georgesittas](https://github.com/georgesittas))*:
|
|
23
|
+
|
|
24
|
+
propagate nested unknown types (#8818)
|
|
25
|
+
|
|
26
|
+
- due to [`70c2a84`](https://github.com/tobymao/sqlglot/commit/70c2a84001863cfb5ddf6c62ee71bc2086507e2d) - handle time format elements case-insensitively [CODEX] *(PR [#8832](https://github.com/tobymao/sqlglot/pull/8832) by [@georgesittas](https://github.com/georgesittas))*:
|
|
27
|
+
|
|
28
|
+
handle time format elements case-insensitively [CODEX] (#8832)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### :sparkles: New Features
|
|
32
|
+
- [`9943dc4`](https://github.com/tobymao/sqlglot/commit/9943dc465a01192412e595367f41f8bcecfa25a9) - **optimizer**: Fix the semi anti join qualify columns reference *(PR [#8814](https://github.com/tobymao/sqlglot/pull/8814) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
33
|
+
- [`b0842a1`](https://github.com/tobymao/sqlglot/commit/b0842a1ee0be2cc9345d7312724dbf2ee32e325a) - **parser**: support PER (...) on aggregates *(PR [#8835](https://github.com/tobymao/sqlglot/pull/8835) by [@geooo109](https://github.com/geooo109))*
|
|
34
|
+
|
|
35
|
+
### :bug: Bug Fixes
|
|
36
|
+
- [`5739cd6`](https://github.com/tobymao/sqlglot/commit/5739cd6ca80c48fa166bcd239aba651487e9081c) - **postgres**: assign named MAKE_INTERVAL arguments to their units [CLAUDE] *(PR [#8800](https://github.com/tobymao/sqlglot/pull/8800) by [@vidigoat](https://github.com/vidigoat))*
|
|
37
|
+
- [`53ccce9`](https://github.com/tobymao/sqlglot/commit/53ccce9f704a6172434eac84d399b0964fccf92c) - **postgres**: preserve anonymous MAKE_INTERVAL calls *(PR [#8801](https://github.com/tobymao/sqlglot/pull/8801) by [@georgesittas](https://github.com/georgesittas))*
|
|
38
|
+
- [`8709510`](https://github.com/tobymao/sqlglot/commit/8709510f9a097d937e3058b82ededfe703625801) - **postgres**: count unit boundaries for DATEDIFF from boundary dialects [CLAUDE] *(PR [#8802](https://github.com/tobymao/sqlglot/pull/8802) by [@vidigoat](https://github.com/vidigoat))*
|
|
39
|
+
- [`e54ad9a`](https://github.com/tobymao/sqlglot/commit/e54ad9aaedeb5e9b2be615ebd5f1ff40cfb854a2) - **optimizer**: resolve set operation types during annotation [CODEX] *(PR [#8720](https://github.com/tobymao/sqlglot/pull/8720) by [@georgesittas](https://github.com/georgesittas))*
|
|
40
|
+
- [`a4e0898`](https://github.com/tobymao/sqlglot/commit/a4e08982b678a65a3b4140f2ee30493d827c85c8) - **parser**: wrap parenthesized `VALUES` setop operands *(PR [#8803](https://github.com/tobymao/sqlglot/pull/8803) by [@treysp](https://github.com/treysp))*
|
|
41
|
+
- [`991d6ce`](https://github.com/tobymao/sqlglot/commit/991d6ce5ef300c32da83c2774fd88526d0ab667a) - **duckdb**: mark DATE_DIFF as counting unit boundaries [CLAUDE] *(PR [#8810](https://github.com/tobymao/sqlglot/pull/8810) by [@vidigoat](https://github.com/vidigoat))*
|
|
42
|
+
- [`840347f`](https://github.com/tobymao/sqlglot/commit/840347fd4bf92926337c8d118c39ef4dbf1a2131) - **duckdb**: add missing words to RESERVED_KEYWORDS *(PR [#8811](https://github.com/tobymao/sqlglot/pull/8811) by [@mikobucz](https://github.com/mikobucz))*
|
|
43
|
+
- :arrow_lower_right: *fixes issue [#8804](https://github.com/tobymao/sqlglot/issues/8804) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
44
|
+
- [`86abcde`](https://github.com/tobymao/sqlglot/commit/86abcde38e32ddb04ab721ab0654473d51e0a783) - **parser**: respect dialect `INTERSECT` precedence in set operations *(PR [#8704](https://github.com/tobymao/sqlglot/pull/8704) by [@treysp](https://github.com/treysp))*
|
|
45
|
+
- :arrow_lower_right: *fixes issue [#8390](https://github.com/tobymao/sqlglot/issues/8390) opened by [@laravioli](https://github.com/laravioli)*
|
|
46
|
+
- [`2d4b5a5`](https://github.com/tobymao/sqlglot/commit/2d4b5a5b0aea46e7f5a4fbe09c1d60fcafad76b3) - **mysql**: map TIMESTAMPADD and support transpilation *(PR [#8809](https://github.com/tobymao/sqlglot/pull/8809) by [@pranaysb](https://github.com/pranaysb))*
|
|
47
|
+
- :arrow_lower_right: *fixes issue [#8808](https://github.com/tobymao/sqlglot/issues/8808) opened by [@Shahzeb-DataEngineer](https://github.com/Shahzeb-DataEngineer)*
|
|
48
|
+
- [`a20a4d9`](https://github.com/tobymao/sqlglot/commit/a20a4d9e5eb3e5cf33d69148d40c25737b32d437) - **snowflake**: parse LOCALTIMESTAMP as CURRENT_TIMESTAMP [AGENT] *(PR [#8813](https://github.com/tobymao/sqlglot/pull/8813) by [@Tyagiquamar](https://github.com/Tyagiquamar))*
|
|
49
|
+
- :arrow_lower_right: *fixes issue [#8807](https://github.com/tobymao/sqlglot/issues/8807) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
50
|
+
- [`41287a2`](https://github.com/tobymao/sqlglot/commit/41287a2d7ff6ede9fab62fc645922957788e443b) - **snowflake**: accept unquoted keyword identifiers *(PR [#8816](https://github.com/tobymao/sqlglot/pull/8816) by [@georgesittas](https://github.com/georgesittas))*
|
|
51
|
+
- :arrow_lower_right: *fixes issue [#8805](https://github.com/tobymao/sqlglot/issues/8805) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
52
|
+
- [`3cca3ea`](https://github.com/tobymao/sqlglot/commit/3cca3ea47592c84b23636aff196ca0bbaf4f1905) - preserve timestamp arithmetic semantics *(PR [#8815](https://github.com/tobymao/sqlglot/pull/8815) by [@georgesittas](https://github.com/georgesittas))*
|
|
53
|
+
- [`e88e67e`](https://github.com/tobymao/sqlglot/commit/e88e67e6c8f5fe8992419f6920dac66cca8f12a8) - **snowflake**: preserve date truncation types in DuckDB *(PR [#8817](https://github.com/tobymao/sqlglot/pull/8817) by [@georgesittas](https://github.com/georgesittas))*
|
|
54
|
+
- :arrow_lower_right: *fixes issue [#8806](https://github.com/tobymao/sqlglot/issues/8806) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
55
|
+
- [`a32ef63`](https://github.com/tobymao/sqlglot/commit/a32ef6365267049425dd93f45eb7af361466b854) - **optimizer**: propagate nested unknown types *(PR [#8818](https://github.com/tobymao/sqlglot/pull/8818) by [@georgesittas](https://github.com/georgesittas))*
|
|
56
|
+
- [`13a570c`](https://github.com/tobymao/sqlglot/commit/13a570c6f790a6140c9c9ae004914b081beb7ae6) - **oracle**: preserve end of month in ADD_MONTHS closes [#8824](https://github.com/tobymao/sqlglot/pull/8824) [CLAUDE] *(PR [#8825](https://github.com/tobymao/sqlglot/pull/8825) by [@pandasuwu](https://github.com/pandasuwu))*
|
|
57
|
+
- :arrow_lower_right: *fixes issue [#8824](https://github.com/tobymao/sqlglot/issues/8824) opened by [@pandasuwu](https://github.com/pandasuwu)*
|
|
58
|
+
- [`a07698a`](https://github.com/tobymao/sqlglot/commit/a07698a741dde560a820211cb4a2539856edb349) - **snowflake**: preserve default LISTAGG separator [CODEX] *(PR [#8823](https://github.com/tobymao/sqlglot/pull/8823) by [@Ychris12138](https://github.com/Ychris12138))*
|
|
59
|
+
- :arrow_lower_right: *fixes issue [#8819](https://github.com/tobymao/sqlglot/issues/8819) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
60
|
+
- [`e2a8b65`](https://github.com/tobymao/sqlglot/commit/e2a8b6589504793decb69d00158f728b6d3772ec) - **snowflake**: support COPY TAGS in CREATE TABLE *(PR [#8822](https://github.com/tobymao/sqlglot/pull/8822) by [@ramitmittal](https://github.com/ramitmittal))*
|
|
61
|
+
- [`ab04347`](https://github.com/tobymao/sqlglot/commit/ab043477f777af312efc29b419eb14f0c385fef7) - **spark**: parse LISTAGG through _parse_string_agg *(PR [#8829](https://github.com/tobymao/sqlglot/pull/8829) by [@Tyagiquamar](https://github.com/Tyagiquamar))*
|
|
62
|
+
- :arrow_lower_right: *fixes issue [#8828](https://github.com/tobymao/sqlglot/issues/8828) opened by [@rahul05ranjan](https://github.com/rahul05ranjan)*
|
|
63
|
+
- [`7c9dbb9`](https://github.com/tobymao/sqlglot/commit/7c9dbb91e9e252e2d47840ea4cb63caf8f4d6a12) - **tsql**: don't crash in qualify_derived_table_outputs for a CTE with a non-query body *(PR [#8827](https://github.com/tobymao/sqlglot/pull/8827) by [@rahul05ranjan](https://github.com/rahul05ranjan))*
|
|
64
|
+
- :arrow_lower_right: *fixes issue [#8826](https://github.com/tobymao/sqlglot/issues/8826) opened by [@rahul05ranjan](https://github.com/rahul05ranjan)*
|
|
65
|
+
- [`2748f82`](https://github.com/tobymao/sqlglot/commit/2748f82ec5bf895f2055e60c8e90e132079bc532) - **parser**: accept ALL in string aggregation *(PR [#8831](https://github.com/tobymao/sqlglot/pull/8831) by [@georgesittas](https://github.com/georgesittas))*
|
|
66
|
+
- [`70c2a84`](https://github.com/tobymao/sqlglot/commit/70c2a84001863cfb5ddf6c62ee71bc2086507e2d) - **snowflake**: handle time format elements case-insensitively [CODEX] *(PR [#8832](https://github.com/tobymao/sqlglot/pull/8832) by [@georgesittas](https://github.com/georgesittas))*
|
|
67
|
+
- :arrow_lower_right: *fixes issue [#8820](https://github.com/tobymao/sqlglot/issues/8820) opened by [@THEtheChad](https://github.com/THEtheChad)*
|
|
68
|
+
|
|
69
|
+
|
|
4
70
|
## [v30.25.0] - 2026-10-26
|
|
5
71
|
### :boom: BREAKING CHANGES
|
|
6
72
|
- due to [`c90a322`](https://github.com/tobymao/sqlglot/commit/c90a322c329d2b1003bf73b848f0d9e17f1a3d67) - support non-identifier column parts in compiled code *(PR [#8710](https://github.com/tobymao/sqlglot/pull/8710) by [@georgesittas](https://github.com/georgesittas))*:
|
|
@@ -16493,3 +16559,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
16493
16559
|
[v30.23.0]: https://github.com/tobymao/sqlglot/compare/v30.22.0...v30.23.0
|
|
16494
16560
|
[v30.24.0]: https://github.com/tobymao/sqlglot/compare/v30.23.0...v30.24.0
|
|
16495
16561
|
[v30.25.0]: https://github.com/tobymao/sqlglot/compare/v30.24.0...v30.25.0
|
|
16562
|
+
[v30.26.0]: https://github.com/tobymao/sqlglot/compare/v30.25.0...v30.26.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.27.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.27.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.27.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.27.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 27, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g98782638d'
|
|
@@ -201,11 +201,22 @@ class ChangeDistiller:
|
|
|
201
201
|
|
|
202
202
|
def _generate_edit_script(self, matchings: dict[int, int], delta_only: bool) -> list[Edit]:
|
|
203
203
|
edit_script: list[Edit] = []
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
|
|
205
|
+
# The unmatched node sets and the matching set are keyed by id(), so iterating them
|
|
206
|
+
# directly orders the edits by object address, which varies between processes. The
|
|
207
|
+
# node indexes are built from bfs(), so iterating those instead keeps the edit script
|
|
208
|
+
# in a stable, tree-order sequence.
|
|
209
|
+
for removed_node_id in self._source_index:
|
|
210
|
+
if removed_node_id in self._unmatched_source_nodes:
|
|
211
|
+
edit_script.append(Remove(self._source_index[removed_node_id]))
|
|
212
|
+
for inserted_node_id in self._target_index:
|
|
213
|
+
if inserted_node_id in self._unmatched_target_nodes:
|
|
214
|
+
edit_script.append(Insert(self._target_index[inserted_node_id]))
|
|
215
|
+
for kept_source_node_id in self._source_index:
|
|
216
|
+
kept_target_node_id = matchings.get(kept_source_node_id)
|
|
217
|
+
if kept_target_node_id is None:
|
|
218
|
+
continue
|
|
219
|
+
|
|
209
220
|
source_node = self._source_index[kept_source_node_id]
|
|
210
221
|
target_node = self._target_index[kept_target_node_id]
|
|
211
222
|
|
|
@@ -266,6 +277,10 @@ class ChangeDistiller:
|
|
|
266
277
|
leaves_matching_set = self._compute_leaf_matching_set()
|
|
267
278
|
matching_set = leaves_matching_set.copy()
|
|
268
279
|
|
|
280
|
+
matched_target_leaves: dict[int, list[int]] = defaultdict(list)
|
|
281
|
+
for source_leaf_id, target_leaf_id in leaves_matching_set:
|
|
282
|
+
matched_target_leaves[source_leaf_id].append(target_leaf_id)
|
|
283
|
+
|
|
269
284
|
ordered_unmatched_source_nodes = {
|
|
270
285
|
id(n): None for n in self._source.bfs() if id(n) in self._unmatched_source_nodes
|
|
271
286
|
}
|
|
@@ -273,27 +288,40 @@ class ChangeDistiller:
|
|
|
273
288
|
id(n): None for n in self._target.bfs() if id(n) in self._unmatched_target_nodes
|
|
274
289
|
}
|
|
275
290
|
|
|
291
|
+
target_leaf_ids_cache: dict[int, set[int]] = {}
|
|
292
|
+
|
|
276
293
|
for source_node_id in ordered_unmatched_source_nodes:
|
|
294
|
+
source_node = self._source_index[source_node_id]
|
|
295
|
+
source_leaf_ids = None
|
|
296
|
+
|
|
277
297
|
for target_node_id in ordered_unmatched_target_nodes:
|
|
278
|
-
source_node = self._source_index[source_node_id]
|
|
279
298
|
target_node = self._target_index[target_node_id]
|
|
280
299
|
if _is_same_type(source_node, target_node):
|
|
281
|
-
source_leaf_ids
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
300
|
+
if source_leaf_ids is None:
|
|
301
|
+
source_leaf_ids = {id(l) for l in _get_expression_leaves(source_node)}
|
|
302
|
+
source_leaves_num = len(source_leaf_ids)
|
|
303
|
+
candidate_target_leaf_ids = [
|
|
304
|
+
target_leaf_id
|
|
305
|
+
for source_leaf_id in source_leaf_ids
|
|
306
|
+
for target_leaf_id in matched_target_leaves.get(source_leaf_id, ())
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
target_leaf_ids = target_leaf_ids_cache.get(target_node_id)
|
|
310
|
+
if target_leaf_ids is None:
|
|
311
|
+
target_leaf_ids = {id(l) for l in _get_expression_leaves(target_node)}
|
|
312
|
+
target_leaf_ids_cache[target_node_id] = target_leaf_ids
|
|
313
|
+
|
|
314
|
+
target_leaves_num = len(target_leaf_ids)
|
|
315
|
+
max_leaves_num = max(source_leaves_num, target_leaves_num)
|
|
285
316
|
if max_leaves_num:
|
|
286
317
|
common_leaves_num = sum(
|
|
287
|
-
1
|
|
288
|
-
for s, t in leaves_matching_set
|
|
318
|
+
1 for t in candidate_target_leaf_ids if t in target_leaf_ids
|
|
289
319
|
)
|
|
290
320
|
leaf_similarity_score = common_leaves_num / max_leaves_num
|
|
291
321
|
else:
|
|
292
322
|
leaf_similarity_score = 0.0
|
|
293
323
|
|
|
294
|
-
adjusted_t = (
|
|
295
|
-
self.t if min(len(source_leaf_ids), len(target_leaf_ids)) > 4 else 0.4
|
|
296
|
-
)
|
|
324
|
+
adjusted_t = self.t if min(source_leaves_num, target_leaves_num) > 4 else 0.4
|
|
297
325
|
|
|
298
326
|
if leaf_similarity_score >= 0.8 or (
|
|
299
327
|
leaf_similarity_score >= adjusted_t
|
|
@@ -303,6 +331,7 @@ class ChangeDistiller:
|
|
|
303
331
|
self._unmatched_source_nodes.remove(source_node_id)
|
|
304
332
|
self._unmatched_target_nodes.remove(target_node_id)
|
|
305
333
|
ordered_unmatched_target_nodes.pop(target_node_id, None)
|
|
334
|
+
target_leaf_ids_cache.pop(target_node_id, None)
|
|
306
335
|
break
|
|
307
336
|
|
|
308
337
|
return matching_set
|
|
@@ -81,19 +81,6 @@ def _generated_to_auto_increment(expression: exp.Expr) -> exp.Expr:
|
|
|
81
81
|
return expression
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
def _offset_to_limit(expression: exp.Expr) -> exp.Expr:
|
|
85
|
-
if not isinstance(expression, exp.Select):
|
|
86
|
-
return expression
|
|
87
|
-
|
|
88
|
-
offset = expression.args.get("offset")
|
|
89
|
-
limit = expression.args.get("limit")
|
|
90
|
-
|
|
91
|
-
if offset and (not limit or (isinstance(limit, exp.Limit) and limit.is_limit_all)):
|
|
92
|
-
expression.limit(-1, copy=False)
|
|
93
|
-
|
|
94
|
-
return expression
|
|
95
|
-
|
|
96
|
-
|
|
97
84
|
class SQLiteGenerator(generator.Generator):
|
|
98
85
|
SELECT_KINDS: tuple[str, ...] = ()
|
|
99
86
|
TRY_SUPPORTED = False
|
|
@@ -173,7 +160,6 @@ class SQLiteGenerator(generator.Generator):
|
|
|
173
160
|
exp.RegexpLike: lambda self, e: self.binary(e, "REGEXP"),
|
|
174
161
|
exp.Select: transforms.preprocess(
|
|
175
162
|
[
|
|
176
|
-
_offset_to_limit,
|
|
177
163
|
transforms.eliminate_distinct_on,
|
|
178
164
|
transforms.eliminate_qualify,
|
|
179
165
|
transforms.eliminate_semi_and_anti_joins,
|
|
@@ -204,6 +190,29 @@ class SQLiteGenerator(generator.Generator):
|
|
|
204
190
|
|
|
205
191
|
LIMIT_FETCH = "LIMIT"
|
|
206
192
|
|
|
193
|
+
def offset_limit_modifiers(
|
|
194
|
+
self, expression: exp.Expr, fetch: bool, limit: exp.Fetch | exp.Limit | None
|
|
195
|
+
) -> list[str]:
|
|
196
|
+
if expression.args.get("offset") and (
|
|
197
|
+
not limit or (isinstance(limit, exp.Limit) and limit.is_limit_all)
|
|
198
|
+
):
|
|
199
|
+
limit = exp.Limit(expression=exp.Literal.number(-1))
|
|
200
|
+
return super().offset_limit_modifiers(expression, fetch, limit)
|
|
201
|
+
|
|
202
|
+
def subquery_sql(self, expression: exp.Subquery, sep: str = " AS ") -> str:
|
|
203
|
+
if any(expression.args.get(key) for key in ("order", "limit", "offset")):
|
|
204
|
+
query = expression.this
|
|
205
|
+
keys = ("order", "limit", "offset", "with_")
|
|
206
|
+
# Merge grouping modifiers unless doing so would overwrite an inner clause.
|
|
207
|
+
if any(expression.args.get(key) and query.args.get(key) for key in keys):
|
|
208
|
+
query = exp.select("*").from_(query.subquery(copy=False), copy=False)
|
|
209
|
+
for key in keys:
|
|
210
|
+
if value := expression.args.get(key):
|
|
211
|
+
query.set(key, value.pop())
|
|
212
|
+
return self.sql(query)
|
|
213
|
+
|
|
214
|
+
return super().subquery_sql(expression, sep=sep)
|
|
215
|
+
|
|
207
216
|
def autoincrementcolumnconstraint_sql(
|
|
208
217
|
self, expression: exp.AutoIncrementColumnConstraint
|
|
209
218
|
) -> str:
|
|
@@ -6,6 +6,21 @@ from sqlglot.optimizer.scope import find_in_scope, walk_in_scope
|
|
|
6
6
|
WINDOW_HAS_AGGREGATE = "window_has_aggregate"
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
def is_implicit_group_by_all(select: exp.Select) -> bool:
|
|
10
|
+
"""Bare GROUP BY ALL infers its keys from the SELECT list, unlike ALL as a
|
|
11
|
+
grouping-sets modifier (e.g. GROUP BY ALL CUBE (...) or GROUP BY ALL a, b)."""
|
|
12
|
+
group = select.args.get("group")
|
|
13
|
+
if not group or not group.args.get("all"):
|
|
14
|
+
return False
|
|
15
|
+
|
|
16
|
+
return not (
|
|
17
|
+
group.expressions
|
|
18
|
+
or group.args.get("cube")
|
|
19
|
+
or group.args.get("rollup")
|
|
20
|
+
or group.args.get("grouping_sets")
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
9
24
|
def projection_has_aggregate(
|
|
10
25
|
projection: exp.Expr,
|
|
11
26
|
windows: list[exp.Window] | None = None,
|
|
@@ -6,6 +6,7 @@ from collections import Counter, defaultdict
|
|
|
6
6
|
|
|
7
7
|
from sqlglot import expressions as exp
|
|
8
8
|
from sqlglot.helper import find_new_name, seq_get
|
|
9
|
+
from sqlglot.optimizer.helpers import is_implicit_group_by_all
|
|
9
10
|
from sqlglot.optimizer.scope import Scope, find_all_in_scope, traverse_scope
|
|
10
11
|
|
|
11
12
|
if t.TYPE_CHECKING:
|
|
@@ -233,7 +234,10 @@ def _mergeable(
|
|
|
233
234
|
def _window_projection_blocks_merge(window_aliases: set[str]) -> bool:
|
|
234
235
|
"""A window function's result depends on the full row set it sees, so merging the
|
|
235
236
|
subquery into the outer query is unsafe when:
|
|
236
|
-
- the outer query filters or joins (WHERE/JOIN), which changes that row set,
|
|
237
|
+
- the outer query filters or joins (WHERE/JOIN), which changes that row set,
|
|
238
|
+
- the outer query is a bare GROUP BY ALL, which implicitly groups by every
|
|
239
|
+
projection (unlike ALL as a grouping-sets modifier, e.g. GROUP BY ALL
|
|
240
|
+
CUBE (...)), or
|
|
237
241
|
- a window column is referenced in an operation that isn't pushed down
|
|
238
242
|
(GROUP BY, ORDER BY, HAVING, aggregate).
|
|
239
243
|
"""
|
|
@@ -243,6 +247,9 @@ def _mergeable(
|
|
|
243
247
|
if outer_args.get("where") or outer_args.get("joins"):
|
|
244
248
|
return True
|
|
245
249
|
|
|
250
|
+
if is_implicit_group_by_all(t.cast(exp.Select, outer)):
|
|
251
|
+
return True
|
|
252
|
+
|
|
246
253
|
return any(
|
|
247
254
|
column.table == inner_name
|
|
248
255
|
and column.name in window_aliases
|
|
@@ -6,7 +6,7 @@ from collections import defaultdict, deque
|
|
|
6
6
|
from sqlglot import alias, exp
|
|
7
7
|
from sqlglot.errors import OptimizeError
|
|
8
8
|
from sqlglot.helper import seq_get
|
|
9
|
-
from sqlglot.optimizer.helpers import projection_has_aggregate
|
|
9
|
+
from sqlglot.optimizer.helpers import is_implicit_group_by_all, projection_has_aggregate
|
|
10
10
|
from sqlglot.optimizer.journal import Journal, record
|
|
11
11
|
from sqlglot.optimizer.scope import Scope, find_all_in_scope, traverse_scope
|
|
12
12
|
|
|
@@ -294,7 +294,7 @@ def projection_reachability(
|
|
|
294
294
|
|
|
295
295
|
if isinstance(query, exp.Select):
|
|
296
296
|
windows = query.args.get("windows")
|
|
297
|
-
group_all =
|
|
297
|
+
group_all = is_implicit_group_by_all(query)
|
|
298
298
|
group_by_ordinals[scope] = _group_by_ordinal_refs(query)
|
|
299
299
|
ordinals = {id(s) for _, s in group_by_ordinals[scope]}
|
|
300
300
|
first_aggregate: DependencyNode | None = None
|
|
@@ -558,21 +558,6 @@ def default_selection(is_agg: bool) -> exp.Alias:
|
|
|
558
558
|
return alias(exp.Max(this=exp.Literal.number(1)) if is_agg else "1", "_").assert_is(exp.Alias)
|
|
559
559
|
|
|
560
560
|
|
|
561
|
-
def _is_implicit_group_by_all(select: exp.Select) -> bool:
|
|
562
|
-
"""Bare GROUP BY ALL infers its keys from the SELECT list, unlike ALL as a
|
|
563
|
-
grouping-sets modifier (e.g. GROUP BY ALL CUBE (...) or GROUP BY ALL a, b)."""
|
|
564
|
-
group = select.args.get("group")
|
|
565
|
-
if not group or not group.args.get("all"):
|
|
566
|
-
return False
|
|
567
|
-
|
|
568
|
-
return not (
|
|
569
|
-
group.expressions
|
|
570
|
-
or group.args.get("cube")
|
|
571
|
-
or group.args.get("rollup")
|
|
572
|
-
or group.args.get("grouping_sets")
|
|
573
|
-
)
|
|
574
|
-
|
|
575
|
-
|
|
576
561
|
def _group_by_ordinal_refs(
|
|
577
562
|
select: exp.Select,
|
|
578
563
|
) -> list[tuple[exp.Literal, exp.Expr]]:
|
|
@@ -97,18 +97,7 @@ def unnest(select, parent_select, next_alias_name):
|
|
|
97
97
|
or any(find_in_scope(select, exp.AggFunc) for select in parent_select.selects)
|
|
98
98
|
)
|
|
99
99
|
):
|
|
100
|
-
|
|
101
|
-
# A window aggregate can still need a grouped MAX in its argument.
|
|
102
|
-
while (
|
|
103
|
-
not isinstance(ancestor, exp.Query)
|
|
104
|
-
and ancestor.parent
|
|
105
|
-
and ancestor.arg_key == "this"
|
|
106
|
-
and not isinstance(ancestor.parent, (exp.Func, exp.Window))
|
|
107
|
-
):
|
|
108
|
-
ancestor = ancestor.parent
|
|
109
|
-
if isinstance(ancestor, exp.Select) or (
|
|
110
|
-
ancestor.arg_key == "this" and isinstance(ancestor.parent, exp.Window)
|
|
111
|
-
):
|
|
100
|
+
if _is_post_aggregation(select, parent_select):
|
|
112
101
|
column = exp.Max(this=column)
|
|
113
102
|
elif not isinstance(select.parent, exp.Subquery):
|
|
114
103
|
return
|
|
@@ -247,6 +236,11 @@ def decorrelate(select, parent_select, external_columns, next_alias_name):
|
|
|
247
236
|
elif not _is_plain_group(group):
|
|
248
237
|
return
|
|
249
238
|
|
|
239
|
+
# Joined columns may not be grouped, so keep post-group subqueries correlated.
|
|
240
|
+
parent_group = parent_select.args.get("group")
|
|
241
|
+
if parent_group and _is_post_aggregation(select, parent_select):
|
|
242
|
+
return
|
|
243
|
+
|
|
250
244
|
table_alias = next_alias_name()
|
|
251
245
|
keys = []
|
|
252
246
|
eq_count = 0
|
|
@@ -488,6 +482,30 @@ def _is_plain_group(group: exp.Group) -> bool:
|
|
|
488
482
|
)
|
|
489
483
|
|
|
490
484
|
|
|
485
|
+
def _is_post_aggregation(expression: exp.Expr, select: exp.Select) -> bool:
|
|
486
|
+
# The nearest ordinary aggregate consumes input rows, even inside a window.
|
|
487
|
+
# A window aggregate consumes post-group rows.
|
|
488
|
+
ancestor = expression.find_ancestor(exp.AggFunc, exp.Filter, exp.Select)
|
|
489
|
+
if isinstance(ancestor, exp.Filter):
|
|
490
|
+
ancestor = ancestor.this.unnest()
|
|
491
|
+
if isinstance(ancestor, exp.AggFunc):
|
|
492
|
+
# Look through FILTER, IGNORE NULLS and parentheses for an enclosing window.
|
|
493
|
+
while (
|
|
494
|
+
ancestor.parent is not select
|
|
495
|
+
and ancestor.parent
|
|
496
|
+
and ancestor.arg_key == "this"
|
|
497
|
+
and not isinstance(ancestor.parent, (exp.Func, exp.Window))
|
|
498
|
+
):
|
|
499
|
+
ancestor = ancestor.parent
|
|
500
|
+
if not (ancestor.arg_key == "this" and isinstance(ancestor.parent, exp.Window)):
|
|
501
|
+
return False
|
|
502
|
+
|
|
503
|
+
node: exp.Expr | None = expression
|
|
504
|
+
while node is not None and node.parent is not select:
|
|
505
|
+
node = node.parent
|
|
506
|
+
return node is not None and node.arg_key not in ("with_", "from_", "laterals", "joins", "where")
|
|
507
|
+
|
|
508
|
+
|
|
491
509
|
def _has_aggregate_projection(select: exp.Select) -> bool:
|
|
492
510
|
windows = select.args.get("windows")
|
|
493
511
|
|
|
@@ -646,6 +646,7 @@ class Parser:
|
|
|
646
646
|
TokenType.VOID,
|
|
647
647
|
TokenType.OBJECT,
|
|
648
648
|
TokenType.OBJECT_IDENTIFIER,
|
|
649
|
+
TokenType.REF,
|
|
649
650
|
TokenType.INET,
|
|
650
651
|
TokenType.IPADDRESS,
|
|
651
652
|
TokenType.IPPREFIX,
|
|
@@ -799,6 +800,7 @@ class Parser:
|
|
|
799
800
|
TokenType.FULL,
|
|
800
801
|
TokenType.GET,
|
|
801
802
|
TokenType.IDENTIFIER,
|
|
803
|
+
TokenType.IN,
|
|
802
804
|
TokenType.INOUT,
|
|
803
805
|
TokenType.IS,
|
|
804
806
|
TokenType.ISNULL,
|
|
@@ -6869,6 +6871,13 @@ class Parser:
|
|
|
6869
6871
|
return this
|
|
6870
6872
|
elif type_token in self.ENUM_TYPE_TOKENS:
|
|
6871
6873
|
expressions = self._parse_csv(self._parse_equality)
|
|
6874
|
+
elif type_token == TokenType.REF:
|
|
6875
|
+
# REF(schema.customer) names a target; REF(1) can still be a function call.
|
|
6876
|
+
target = self._try_parse(lambda: self._parse_table_parts(schema=True))
|
|
6877
|
+
if target is None:
|
|
6878
|
+
self._retreat(index)
|
|
6879
|
+
return None
|
|
6880
|
+
expressions = [target]
|
|
6872
6881
|
elif type_token == TokenType.JSON:
|
|
6873
6882
|
# ClickHouse JSON type supports arguments: JSON(col Type, SKIP col, param=value)
|
|
6874
6883
|
# https://clickhouse.com/docs/sql-reference/data-types/newjson
|
|
@@ -105,6 +105,10 @@ def _convert_text_type(dtype: exp.DataType) -> exp.DataType:
|
|
|
105
105
|
return dtype
|
|
106
106
|
|
|
107
107
|
|
|
108
|
+
_parse_regexp_like = binary_range_parser(exp.RegexpLike)
|
|
109
|
+
_parse_regexp_full_match = binary_range_parser(exp.RegexpFullMatch)
|
|
110
|
+
|
|
111
|
+
|
|
108
112
|
class DuckDBParser(parser.Parser):
|
|
109
113
|
IS_PREDICATE_PRECEDENCE = IsPredicatePrecedence.LOW
|
|
110
114
|
|
|
@@ -139,7 +143,7 @@ class DuckDBParser(parser.Parser):
|
|
|
139
143
|
RANGE_PARSERS = {
|
|
140
144
|
**parser.Parser.RANGE_PARSERS,
|
|
141
145
|
TokenType.DAMP: binary_range_parser(exp.ArrayOverlaps),
|
|
142
|
-
TokenType.TILDE:
|
|
146
|
+
TokenType.TILDE: lambda self, this: self._parse_tilde(this),
|
|
143
147
|
}
|
|
144
148
|
|
|
145
149
|
EXPONENT = {
|
|
@@ -312,6 +316,13 @@ class DuckDBParser(parser.Parser):
|
|
|
312
316
|
SHOW_TRIE = new_trie(key.split(" ") for key in SHOW_PARSERS)
|
|
313
317
|
SET_TRIE = new_trie(key.split(" ") for key in SET_PARSERS)
|
|
314
318
|
|
|
319
|
+
def _parse_tilde(self, this: exp.Expr | None) -> exp.Expr | None:
|
|
320
|
+
# ~ and !~ match anywhere in the string since DuckDB 2.0, and the whole string before it
|
|
321
|
+
# https://duckdb.org/docs/2.0/sql/functions/pattern_matching
|
|
322
|
+
if self.dialect.version >= (2, 0):
|
|
323
|
+
return _parse_regexp_like(self, this)
|
|
324
|
+
return _parse_regexp_full_match(self, this)
|
|
325
|
+
|
|
315
326
|
def _parse_trigger_execute(self) -> exp.Expr | None:
|
|
316
327
|
body = self._try_parse(self._parse_statement)
|
|
317
328
|
return body if not self._curr else None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.27.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.27.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.27.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -3999,6 +3999,11 @@ FROM subquery2""",
|
|
|
3999
3999
|
"""SELECT partition.d FROM t PARTITION (d)""",
|
|
4000
4000
|
"""SELECT partition.d FROM t AS PARTITION(d)""",
|
|
4001
4001
|
)
|
|
4002
|
+
self.validate_identity("CREATE TABLE abc.s.in AS SELECT 1 AS n")
|
|
4003
|
+
self.validate_identity(
|
|
4004
|
+
"WITH in AS (SELECT 1 AS in) SELECT in FROM in WHERE in IN (1, 2) AND in NOT IN (3, 4)",
|
|
4005
|
+
"WITH in AS (SELECT 1 AS in) SELECT in FROM in WHERE in IN (1, 2) AND NOT in IN (3, 4)",
|
|
4006
|
+
)
|
|
4002
4007
|
|
|
4003
4008
|
def test_string_functions(self):
|
|
4004
4009
|
for pad_func in ("LPAD", "RPAD"):
|
|
@@ -866,6 +866,7 @@ class TestDuckDB(Validator):
|
|
|
866
866
|
self.validate_identity("'red' IN tbl.flags")
|
|
867
867
|
self.validate_identity("CREATE TABLE tbl1 (u UNION(num INT, str TEXT))")
|
|
868
868
|
self.validate_identity("INSERT INTO x BY NAME SELECT 1 AS y")
|
|
869
|
+
self.validate_identity("INSERT INTO abc.s.sort BY NAME SELECT 1 AS n")
|
|
869
870
|
self.validate_identity("SELECT 1 AS x UNION ALL BY NAME SELECT 2 AS x")
|
|
870
871
|
self.validate_identity("SELECT SUM(x) FILTER (x = 1)", "SELECT SUM(x) FILTER(WHERE x = 1)")
|
|
871
872
|
self.validate_identity("SELECT * FROM GLOB(x)")
|
|
@@ -1148,8 +1149,20 @@ class TestDuckDB(Validator):
|
|
|
1148
1149
|
|
|
1149
1150
|
self.validate_all("0b1010", write={"": "0 AS b1010"})
|
|
1150
1151
|
self.validate_all("0x1010", write={"": "0 AS x1010"})
|
|
1151
|
-
self.validate_identity("x ~ y", "
|
|
1152
|
-
self.validate_identity("x !~ y", "NOT
|
|
1152
|
+
self.validate_identity("x ~ y", "REGEXP_MATCHES(x, y)")
|
|
1153
|
+
self.validate_identity("x !~ y", "NOT REGEXP_MATCHES(x, y)")
|
|
1154
|
+
self.validate_all(
|
|
1155
|
+
"SELECT x ~ y, x !~ y",
|
|
1156
|
+
write={"postgres": "SELECT x ~ y, NOT x ~ y"},
|
|
1157
|
+
)
|
|
1158
|
+
# Before DuckDB 2.0, ~ and !~ matched the whole string
|
|
1159
|
+
self.validate_all(
|
|
1160
|
+
"SELECT REGEXP_FULL_MATCH(x, y), NOT REGEXP_FULL_MATCH(x, y)",
|
|
1161
|
+
read={
|
|
1162
|
+
"duckdb, version=1.0": "SELECT x ~ y, x !~ y",
|
|
1163
|
+
"duckdb, version=1.5": "SELECT x ~ y, x !~ y",
|
|
1164
|
+
},
|
|
1165
|
+
)
|
|
1153
1166
|
self.validate_identity("REGEXP_FULL_MATCH(x, y, 'i')")
|
|
1154
1167
|
self.validate_all("SELECT * FROM 'x.y'", write={"duckdb": 'SELECT * FROM "x.y"'})
|
|
1155
1168
|
self.validate_all(
|