sqlglot 30.1.0__tar.gz → 30.2.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.1.0 → sqlglot-30.2.0}/CHANGELOG.md +160 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/Makefile +5 -2
- {sqlglot-30.1.0/sqlglot.egg-info → sqlglot-30.2.0}/PKG-INFO +3 -3
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/__init__.py +26 -8
- sqlglot-30.2.0/sqlglot/_typing.py +51 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/athena.py +10 -40
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/bigquery.py +2 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/dialect.py +30 -22
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/__init__.py +1 -12
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/builders.py +80 -47
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/core.py +138 -110
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/datatypes.py +26 -16
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/dml.py +15 -10
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/functions.py +10 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/json.py +4 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/math.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/properties.py +8 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/query.py +52 -46
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/string.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generator.py +46 -14
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/bigquery.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/clickhouse.py +2 -5
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/databricks.py +12 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/duckdb.py +49 -18
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/hive.py +3 -7
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/postgres.py +2 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/presto.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/sqlite.py +2 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/helper.py +16 -14
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/jsonpath.py +4 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/lineage.py +3 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/annotate_types.py +90 -70
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/qualify_tables.py +4 -3
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/simplify.py +39 -34
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parser.py +13 -11
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/athena.py +13 -8
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/bigquery.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/clickhouse.py +6 -8
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/dremio.py +2 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/duckdb.py +13 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/hive.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/redshift.py +5 -4
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/singlestore.py +1 -4
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/snowflake.py +8 -7
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/sqlite.py +15 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/schema.py +4 -4
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/tokenizer_core.py +6 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/tokens.py +13 -13
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/transforms.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/bigquery.py +2 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/snowflake.py +2 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot.egg-info/SOURCES.txt +2 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot.egg-info/requires.txt +2 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglotc/setup.py +2 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_bigquery.py +1 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_databricks.py +2 -2
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_duckdb.py +41 -6
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_oracle.py +1 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_snowflake.py +25 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_sqlite.py +7 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/annotate_functions.sql +8 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/optimizer.sql +24 -1
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/simplify.sql +30 -0
- sqlglot-30.2.0/tests/sqlglot/__init__.py +7 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_integration_loader.py +1 -3
- sqlglot-30.1.0/sqlglot/_typing.py +0 -11
- {sqlglot-30.1.0 → sqlglot-30.2.0}/.gitignore +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/.gitmodules +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/.gitpod.yml +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/AGENTS.md +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/CLAUDE.md +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/LICENSE +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/MANIFEST.in +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/README.md +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/pyproject.toml +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/setup.cfg +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/setup.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/duckdb.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/array.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/mysql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/qualify_columns.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/spark2.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/time.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglot.png +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_clickhouse.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_dialect.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_hive.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_mysql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_postgres.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_spark.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/helpers.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_build.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_diff.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_docs.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_errors.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_executor.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_generator.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_helper.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_optimizer.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_parser.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_schema.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_serde.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_time.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.1.0 → sqlglot-30.2.0}/tests/test_transpile.py +0 -0
|
@@ -1,6 +1,165 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.1.0] - 2026-03-26
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`0921899`](https://github.com/tobymao/sqlglot/commit/0921899cb663b99b888b180dcb7f54750232f209) - support for TEXTLEN function *(PR [#7346](https://github.com/tobymao/sqlglot/pull/7346) by [@AbhishekASLK](https://github.com/AbhishekASLK))*:
|
|
7
|
+
|
|
8
|
+
support for TEXTLEN function (#7346)
|
|
9
|
+
|
|
10
|
+
- due to [`83e7851`](https://github.com/tobymao/sqlglot/commit/83e785140b75faa87bc375a85dc72b9b9d710563) - Compile base Generator with mypyc *(PR [#7351](https://github.com/tobymao/sqlglot/pull/7351) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
11
|
+
|
|
12
|
+
Compile base Generator with mypyc (#7351)
|
|
13
|
+
|
|
14
|
+
- due to [`a424037`](https://github.com/tobymao/sqlglot/commit/a4240370d28c47ac7e2ef62ac5dda60720ba9870) - Extract and compile generator *(PR [#7362](https://github.com/tobymao/sqlglot/pull/7362) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
15
|
+
|
|
16
|
+
Extract and compile generator (#7362)
|
|
17
|
+
|
|
18
|
+
- due to [`a482dc5`](https://github.com/tobymao/sqlglot/commit/a482dc57359b8dc992395048f34b67e6a1355aa4) - Extract and compile generator *(PR [#7363](https://github.com/tobymao/sqlglot/pull/7363) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
19
|
+
|
|
20
|
+
Extract and compile generator (#7363)
|
|
21
|
+
|
|
22
|
+
- due to [`cb78bc3`](https://github.com/tobymao/sqlglot/commit/cb78bc3d5da6686e2608de5133cf1da416de9c67) - Extract and compile generator *(PR [#7365](https://github.com/tobymao/sqlglot/pull/7365) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
23
|
+
|
|
24
|
+
Extract and compile generator (#7365)
|
|
25
|
+
|
|
26
|
+
- due to [`adf0032`](https://github.com/tobymao/sqlglot/commit/adf00320d38a9904c8928bd33498fe4f79947150) - Extract and compile generator *(PR [#7366](https://github.com/tobymao/sqlglot/pull/7366) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
27
|
+
|
|
28
|
+
Extract and compile generator (#7366)
|
|
29
|
+
|
|
30
|
+
- due to [`7d26eed`](https://github.com/tobymao/sqlglot/commit/7d26eedbe3976be1b70d8b7b35173e1e65e40749) - Extract and compile generator *(PR [#7367](https://github.com/tobymao/sqlglot/pull/7367) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
31
|
+
|
|
32
|
+
Extract and compile generator (#7367)
|
|
33
|
+
|
|
34
|
+
- due to [`56e7a88`](https://github.com/tobymao/sqlglot/commit/56e7a886163e0281e231502dbe25ba253bd7c67e) - Extract and compile generator *(PR [#7370](https://github.com/tobymao/sqlglot/pull/7370) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
35
|
+
|
|
36
|
+
Extract and compile generator (#7370)
|
|
37
|
+
|
|
38
|
+
- due to [`2e8d3dd`](https://github.com/tobymao/sqlglot/commit/2e8d3dd3b94b38199516b66bc6809492767338c2) - Extract and compile generator *(PR [#7374](https://github.com/tobymao/sqlglot/pull/7374) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
39
|
+
|
|
40
|
+
Extract and compile generator (#7374)
|
|
41
|
+
|
|
42
|
+
- due to [`b1d5a06`](https://github.com/tobymao/sqlglot/commit/b1d5a06e274fcdd1f2cda00777c18bc659936b88) - Extract and compile generator *(PR [#7364](https://github.com/tobymao/sqlglot/pull/7364) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
43
|
+
|
|
44
|
+
Extract and compile generator (#7364)
|
|
45
|
+
|
|
46
|
+
- due to [`3ab4cf2`](https://github.com/tobymao/sqlglot/commit/3ab4cf270624ae13723b7cdcc2b92bf1fdcdb2ac) - Extract and compile generator *(PR [#7371](https://github.com/tobymao/sqlglot/pull/7371) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
47
|
+
|
|
48
|
+
Extract and compile generator (#7371)
|
|
49
|
+
|
|
50
|
+
- due to [`0a13068`](https://github.com/tobymao/sqlglot/commit/0a13068fc7f630785ec3516ebc8855955749d19e) - Extract and compile generator *(PR [#7376](https://github.com/tobymao/sqlglot/pull/7376) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
51
|
+
|
|
52
|
+
Extract and compile generator (#7376)
|
|
53
|
+
|
|
54
|
+
- due to [`09cc35d`](https://github.com/tobymao/sqlglot/commit/09cc35dcb7392865f60532c9ba389c64dcd3177a) - Extract and compile generator *(PR [#7373](https://github.com/tobymao/sqlglot/pull/7373) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
55
|
+
|
|
56
|
+
Extract and compile generator (#7373)
|
|
57
|
+
|
|
58
|
+
- due to [`d301233`](https://github.com/tobymao/sqlglot/commit/d3012336461b9b45953f5c7e04e07fa503e99cd2) - Extract and compile generator *(PR [#7372](https://github.com/tobymao/sqlglot/pull/7372) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
59
|
+
|
|
60
|
+
Extract and compile generator (#7372)
|
|
61
|
+
|
|
62
|
+
- due to [`d1b0d8f`](https://github.com/tobymao/sqlglot/commit/d1b0d8f5ab07116cbc0983ea94945a5b305577cd) - Fix [NOT] REGEXP / REGEXP_LIKE transpilation from Snowflake to DuckDB *(PR [#7354](https://github.com/tobymao/sqlglot/pull/7354) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
63
|
+
|
|
64
|
+
Fix [NOT] REGEXP / REGEXP_LIKE transpilation from Snowflake to DuckDB (#7354)
|
|
65
|
+
|
|
66
|
+
- due to [`53d56d4`](https://github.com/tobymao/sqlglot/commit/53d56d42e1dd3294cbf9f26c40e9c56991fba2f4) - Extract and compile generator *(PR [#7369](https://github.com/tobymao/sqlglot/pull/7369) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
67
|
+
|
|
68
|
+
Extract and compile generator (#7369)
|
|
69
|
+
|
|
70
|
+
- due to [`586e28e`](https://github.com/tobymao/sqlglot/commit/586e28ebdf020ab5f6ccaf6cb0202860f06ab48e) - Extract and compile generator *(PR [#7377](https://github.com/tobymao/sqlglot/pull/7377) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
71
|
+
|
|
72
|
+
Extract and compile generator (#7377)
|
|
73
|
+
|
|
74
|
+
- due to [`dcf01c1`](https://github.com/tobymao/sqlglot/commit/dcf01c17adb1c8231fee929c588eded0e71e3a5e) - Extract and compile generator *(PR [#7379](https://github.com/tobymao/sqlglot/pull/7379) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
75
|
+
|
|
76
|
+
Extract and compile generator (#7379)
|
|
77
|
+
|
|
78
|
+
- due to [`f7668a7`](https://github.com/tobymao/sqlglot/commit/f7668a77836d9af6a635b5f87b1ea43566d38978) - Extract and compile generator *(PR [#7368](https://github.com/tobymao/sqlglot/pull/7368) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
79
|
+
|
|
80
|
+
Extract and compile generator (#7368)
|
|
81
|
+
|
|
82
|
+
- due to [`21693d7`](https://github.com/tobymao/sqlglot/commit/21693d7476e3ddbcf73080d9885bcacb5383d52a) - refactor JSON extract *(PR [#7302](https://github.com/tobymao/sqlglot/pull/7302) by [@geooo109](https://github.com/geooo109))*:
|
|
83
|
+
|
|
84
|
+
refactor JSON extract (#7302)
|
|
85
|
+
|
|
86
|
+
- due to [`850bf1e`](https://github.com/tobymao/sqlglot/commit/850bf1e49a59c5950c0385772641fd0e89a3a4b8) - Extract and compile generator *(PR [#7375](https://github.com/tobymao/sqlglot/pull/7375) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
87
|
+
|
|
88
|
+
Extract and compile generator (#7375)
|
|
89
|
+
|
|
90
|
+
- due to [`1b14a79`](https://github.com/tobymao/sqlglot/commit/1b14a7971c63a44ec1e52e4356316a2db20dde43) - Extract and compile generator *(PR [#7381](https://github.com/tobymao/sqlglot/pull/7381) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
91
|
+
|
|
92
|
+
Extract and compile generator (#7381)
|
|
93
|
+
|
|
94
|
+
- due to [`fcc09dd`](https://github.com/tobymao/sqlglot/commit/fcc09ddcff0f1b1c785f826039fc6a0f2357589b) - Add transpilation support for ARRAY_UNIQUE_AGG function *(PR [#7386](https://github.com/tobymao/sqlglot/pull/7386) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
95
|
+
|
|
96
|
+
Add transpilation support for ARRAY_UNIQUE_AGG function (#7386)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### :sparkles: New Features
|
|
100
|
+
- [`4a077ca`](https://github.com/tobymao/sqlglot/commit/4a077ca4df1da0913928a7d635d21ea7a9b50ff0) - **duckdb**: Add transpilation support for neg position args for CHARINDEX *(PR [#7334](https://github.com/tobymao/sqlglot/pull/7334) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
101
|
+
- [`0921899`](https://github.com/tobymao/sqlglot/commit/0921899cb663b99b888b180dcb7f54750232f209) - **redshift**: support for TEXTLEN function *(PR [#7346](https://github.com/tobymao/sqlglot/pull/7346) by [@AbhishekASLK](https://github.com/AbhishekASLK))*
|
|
102
|
+
- [`64f7e6c`](https://github.com/tobymao/sqlglot/commit/64f7e6c850fa850778fe033700eac9c31233a587) - **duckdb**: Add transpilation support for check_json function *(PR [#7353](https://github.com/tobymao/sqlglot/pull/7353) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
103
|
+
- [`4743e76`](https://github.com/tobymao/sqlglot/commit/4743e769eeb34db22a6734d01e8bc2f92b661cb3) - **optimizer**: annotate types for ORDER BY alias references *(PR [#7281](https://github.com/tobymao/sqlglot/pull/7281) by [@doripo](https://github.com/doripo))*
|
|
104
|
+
- [`d1b0d8f`](https://github.com/tobymao/sqlglot/commit/d1b0d8f5ab07116cbc0983ea94945a5b305577cd) - **duckdb**: Fix [NOT] REGEXP / REGEXP_LIKE transpilation from Snowflake to DuckDB *(PR [#7354](https://github.com/tobymao/sqlglot/pull/7354) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
105
|
+
- [`d5f74a6`](https://github.com/tobymao/sqlglot/commit/d5f74a6cb14c91687e8b2fbf26d3e792b7ea5d46) - **duckdb**: Add tests for NOT RLIKE to check the full match semantics *(PR [#7384](https://github.com/tobymao/sqlglot/pull/7384) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
106
|
+
- [`3a52141`](https://github.com/tobymao/sqlglot/commit/3a52141aaf9950bf1077e3757e868d3d5acd6f75) - **postgres**: handle non-literal interval values in datetime addition *(PR [#7360](https://github.com/tobymao/sqlglot/pull/7360) by [@georgesittas](https://github.com/georgesittas))*
|
|
107
|
+
- [`fcc09dd`](https://github.com/tobymao/sqlglot/commit/fcc09ddcff0f1b1c785f826039fc6a0f2357589b) - **duckdb**: Add transpilation support for ARRAY_UNIQUE_AGG function *(PR [#7386](https://github.com/tobymao/sqlglot/pull/7386) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
108
|
+
- [`263bb7f`](https://github.com/tobymao/sqlglot/commit/263bb7f1cd39b828ad91b85441e197c1625cda7e) - **duckdb**: do not issue CREATE unsupported iceberg property warning *(PR [#7396](https://github.com/tobymao/sqlglot/pull/7396) by [@treysp](https://github.com/treysp))*
|
|
109
|
+
- [`438f031`](https://github.com/tobymao/sqlglot/commit/438f03177ea37ed8765428767a6044110a100a62) - **duckdb**: support the full `SHOW TABLES` syntax spec *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
110
|
+
- [`7216cf9`](https://github.com/tobymao/sqlglot/commit/7216cf94c47ad0a71c5e840a4298748a1e2a4d95) - **snowflake**: support DROP ICEBERG TABLE *(PR [#7398](https://github.com/tobymao/sqlglot/pull/7398) by [@treysp](https://github.com/treysp))*
|
|
111
|
+
- [`b6ada45`](https://github.com/tobymao/sqlglot/commit/b6ada45b762943fce00e6744037ced1955961e4b) - **snowflake**: support ALTER ICEBERG TABLE *(PR [#7401](https://github.com/tobymao/sqlglot/pull/7401) by [@treysp](https://github.com/treysp))*
|
|
112
|
+
- [`877e184`](https://github.com/tobymao/sqlglot/commit/877e1842ba60740bf5053e03c48b4600d2e077b8) - **duckdb**: Add transpilation support for ILIKE ANY, LIKE ANY/ALL functions for ESCAPE pattern *(PR [#7394](https://github.com/tobymao/sqlglot/pull/7394) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
113
|
+
|
|
114
|
+
### :bug: Bug Fixes
|
|
115
|
+
- [`d257e76`](https://github.com/tobymao/sqlglot/commit/d257e76286c8b623c0f50b8d423c66261c23b267) - **clickhouse**: lowercase dateTrunc units for versions before 23.12 *(PR [#7331](https://github.com/tobymao/sqlglot/pull/7331) by [@markcheney1](https://github.com/markcheney1))*
|
|
116
|
+
- [`2cb9772`](https://github.com/tobymao/sqlglot/commit/2cb9772c420f8446a783ef95d5fdb2b94410fae7) - **optimizer**: enhance simplify_parens to handle additional parent types *(PR [#7339](https://github.com/tobymao/sqlglot/pull/7339) by [@MuSilk](https://github.com/MuSilk))*
|
|
117
|
+
- :arrow_lower_right: *fixes issue [#7338](https://github.com/tobymao/sqlglot/issues/7338) opened by [@MuSilk](https://github.com/MuSilk)*
|
|
118
|
+
- [`9973623`](https://github.com/tobymao/sqlglot/commit/9973623d0c0d824493611bd509c4dbf673cc7bd7) - **optimizer**: qualify column named END *(PR [#7345](https://github.com/tobymao/sqlglot/pull/7345) by [@geooo109](https://github.com/geooo109))*
|
|
119
|
+
- :arrow_lower_right: *fixes issue [#7344](https://github.com/tobymao/sqlglot/issues/7344) opened by [@michaelst](https://github.com/michaelst)*
|
|
120
|
+
- [`13e971d`](https://github.com/tobymao/sqlglot/commit/13e971d05e19ef06e931c4cf631181ed5e8effa0) - **clickhouse**: UUID property *(PR [#7349](https://github.com/tobymao/sqlglot/pull/7349) by [@geooo109](https://github.com/geooo109))*
|
|
121
|
+
- :arrow_lower_right: *fixes issue [#7348](https://github.com/tobymao/sqlglot/issues/7348) opened by [@ultram4rine](https://github.com/ultram4rine)*
|
|
122
|
+
- [`2a248f1`](https://github.com/tobymao/sqlglot/commit/2a248f1672a01c57917ccd383e1f26d9083ca1c6) - **optimizer**: fix correlated subquery *(PR [#7343](https://github.com/tobymao/sqlglot/pull/7343) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
123
|
+
- :arrow_lower_right: *fixes issue [#7308](https://github.com/tobymao/sqlglot/issues/7308) opened by [@adam-richardson-openai](https://github.com/adam-richardson-openai)*
|
|
124
|
+
- [`0624bbf`](https://github.com/tobymao/sqlglot/commit/0624bbfde3670956089a2e192e2462e31db54fa8) - **mysql**: Fix AttributeError crash when transpiling IGNORE/RESPECT NULLS *(PR [#7361](https://github.com/tobymao/sqlglot/pull/7361) by [@ShubhamKapoor992](https://github.com/ShubhamKapoor992))*
|
|
125
|
+
- :arrow_lower_right: *fixes issue [#7359](https://github.com/tobymao/sqlglot/issues/7359) opened by [@ShubhamKapoor992](https://github.com/ShubhamKapoor992)*
|
|
126
|
+
- [`0344937`](https://github.com/tobymao/sqlglot/commit/03449378d8e79017a88d92ffbbfd45c2924d115a) - handle pipe operator after subquery closes [#7388](https://github.com/tobymao/sqlglot/pull/7388) *(PR [#7391](https://github.com/tobymao/sqlglot/pull/7391) by [@georgesittas](https://github.com/georgesittas))*
|
|
127
|
+
- [`2b19bdc`](https://github.com/tobymao/sqlglot/commit/2b19bdca3e56d8046c7ce435dedfd943167c25fa) - **bigquery**: support parentheses for CAST FORMAT syntax *(PR [#7395](https://github.com/tobymao/sqlglot/pull/7395) by [@ShubhamKapoor992](https://github.com/ShubhamKapoor992))*
|
|
128
|
+
- :arrow_lower_right: *fixes issue [#7390](https://github.com/tobymao/sqlglot/issues/7390) opened by [@roykoand](https://github.com/roykoand)*
|
|
129
|
+
|
|
130
|
+
### :recycle: Refactors
|
|
131
|
+
- [`83e7851`](https://github.com/tobymao/sqlglot/commit/83e785140b75faa87bc375a85dc72b9b9d710563) - **generator**: Compile base Generator with mypyc *(PR [#7351](https://github.com/tobymao/sqlglot/pull/7351) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
132
|
+
- [`a424037`](https://github.com/tobymao/sqlglot/commit/a4240370d28c47ac7e2ef62ac5dda60720ba9870) - **tableau**: Extract and compile generator *(PR [#7362](https://github.com/tobymao/sqlglot/pull/7362) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
133
|
+
- [`a482dc5`](https://github.com/tobymao/sqlglot/commit/a482dc57359b8dc992395048f34b67e6a1355aa4) - **teradata**: Extract and compile generator *(PR [#7363](https://github.com/tobymao/sqlglot/pull/7363) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
134
|
+
- [`cb78bc3`](https://github.com/tobymao/sqlglot/commit/cb78bc3d5da6686e2608de5133cf1da416de9c67) - **druid**: Extract and compile generator *(PR [#7365](https://github.com/tobymao/sqlglot/pull/7365) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
135
|
+
- [`adf0032`](https://github.com/tobymao/sqlglot/commit/adf00320d38a9904c8928bd33498fe4f79947150) - **sqlite**: Extract and compile generator *(PR [#7366](https://github.com/tobymao/sqlglot/pull/7366) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
136
|
+
- [`7d26eed`](https://github.com/tobymao/sqlglot/commit/7d26eedbe3976be1b70d8b7b35173e1e65e40749) - **dremio**: Extract and compile generator *(PR [#7367](https://github.com/tobymao/sqlglot/pull/7367) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
137
|
+
- [`56e7a88`](https://github.com/tobymao/sqlglot/commit/56e7a886163e0281e231502dbe25ba253bd7c67e) - **snowflake**: Extract and compile generator *(PR [#7370](https://github.com/tobymao/sqlglot/pull/7370) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
138
|
+
- [`2e8d3dd`](https://github.com/tobymao/sqlglot/commit/2e8d3dd3b94b38199516b66bc6809492767338c2) - **hive**: Extract and compile generator *(PR [#7374](https://github.com/tobymao/sqlglot/pull/7374) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
139
|
+
- [`b1d5a06`](https://github.com/tobymao/sqlglot/commit/b1d5a06e274fcdd1f2cda00777c18bc659936b88) - **drill**: Extract and compile generator *(PR [#7364](https://github.com/tobymao/sqlglot/pull/7364) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
140
|
+
- [`3ab4cf2`](https://github.com/tobymao/sqlglot/commit/3ab4cf270624ae13723b7cdcc2b92bf1fdcdb2ac) - **oracle**: Extract and compile generator *(PR [#7371](https://github.com/tobymao/sqlglot/pull/7371) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
141
|
+
- [`0a13068`](https://github.com/tobymao/sqlglot/commit/0a13068fc7f630785ec3516ebc8855955749d19e) - **postgres**: Extract and compile generator *(PR [#7376](https://github.com/tobymao/sqlglot/pull/7376) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
142
|
+
- [`09cc35d`](https://github.com/tobymao/sqlglot/commit/09cc35dcb7392865f60532c9ba389c64dcd3177a) - **tsql**: Extract and compile generator *(PR [#7373](https://github.com/tobymao/sqlglot/pull/7373) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
143
|
+
- [`d301233`](https://github.com/tobymao/sqlglot/commit/d3012336461b9b45953f5c7e04e07fa503e99cd2) - **bigquery**: Extract and compile generator *(PR [#7372](https://github.com/tobymao/sqlglot/pull/7372) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
144
|
+
- [`53d56d4`](https://github.com/tobymao/sqlglot/commit/53d56d42e1dd3294cbf9f26c40e9c56991fba2f4) - **exasol**: Extract and compile generator *(PR [#7369](https://github.com/tobymao/sqlglot/pull/7369) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
145
|
+
- [`586e28e`](https://github.com/tobymao/sqlglot/commit/586e28ebdf020ab5f6ccaf6cb0202860f06ab48e) - **spark**: Extract and compile generator *(PR [#7377](https://github.com/tobymao/sqlglot/pull/7377) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
146
|
+
- [`dcf01c1`](https://github.com/tobymao/sqlglot/commit/dcf01c17adb1c8231fee929c588eded0e71e3a5e) - **presto**: Extract and compile generator *(PR [#7379](https://github.com/tobymao/sqlglot/pull/7379) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
147
|
+
- [`f7668a7`](https://github.com/tobymao/sqlglot/commit/f7668a77836d9af6a635b5f87b1ea43566d38978) - **clickhouse**: Extract and compile generator *(PR [#7368](https://github.com/tobymao/sqlglot/pull/7368) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
148
|
+
- [`850bf1e`](https://github.com/tobymao/sqlglot/commit/850bf1e49a59c5950c0385772641fd0e89a3a4b8) - **duckdb**: Extract and compile generator *(PR [#7375](https://github.com/tobymao/sqlglot/pull/7375) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
149
|
+
- [`1b14a79`](https://github.com/tobymao/sqlglot/commit/1b14a7971c63a44ec1e52e4356316a2db20dde43) - **mysql**: Extract and compile generator *(PR [#7381](https://github.com/tobymao/sqlglot/pull/7381) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
150
|
+
- [`3582aa5`](https://github.com/tobymao/sqlglot/commit/3582aa54226e20b6b6187e1f30ae183bba91f79d) - **generators**: Cleanup and fully compile all generators *(PR [#7389](https://github.com/tobymao/sqlglot/pull/7389) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
151
|
+
|
|
152
|
+
### :wrench: Chores
|
|
153
|
+
- [`4e9ed57`](https://github.com/tobymao/sqlglot/commit/4e9ed57cb59db648dace5d7e464899fa117eb273) - benchworkflow *(PR [#7340](https://github.com/tobymao/sqlglot/pull/7340) by [@tobymao](https://github.com/tobymao))*
|
|
154
|
+
- [`0fce391`](https://github.com/tobymao/sqlglot/commit/0fce3910a363a6006f9799c272865d17cc0275e1) - refactor duckdb strposition_sql *(commit by [@geooo109](https://github.com/geooo109))*
|
|
155
|
+
- [`f7bb6be`](https://github.com/tobymao/sqlglot/commit/f7bb6bea86c1629d03bf2807378d36de004cd4a7) - use collections.abc and built-in types for typing to avoid deprecation *(PR [#7329](https://github.com/tobymao/sqlglot/pull/7329) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
|
|
156
|
+
- [`f5e0a8a`](https://github.com/tobymao/sqlglot/commit/f5e0a8a450cdde59929209bdb74c9664dc6b3188) - always run sqlglot integration tests *(PR [#7350](https://github.com/tobymao/sqlglot/pull/7350) by [@georgesittas](https://github.com/georgesittas))*
|
|
157
|
+
- [`f0f04d9`](https://github.com/tobymao/sqlglot/commit/f0f04d92812e516b7074497e5bf4146cf7cd91e4) - Fix mypyc setup *(PR [#7382](https://github.com/tobymao/sqlglot/pull/7382) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
158
|
+
- [`47325ce`](https://github.com/tobymao/sqlglot/commit/47325ce7a5f31dc5c7173a6c91ad93666caa1b1b) - only trigger the benchmark job manually *(PR [#7383](https://github.com/tobymao/sqlglot/pull/7383) by [@georgesittas](https://github.com/georgesittas))*
|
|
159
|
+
- [`21693d7`](https://github.com/tobymao/sqlglot/commit/21693d7476e3ddbcf73080d9885bcacb5383d52a) - **parser**: refactor JSON extract *(PR [#7302](https://github.com/tobymao/sqlglot/pull/7302) by [@geooo109](https://github.com/geooo109))*
|
|
160
|
+
- [`c1842b2`](https://github.com/tobymao/sqlglot/commit/c1842b2388134782545e3d8c448b953b09abc553) - added annotations to all `**opts` arguments *(PR [#7342](https://github.com/tobymao/sqlglot/pull/7342) by [@OutSquareCapital](https://github.com/OutSquareCapital))*
|
|
161
|
+
|
|
162
|
+
|
|
4
163
|
## [v30.0.3] - 2026-03-19
|
|
5
164
|
### :zap: Performance Improvements
|
|
6
165
|
- [`f87ebe0`](https://github.com/tobymao/sqlglot/commit/f87ebe02103b249ec5fa2c93e019e465f77630be) - use mypyc i64 for parser index fields (~1.6% faster) *(commit by [@tobymao](https://github.com/tobymao))*
|
|
@@ -13855,3 +14014,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
13855
14014
|
[v30.0.1]: https://github.com/tobymao/sqlglot/compare/v30.0.0...v30.0.1
|
|
13856
14015
|
[v30.0.2]: https://github.com/tobymao/sqlglot/compare/v30.0.1...v30.0.2
|
|
13857
14016
|
[v30.0.3]: https://github.com/tobymao/sqlglot/compare/v30.0.2...v30.0.3
|
|
14017
|
+
[v30.1.0]: https://github.com/tobymao/sqlglot/compare/v30.0.3...v30.1.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: install install-dev install-devc install-devc-release install-pre-commit bench bench-parse bench-optimize test test-fast unit testc unitc 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 unit testc unitc style check docs docs-serve hidec showc clean resolve-integration-conflicts update-fixtures
|
|
2
2
|
|
|
3
3
|
ifdef UV
|
|
4
4
|
PIP := uv pip
|
|
@@ -51,11 +51,14 @@ install-pre-commit:
|
|
|
51
51
|
@printf '#!/bin/bash\n.github/scripts/integration_tests_sync.sh post-commit\n' > .git/hooks/post-commit
|
|
52
52
|
@chmod +x .git/hooks/post-commit
|
|
53
53
|
|
|
54
|
-
bench: bench-parse bench-optimize
|
|
54
|
+
bench: bench-parse bench-transpile bench-optimize
|
|
55
55
|
|
|
56
56
|
bench-parse:
|
|
57
57
|
python -m benchmarks.parse
|
|
58
58
|
|
|
59
|
+
bench-transpile:
|
|
60
|
+
python -m benchmarks.parse --mode transpile
|
|
61
|
+
|
|
59
62
|
bench-optimize:
|
|
60
63
|
python -m benchmarks.optimize
|
|
61
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.2.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
|
|
@@ -33,10 +33,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
33
33
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
34
34
|
Requires-Dist: pyperf; extra == "dev"
|
|
35
35
|
Provides-Extra: c
|
|
36
|
-
Requires-Dist: sqlglotc==30.
|
|
36
|
+
Requires-Dist: sqlglotc==30.2.0; extra == "c"
|
|
37
37
|
Provides-Extra: rs
|
|
38
38
|
Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
|
|
39
|
-
Requires-Dist: sqlglotc==30.
|
|
39
|
+
Requires-Dist: sqlglotc==30.2.0; extra == "rs"
|
|
40
40
|
Dynamic: license-file
|
|
41
41
|
Dynamic: provides-extra
|
|
42
42
|
|
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
# bootstrap mypyc runtime: compiled .so modules do a top-level `import HASH__mypyc`,
|
|
11
11
|
# but the runtime .so lives inside sqlglot/. Pre-load it into sys.modules.
|
|
12
12
|
# this is only needed for editable builds
|
|
13
|
+
from collections.abc import Collection
|
|
13
14
|
import sys
|
|
14
15
|
from pathlib import Path
|
|
15
16
|
from builtins import type as Type
|
|
@@ -70,7 +71,8 @@ from sqlglot.schema import MappingSchema as MappingSchema, Schema as Schema
|
|
|
70
71
|
from sqlglot.tokens import Token as Token, Tokenizer as Tokenizer, TokenType as TokenType
|
|
71
72
|
|
|
72
73
|
if t.TYPE_CHECKING:
|
|
73
|
-
from sqlglot._typing import E
|
|
74
|
+
from sqlglot._typing import E, GeneratorArgs, ParserNoDialectArgs
|
|
75
|
+
from typing_extensions import Unpack
|
|
74
76
|
from sqlglot.dialects.dialect import DialectType as DialectType
|
|
75
77
|
|
|
76
78
|
logger = logging.getLogger("sqlglot")
|
|
@@ -88,7 +90,7 @@ pretty = False
|
|
|
88
90
|
"""Whether to format generated SQL by default."""
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
def tokenize(sql: str, read: DialectType = None, dialect: DialectType = None) ->
|
|
93
|
+
def tokenize(sql: str, read: DialectType = None, dialect: DialectType = None) -> list[Token]:
|
|
92
94
|
"""
|
|
93
95
|
Tokenizes the given SQL string.
|
|
94
96
|
|
|
@@ -104,7 +106,10 @@ def tokenize(sql: str, read: DialectType = None, dialect: DialectType = None) ->
|
|
|
104
106
|
|
|
105
107
|
|
|
106
108
|
def parse(
|
|
107
|
-
sql: str,
|
|
109
|
+
sql: str,
|
|
110
|
+
read: DialectType = None,
|
|
111
|
+
dialect: DialectType = None,
|
|
112
|
+
**opts: Unpack[ParserNoDialectArgs],
|
|
108
113
|
) -> list[t.Optional[Expr]]:
|
|
109
114
|
"""
|
|
110
115
|
Parses the given SQL string into a collection of syntax trees, one per parsed SQL statement.
|
|
@@ -122,11 +127,24 @@ def parse(
|
|
|
122
127
|
|
|
123
128
|
|
|
124
129
|
@t.overload
|
|
125
|
-
def parse_one(
|
|
130
|
+
def parse_one(
|
|
131
|
+
sql: str,
|
|
132
|
+
*,
|
|
133
|
+
read: DialectType = ...,
|
|
134
|
+
dialect: DialectType = ...,
|
|
135
|
+
into: Type[E],
|
|
136
|
+
**opts: Unpack[ParserNoDialectArgs],
|
|
137
|
+
) -> E: ...
|
|
126
138
|
|
|
127
139
|
|
|
128
140
|
@t.overload
|
|
129
|
-
def parse_one(
|
|
141
|
+
def parse_one(
|
|
142
|
+
sql: str,
|
|
143
|
+
read: DialectType = ...,
|
|
144
|
+
dialect: DialectType = ...,
|
|
145
|
+
into: t.Optional[exp.IntoType] = ...,
|
|
146
|
+
**opts: Unpack[ParserNoDialectArgs],
|
|
147
|
+
) -> Expr: ...
|
|
130
148
|
|
|
131
149
|
|
|
132
150
|
def parse_one(
|
|
@@ -134,7 +152,7 @@ def parse_one(
|
|
|
134
152
|
read: DialectType = None,
|
|
135
153
|
dialect: DialectType = None,
|
|
136
154
|
into: t.Optional[exp.IntoType] = None,
|
|
137
|
-
**opts:
|
|
155
|
+
**opts: Unpack[ParserNoDialectArgs],
|
|
138
156
|
) -> Expr:
|
|
139
157
|
"""
|
|
140
158
|
Parses the given SQL string and returns a syntax tree.
|
|
@@ -169,8 +187,8 @@ def transpile(
|
|
|
169
187
|
write: DialectType = None,
|
|
170
188
|
identity: bool = True,
|
|
171
189
|
error_level: t.Optional[ErrorLevel] = None,
|
|
172
|
-
**opts:
|
|
173
|
-
) ->
|
|
190
|
+
**opts: Unpack[GeneratorArgs],
|
|
191
|
+
) -> list[str]:
|
|
174
192
|
"""
|
|
175
193
|
Parses the given SQL string in accordance with the source dialect and returns a list of SQL strings transformed
|
|
176
194
|
to conform to the target dialect. Each string in the returned list represents a single transformed SQL statement.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import typing as t
|
|
4
|
+
|
|
5
|
+
if t.TYPE_CHECKING:
|
|
6
|
+
from collections.abc import Mapping
|
|
7
|
+
import sqlglot
|
|
8
|
+
from sqlglot.dialects.dialect import DialectType
|
|
9
|
+
from sqlglot.errors import ErrorLevel
|
|
10
|
+
|
|
11
|
+
B = t.TypeVar("B", bound="sqlglot.exp.Binary")
|
|
12
|
+
E = t.TypeVar("E", bound="sqlglot.exp.Expr")
|
|
13
|
+
F = t.TypeVar("F", bound="sqlglot.exp.Func")
|
|
14
|
+
T = t.TypeVar("T")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _DialectArg(t.TypedDict, total=False):
|
|
18
|
+
dialect: DialectType
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ParserNoDialectArgs(t.TypedDict, total=False):
|
|
22
|
+
error_level: t.Optional[ErrorLevel]
|
|
23
|
+
error_message_context: int
|
|
24
|
+
max_errors: int
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ParserArgs(ParserNoDialectArgs, _DialectArg, total=False):
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class GeneratorNoDialectArgs(t.TypedDict, total=False):
|
|
32
|
+
pretty: t.Optional[t.Union[bool, int]]
|
|
33
|
+
identify: t.Union[str, bool]
|
|
34
|
+
normalize: bool
|
|
35
|
+
pad: int
|
|
36
|
+
indent: int
|
|
37
|
+
normalize_functions: t.Optional[t.Union[str, bool]]
|
|
38
|
+
unsupported_level: ErrorLevel
|
|
39
|
+
max_unsupported: int
|
|
40
|
+
leading_comma: bool
|
|
41
|
+
max_text_width: int
|
|
42
|
+
comments: bool
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class GeneratorArgs(GeneratorNoDialectArgs, _DialectArg, total=False):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class GraphHTMLArgs(t.TypedDict, total=False):
|
|
50
|
+
imports: bool
|
|
51
|
+
options: t.Optional[Mapping[str, object]]
|
|
@@ -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.2.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 2, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g8e0b9f56f'
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import typing as t
|
|
4
3
|
|
|
5
|
-
from sqlglot import
|
|
6
|
-
from sqlglot.dialects import Dialect,
|
|
4
|
+
from sqlglot import tokens
|
|
5
|
+
from sqlglot.dialects.dialect import Dialect, DialectType
|
|
7
6
|
from sqlglot.generators.athena import AthenaGenerator
|
|
8
7
|
from sqlglot.parsers.athena import AthenaParser
|
|
9
8
|
from sqlglot.tokens import TokenType, Token
|
|
9
|
+
from sqlglot.dialects.trino import Trino
|
|
10
|
+
from sqlglot.dialects.hive import Hive
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class Athena(Dialect):
|
|
@@ -47,34 +48,6 @@ class Athena(Dialect):
|
|
|
47
48
|
- https://docs.aws.amazon.com/athena/latest/ug/dml-queries-functions-operators.html
|
|
48
49
|
"""
|
|
49
50
|
|
|
50
|
-
def __init__(self, **kwargs):
|
|
51
|
-
super().__init__(**kwargs)
|
|
52
|
-
|
|
53
|
-
self._hive = Hive(**kwargs)
|
|
54
|
-
self._trino = Trino(**kwargs)
|
|
55
|
-
|
|
56
|
-
def tokenize(self, sql: str, **opts: object) -> list[Token]:
|
|
57
|
-
opts["hive"] = self._hive
|
|
58
|
-
opts["trino"] = self._trino
|
|
59
|
-
return super().tokenize(sql, **opts)
|
|
60
|
-
|
|
61
|
-
def parse(self, sql: str, **opts: object) -> list[t.Optional[exp.Expr]]:
|
|
62
|
-
opts["hive"] = self._hive
|
|
63
|
-
opts["trino"] = self._trino
|
|
64
|
-
return super().parse(sql, **opts)
|
|
65
|
-
|
|
66
|
-
def parse_into(
|
|
67
|
-
self, expression_type: exp.IntoType, sql: str, **opts: object
|
|
68
|
-
) -> list[t.Optional[exp.Expr]]:
|
|
69
|
-
opts["hive"] = self._hive
|
|
70
|
-
opts["trino"] = self._trino
|
|
71
|
-
return super().parse_into(expression_type, sql, **opts)
|
|
72
|
-
|
|
73
|
-
def generate(self, expression: exp.Expr, copy: bool = True, **opts: object) -> str:
|
|
74
|
-
opts["hive"] = self._hive
|
|
75
|
-
opts["trino"] = self._trino
|
|
76
|
-
return super().generate(expression, copy=copy, **opts)
|
|
77
|
-
|
|
78
51
|
# This Tokenizer consumes a combination of HiveQL and Trino SQL and then processes the tokens
|
|
79
52
|
# to disambiguate which dialect needs to be actually used in order to tokenize correctly.
|
|
80
53
|
class Tokenizer(tokens.Tokenizer):
|
|
@@ -94,16 +67,13 @@ class Athena(Dialect):
|
|
|
94
67
|
"UNLOAD": TokenType.COMMAND,
|
|
95
68
|
}
|
|
96
69
|
|
|
97
|
-
def __init__(self,
|
|
98
|
-
|
|
99
|
-
trino = kwargs.pop("trino", None) or Trino()
|
|
100
|
-
|
|
101
|
-
super().__init__(*args, **kwargs)
|
|
70
|
+
def __init__(self, dialect: DialectType = None) -> None:
|
|
71
|
+
super().__init__(dialect=dialect)
|
|
102
72
|
|
|
103
|
-
self._hive_tokenizer =
|
|
104
|
-
self._trino_tokenizer = _TrinoTokenizer(
|
|
73
|
+
self._hive_tokenizer = Hive().tokenizer()
|
|
74
|
+
self._trino_tokenizer = _TrinoTokenizer(Trino())
|
|
105
75
|
|
|
106
|
-
def tokenize(self, sql: str) ->
|
|
76
|
+
def tokenize(self, sql: str) -> list[Token]:
|
|
107
77
|
tokens = super().tokenize(sql)
|
|
108
78
|
|
|
109
79
|
if _tokenize_as_hive(tokens):
|
|
@@ -116,7 +86,7 @@ class Athena(Dialect):
|
|
|
116
86
|
Generator = AthenaGenerator
|
|
117
87
|
|
|
118
88
|
|
|
119
|
-
def _tokenize_as_hive(tokens:
|
|
89
|
+
def _tokenize_as_hive(tokens: list[Token]) -> bool:
|
|
120
90
|
if len(tokens) < 2:
|
|
121
91
|
return False
|
|
122
92
|
|
|
@@ -39,6 +39,7 @@ class BigQuery(Dialect):
|
|
|
39
39
|
EXCLUDES_PSEUDOCOLUMNS_FROM_STAR = True
|
|
40
40
|
QUERY_RESULTS_ARE_STRUCTS = True
|
|
41
41
|
JSON_EXTRACT_SCALAR_SCALAR_ONLY = True
|
|
42
|
+
JSON_PATH_SINGLE_DOT_IS_WILDCARD = True
|
|
42
43
|
LEAST_GREATEST_IGNORES_NULLS = False
|
|
43
44
|
DEFAULT_NULL_TYPE = exp.DType.BIGINT
|
|
44
45
|
PRIORITIZE_NON_LITERAL_TYPES = True
|
|
@@ -151,6 +152,7 @@ class BigQuery(Dialect):
|
|
|
151
152
|
VAR_TOKENS = {
|
|
152
153
|
*jsonpath.JSONPathTokenizer.VAR_TOKENS,
|
|
153
154
|
TokenType.DASH,
|
|
155
|
+
TokenType.NUMBER,
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
class Tokenizer(tokens.Tokenizer):
|
|
@@ -58,7 +58,8 @@ DATETIME_DELTA = t.Union[
|
|
|
58
58
|
DATETIME_ADD = (exp.DateAdd, exp.TimeAdd, exp.DatetimeAdd, exp.TsOrDsAdd, exp.TimestampAdd)
|
|
59
59
|
|
|
60
60
|
if t.TYPE_CHECKING:
|
|
61
|
-
from sqlglot._typing import B, E, F
|
|
61
|
+
from sqlglot._typing import B, E, F, GeneratorArgs, ParserArgs
|
|
62
|
+
from typing_extensions import Unpack
|
|
62
63
|
|
|
63
64
|
logger = logging.getLogger("sqlglot")
|
|
64
65
|
|
|
@@ -136,7 +137,7 @@ class NormalizationStrategy(str, AutoName):
|
|
|
136
137
|
class _Dialect(type):
|
|
137
138
|
_classes: dict[str, Type[Dialect]] = {}
|
|
138
139
|
|
|
139
|
-
def __eq__(cls, other:
|
|
140
|
+
def __eq__(cls, other: object) -> bool:
|
|
140
141
|
if cls is other:
|
|
141
142
|
return True
|
|
142
143
|
if isinstance(other, str):
|
|
@@ -634,6 +635,9 @@ class Dialect(metaclass=_Dialect):
|
|
|
634
635
|
STRICT_JSON_PATH_SYNTAX = True
|
|
635
636
|
"""Whether failing to parse a JSON path expression using the JSONPath dialect will log a warning."""
|
|
636
637
|
|
|
638
|
+
JSON_PATH_SINGLE_DOT_IS_WILDCARD = False
|
|
639
|
+
"""Whether a single DOT in a JSON path (e.g. $.) is treated as a valid wildcard key."""
|
|
640
|
+
|
|
637
641
|
ON_CONDITION_EMPTY_BEFORE_ERROR = True
|
|
638
642
|
"""Whether "X ON EMPTY" should come before "X ON ERROR" (for dialects like T-SQL, MySQL, Oracle)."""
|
|
639
643
|
|
|
@@ -983,7 +987,7 @@ class Dialect(metaclass=_Dialect):
|
|
|
983
987
|
for unsupported_setting in kwargs.keys() - self.SUPPORTED_SETTINGS:
|
|
984
988
|
suggest_closest_match_and_fail("setting", unsupported_setting, self.SUPPORTED_SETTINGS)
|
|
985
989
|
|
|
986
|
-
def __eq__(self, other:
|
|
990
|
+
def __eq__(self, other: object) -> bool:
|
|
987
991
|
# Does not currently take dialect state into account
|
|
988
992
|
return type(self) == other
|
|
989
993
|
|
|
@@ -1108,39 +1112,43 @@ class Dialect(metaclass=_Dialect):
|
|
|
1108
1112
|
|
|
1109
1113
|
return path
|
|
1110
1114
|
|
|
1111
|
-
def parse(self, sql: str, **opts:
|
|
1115
|
+
def parse(self, sql: str, **opts: Unpack[ParserArgs]) -> list[t.Optional[exp.Expr]]:
|
|
1112
1116
|
return self.parser(**opts).parse(self.tokenize(sql), sql)
|
|
1113
1117
|
|
|
1114
1118
|
def parse_into(
|
|
1115
|
-
self, expression_type: exp.IntoType, sql: str, **opts:
|
|
1119
|
+
self, expression_type: exp.IntoType, sql: str, **opts: Unpack[ParserArgs]
|
|
1116
1120
|
) -> list[t.Optional[exp.Expr]]:
|
|
1117
1121
|
return self.parser(**opts).parse_into(expression_type, self.tokenize(sql), sql)
|
|
1118
1122
|
|
|
1119
|
-
def generate(
|
|
1123
|
+
def generate(
|
|
1124
|
+
self, expression: exp.Expr, copy: bool = True, **opts: Unpack[GeneratorArgs]
|
|
1125
|
+
) -> str:
|
|
1120
1126
|
return self.generator(**opts).generate(expression, copy=copy)
|
|
1121
1127
|
|
|
1122
|
-
def transpile(self, sql: str, **opts:
|
|
1128
|
+
def transpile(self, sql: str, **opts: Unpack[GeneratorArgs]) -> list[str]:
|
|
1123
1129
|
return [
|
|
1124
1130
|
self.generate(expression, copy=False, **opts) if expression else ""
|
|
1125
1131
|
for expression in self.parse(sql)
|
|
1126
1132
|
]
|
|
1127
1133
|
|
|
1128
|
-
def tokenize(self, sql: str,
|
|
1129
|
-
return self.tokenizer(
|
|
1134
|
+
def tokenize(self, sql: str, dialect: DialectType = None) -> list[Token]:
|
|
1135
|
+
return self.tokenizer(dialect=dialect).tokenize(sql)
|
|
1130
1136
|
|
|
1131
|
-
def tokenizer(self,
|
|
1132
|
-
return self.tokenizer_class(
|
|
1137
|
+
def tokenizer(self, dialect: DialectType = None) -> Tokenizer:
|
|
1138
|
+
return self.tokenizer_class(dialect=dialect or self)
|
|
1133
1139
|
|
|
1134
|
-
def jsonpath_tokenizer(self,
|
|
1135
|
-
return self.jsonpath_tokenizer_class(
|
|
1140
|
+
def jsonpath_tokenizer(self, dialect: DialectType = None) -> JSONPathTokenizer:
|
|
1141
|
+
return self.jsonpath_tokenizer_class(dialect=dialect or self)
|
|
1136
1142
|
|
|
1137
|
-
def parser(self, **opts:
|
|
1138
|
-
|
|
1143
|
+
def parser(self, **opts: Unpack[ParserArgs]) -> Parser:
|
|
1144
|
+
args: ParserArgs = {"dialect": self, **opts}
|
|
1145
|
+
return self.parser_class(**args)
|
|
1139
1146
|
|
|
1140
|
-
def generator(self, **opts:
|
|
1141
|
-
|
|
1147
|
+
def generator(self, **opts: Unpack[GeneratorArgs]) -> Generator:
|
|
1148
|
+
args: GeneratorArgs = {"dialect": self, **opts}
|
|
1149
|
+
return self.generator_class(**args)
|
|
1142
1150
|
|
|
1143
|
-
def generate_values_aliases(self, expression: exp.Values) ->
|
|
1151
|
+
def generate_values_aliases(self, expression: exp.Values) -> list[exp.Identifier]:
|
|
1144
1152
|
return [
|
|
1145
1153
|
exp.to_identifier(f"_col_{i}")
|
|
1146
1154
|
for i, _ in enumerate(expression.expressions[0].expressions)
|
|
@@ -1697,9 +1705,8 @@ def timestrtotime_sql(
|
|
|
1697
1705
|
expression: exp.TimeStrToTime,
|
|
1698
1706
|
include_precision: bool = False,
|
|
1699
1707
|
) -> str:
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
)
|
|
1708
|
+
builder = exp.DType.TIMESTAMPTZ if expression.args.get("zone") else exp.DType.TIMESTAMP
|
|
1709
|
+
datatype = builder.into_expr()
|
|
1703
1710
|
|
|
1704
1711
|
if isinstance(expression.this, exp.Literal) and include_precision:
|
|
1705
1712
|
precision = subsecond_precision(expression.this.name)
|
|
@@ -1840,6 +1847,7 @@ def build_trunc(
|
|
|
1840
1847
|
date_trunc_unabbreviate: bool = True,
|
|
1841
1848
|
default_date_trunc_unit: t.Optional[str] = None,
|
|
1842
1849
|
date_trunc_requires_part: bool = True,
|
|
1850
|
+
fractions_supported: bool = False,
|
|
1843
1851
|
) -> exp.DateTrunc | exp.Trunc | exp.Anonymous:
|
|
1844
1852
|
"""
|
|
1845
1853
|
Builder for dialects with overloaded TRUNC (Oracle, Snowflake, etc).
|
|
@@ -1869,7 +1877,7 @@ def build_trunc(
|
|
|
1869
1877
|
or (second and second.is_type(*exp.DataType.NUMERIC_TYPES))
|
|
1870
1878
|
or (not date_trunc_requires_part and not second)
|
|
1871
1879
|
):
|
|
1872
|
-
return exp.Trunc(this=this, decimals=second)
|
|
1880
|
+
return exp.Trunc(this=this, decimals=second, fractions_supported=fractions_supported)
|
|
1873
1881
|
|
|
1874
1882
|
return exp.Anonymous(this="TRUNC", expressions=args)
|
|
1875
1883
|
|
|
@@ -50,15 +50,4 @@ from sqlglot.helper import subclasses
|
|
|
50
50
|
|
|
51
51
|
ALL_FUNCTIONS = subclasses(__name__, Func, {AggFunc, Anonymous, Func})
|
|
52
52
|
FUNCTION_BY_NAME = {name: func for func in ALL_FUNCTIONS for name in func.sql_names()}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def _init_subclasses(cls: t.Type[Expr]) -> None:
|
|
56
|
-
# mypyc fires __init_subclass__ before setting compiled ClassVar attributes,
|
|
57
|
-
# so required_args may have been computed from the inherited arg_types rather
|
|
58
|
-
# than the class-specific one. Recompute now that all modules are fully loaded.
|
|
59
|
-
for sub in cls.__subclasses__():
|
|
60
|
-
sub.required_args = {k for k, v in sub.arg_types.items() if v}
|
|
61
|
-
_init_subclasses(sub)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_init_subclasses(Expr)
|
|
53
|
+
EXPR_CLASSES: t.Dict[str, t.Type[Expr]] = {cls.key: cls for cls in subclasses(__name__, Expr)}
|