sqlglot 30.5.0__tar.gz → 30.7.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.5.0 → sqlglot-30.7.0}/CHANGELOG.md +95 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/Makefile +19 -3
- {sqlglot-30.5.0/sqlglot.egg-info → sqlglot-30.7.0}/PKG-INFO +5 -4
- sqlglot-30.7.0/setup.py +34 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/__init__.py +1 -17
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/dialect.py +9 -5
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/dremio.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/drill.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/duckdb.py +2 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/hive.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/postgres.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/presto.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/snowflake.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/trino.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/tsql.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/executor/python.py +4 -108
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/array.py +5 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/core.py +294 -294
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/datatypes.py +40 -21
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/ddl.py +8 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/json.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/query.py +59 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generator.py +26 -5
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/clickhouse.py +4 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/duckdb.py +94 -10
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/exasol.py +26 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/mysql.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/oracle.py +2 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/presto.py +1 -0
- sqlglot-30.7.0/sqlglot/generators/python.py +108 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/redshift.py +8 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/singlestore.py +1 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/snowflake.py +6 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/lineage.py +119 -31
- sqlglot-30.7.0/sqlglot/optimizer/__init__.py +65 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/annotate_types.py +72 -7
- sqlglot-30.7.0/sqlglot/optimizer/canonicalize_internal_names.py +302 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/eliminate_joins.py +22 -21
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/normalize.py +14 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/optimize_joins.py +6 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/pushdown_predicates.py +12 -5
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/qualify_columns.py +9 -44
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/qualify_tables.py +6 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/resolver.py +49 -29
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/scope.py +3 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/unnest_subqueries.py +3 -2
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parser.py +71 -37
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/duckdb.py +2 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/exasol.py +6 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/hive.py +11 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/mysql.py +41 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/oracle.py +1 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/prql.py +2 -2
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/redshift.py +9 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/snowflake.py +6 -2
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/spark2.py +1 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/schema.py +1 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/tokenizer_core.py +8 -8
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/tokens.py +24 -6
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/__init__.py +3 -2
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/bigquery.py +4 -5
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/hive.py +2 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/snowflake.py +12 -7
- {sqlglot-30.5.0 → sqlglot-30.7.0/sqlglot.egg-info}/PKG-INFO +5 -4
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot.egg-info/SOURCES.txt +4 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot.egg-info/requires.txt +12 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglotc/pyproject.toml +9 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglotc/setup.py +5 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_bigquery.py +4 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_clickhouse.py +8 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_dialect.py +12 -15
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_duckdb.py +29 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_exasol.py +63 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_hive.py +1 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_mysql.py +46 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_oracle.py +14 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_postgres.py +15 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_presto.py +3 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_redshift.py +13 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_snowflake.py +23 -8
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_spark.py +19 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/annotate_functions.sql +18 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/annotate_types.sql +12 -0
- sqlglot-30.7.0/tests/fixtures/optimizer/canonicalize_internal_names.sql +251 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/qualify_columns.sql +1 -1
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/qualify_tables.sql +6 -0
- sqlglot-30.7.0/tests/leakcheck.py +365 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_executor.py +0 -4
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_lineage.py +201 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_optimizer.py +342 -3
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_transpile.py +5 -0
- sqlglot-30.5.0/setup.py +0 -29
- sqlglot-30.5.0/sqlglot/optimizer/__init__.py +0 -11
- {sqlglot-30.5.0 → sqlglot-30.7.0}/.gitignore +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/.gitmodules +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/.gitpod.yml +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/AGENTS.md +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/CLAUDE.md +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/LICENSE +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/MANIFEST.in +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/README.md +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/pyproject.toml +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/setup.cfg +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/bigquery.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/doris.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/postgres.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/sqlite.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/clickhouse.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/doris.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/presto.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/sqlite.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/time.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/duckdb.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/presto.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglot.png +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_doris.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/helpers.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_build.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_diff.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_docs.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_errors.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_generator.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_helper.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_parser.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_schema.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_serde.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_time.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.5.0 → sqlglot-30.7.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.6.0] - 2026-04-20
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`dcf9ed5`](https://github.com/tobymao/sqlglot/commit/dcf9ed58303bf320f3e3498618bd95639037efde) - compile python generator *(PR [#7528](https://github.com/tobymao/sqlglot/pull/7528) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
compile python generator (#7528)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### :sparkles: New Features
|
|
12
|
+
- [`dcf9ed5`](https://github.com/tobymao/sqlglot/commit/dcf9ed58303bf320f3e3498618bd95639037efde) - **mypyc**: compile python generator *(PR [#7528](https://github.com/tobymao/sqlglot/pull/7528) by [@georgesittas](https://github.com/georgesittas))*
|
|
13
|
+
|
|
14
|
+
### :bug: Bug Fixes
|
|
15
|
+
- [`8e5e255`](https://github.com/tobymao/sqlglot/commit/8e5e2557c7f40c61fcf08d22141a3dd94b3a2ccb) - **postgres**: dotted function calls in create trigger ddls closes [#7527](https://github.com/tobymao/sqlglot/pull/7527) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
16
|
+
|
|
17
|
+
### :wrench: Chores
|
|
18
|
+
- [`08ea329`](https://github.com/tobymao/sqlglot/commit/08ea3293631ba930d01bbb2b62cca969354f8134) - avoid git submodule errors when publishing API docs *(PR [#7526](https://github.com/tobymao/sqlglot/pull/7526) by [@georgesittas](https://github.com/georgesittas))*
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [v30.5.0] - 2026-04-20
|
|
22
|
+
### :boom: BREAKING CHANGES
|
|
23
|
+
- due to [`98ca4cd`](https://github.com/tobymao/sqlglot/commit/98ca4cdd60124c0e566d1de40855b30a169219fd) - transpile TRY_DIVIDE to/from other dialects [CLAUDE] *(PR [#7489](https://github.com/tobymao/sqlglot/pull/7489) by [@baruchoxman](https://github.com/baruchoxman))*:
|
|
24
|
+
|
|
25
|
+
transpile TRY_DIVIDE to/from other dialects [CLAUDE] (#7489)
|
|
26
|
+
|
|
27
|
+
- due to [`ec516f2`](https://github.com/tobymao/sqlglot/commit/ec516f27213286c7b46731ea0fa72972b1b2f68a) - add typed AI scalar function nodes *(PR [#7479](https://github.com/tobymao/sqlglot/pull/7479) by [@RedZapdos123](https://github.com/RedZapdos123))*:
|
|
28
|
+
|
|
29
|
+
add typed AI scalar function nodes (#7479)
|
|
30
|
+
|
|
31
|
+
- due to [`800ca41`](https://github.com/tobymao/sqlglot/commit/800ca4105583e74cf18fed737bd90f24f55de428) - support LOAD DATA FROM FILES syntax *(PR [#7482](https://github.com/tobymao/sqlglot/pull/7482) by [@RedZapdos123](https://github.com/RedZapdos123))*:
|
|
32
|
+
|
|
33
|
+
support LOAD DATA FROM FILES syntax (#7482)
|
|
34
|
+
|
|
35
|
+
- due to [`efbc5e2`](https://github.com/tobymao/sqlglot/commit/efbc5e220c54c838e6684683fddb77f8056692bf) - add missing TO_CHAR format tokens (Mon, Month, Day, Dy, AM/PM, HH) *(PR [#7477](https://github.com/tobymao/sqlglot/pull/7477) by [@mwade0118](https://github.com/mwade0118))*:
|
|
36
|
+
|
|
37
|
+
add missing TO_CHAR format tokens (Mon, Month, Day, Dy, AM/PM, HH) (#7477)
|
|
38
|
+
|
|
39
|
+
- due to [`d289db3`](https://github.com/tobymao/sqlglot/commit/d289db33be43b99096ee9ec8e1c6d695b1d2a4a5) - stop eliminating semi/anti joins, QUALIFY, and FULL OUTER JOIN [CLAUDE] *(PR [#7524](https://github.com/tobymao/sqlglot/pull/7524) by [@dwoldemariam-klav](https://github.com/dwoldemariam-klav))*:
|
|
40
|
+
|
|
41
|
+
stop eliminating semi/anti joins, QUALIFY, and FULL OUTER JOIN [CLAUDE] (#7524)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### :sparkles: New Features
|
|
45
|
+
- [`c80c3fd`](https://github.com/tobymao/sqlglot/commit/c80c3fd5c7f74aec28a3377583018b5aa03ec838) - **duckdb**: warn when transpiling snowflake's `ENCRYPT` *(PR [#7472](https://github.com/tobymao/sqlglot/pull/7472) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
46
|
+
- [`e150296`](https://github.com/tobymao/sqlglot/commit/e15029667b3672d0b0f83fa035da6bd01dda6f3d) - **duckdb**: warn when generating Snowflake's `[TRY_]DECRYPT_RAW` *(PR [#7475](https://github.com/tobymao/sqlglot/pull/7475) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
47
|
+
- [`4ac6389`](https://github.com/tobymao/sqlglot/commit/4ac6389cf9ddde2236e76571453117d681995ecf) - **snowflake**: mark ENCRYPT_RAW as unsupported in DuckDB *(PR [#7485](https://github.com/tobymao/sqlglot/pull/7485) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
48
|
+
- [`ec516f2`](https://github.com/tobymao/sqlglot/commit/ec516f27213286c7b46731ea0fa72972b1b2f68a) - **bigquery**: add typed AI scalar function nodes *(PR [#7479](https://github.com/tobymao/sqlglot/pull/7479) by [@RedZapdos123](https://github.com/RedZapdos123))*
|
|
49
|
+
- :arrow_lower_right: *addresses issue [#7478](https://github.com/tobymao/sqlglot/issues/7478) opened by [@RedZapdos123](https://github.com/RedZapdos123)*
|
|
50
|
+
- [`a7ae102`](https://github.com/tobymao/sqlglot/commit/a7ae102520b5c2632314481d5ef040b3fa129d49) - **duckdb**: mark PARSE_URL as unsupported *(PR [#7499](https://github.com/tobymao/sqlglot/pull/7499) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
51
|
+
- [`045f30e`](https://github.com/tobymao/sqlglot/commit/045f30e6ff8026de4a0a2acbdf8aef604c27a60a) - **duckdb**: mark PARSE_IP as unsupported [CLAUDE] *(PR [#7500](https://github.com/tobymao/sqlglot/pull/7500) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
52
|
+
- [`70dec2e`](https://github.com/tobymao/sqlglot/commit/70dec2ec7e6708406c815fab4436db540efe30fd) - **duckdb**: Add transpilation support for INSERT function *(PR [#7486](https://github.com/tobymao/sqlglot/pull/7486) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
53
|
+
- [`fb7d5b2`](https://github.com/tobymao/sqlglot/commit/fb7d5b2458cd65149475e42271ed22055ad1579f) - **oracle**: Support WHERE on MERGE statement *(PR [#7492](https://github.com/tobymao/sqlglot/pull/7492) by [@galunto](https://github.com/galunto))*
|
|
54
|
+
- [`ed58b9b`](https://github.com/tobymao/sqlglot/commit/ed58b9bd942282e1c9b81af5b11e952211d4fe78) - **clickhouse**: support groupConcat parametric syntax *(PR [#7487](https://github.com/tobymao/sqlglot/pull/7487) by [@betodealmeida](https://github.com/betodealmeida))*
|
|
55
|
+
- [`73c1983`](https://github.com/tobymao/sqlglot/commit/73c198380e083d28ac9f0f42cf74f6280e9052db) - **parser**: introduce flag to control AST size *(PR [#7502](https://github.com/tobymao/sqlglot/pull/7502) by [@georgesittas](https://github.com/georgesittas))*
|
|
56
|
+
- [`b985092`](https://github.com/tobymao/sqlglot/commit/b985092f817fb93670355c166839dc2617b47777) - **duckdb**: Add transpilation support for SUBSTR-SUBSTRING functions *(PR [#7471](https://github.com/tobymao/sqlglot/pull/7471) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
57
|
+
- [`1a55f07`](https://github.com/tobymao/sqlglot/commit/1a55f07cc0b27c3826659c1ba7f7873863d22502) - **duckdb**: transpile snowflake's JAROWINKLER_SIMILARITY properly *(PR [#7501](https://github.com/tobymao/sqlglot/pull/7501) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
58
|
+
- [`5fb1f7c`](https://github.com/tobymao/sqlglot/commit/5fb1f7c3d70d00b1e864a3bc2a1db271e72f8bc4) - **duckdb**: Mark ARRAY_UNION_AGG as unsupported [CLAUDE] *(PR [#7503](https://github.com/tobymao/sqlglot/pull/7503) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
59
|
+
- [`d0407ed`](https://github.com/tobymao/sqlglot/commit/d0407edee90cdf75e11bb5ca3064975c0bbfe08b) - **duckdb**: support dollars in identifiers closes [#7509](https://github.com/tobymao/sqlglot/pull/7509) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
60
|
+
- [`6678ee0`](https://github.com/tobymao/sqlglot/commit/6678ee028d0de97d6cce222302da29477bd3d72b) - **mysql**: Add `INVISIBLE` column constraint for MySQL. *(PR [#7510](https://github.com/tobymao/sqlglot/pull/7510) by [@burnison](https://github.com/burnison))*
|
|
61
|
+
- [`cb91d91`](https://github.com/tobymao/sqlglot/commit/cb91d9142a76234630b4e9dfbccf1fdb8076c830) - **mysql**: support `ALTER TABLE ... RENAME INDEX`. *(PR [#7511](https://github.com/tobymao/sqlglot/pull/7511) by [@burnison](https://github.com/burnison))*
|
|
62
|
+
- [`7660486`](https://github.com/tobymao/sqlglot/commit/7660486c4cc6a679e73d2a45498982d8895b64c0) - **doris, starrocks**: support two-argument DATE_ADD/DATE_SUB *(PR [#7514](https://github.com/tobymao/sqlglot/pull/7514) by [@wuqicyber](https://github.com/wuqicyber))*
|
|
63
|
+
- :arrow_lower_right: *addresses issue [#6341](https://github.com/tobymao/sqlglot/issues/6341) opened by [@HolgerWang1999](https://github.com/HolgerWang1999)*
|
|
64
|
+
- [`e2d6bfe`](https://github.com/tobymao/sqlglot/commit/e2d6bfeeae76846c24dc10a4f758585c828e2928) - **mysql**: parse `ALTER TABLE AUTO_INCREMENT`. *(PR [#7520](https://github.com/tobymao/sqlglot/pull/7520) by [@burnison](https://github.com/burnison))*
|
|
65
|
+
- [`0cd09c2`](https://github.com/tobymao/sqlglot/commit/0cd09c25d14aef5a1c8d9c197bf4b38ad7875e5d) - **mysql**: parse hints on `UPDATE` and `DELETE`. *(PR [#7523](https://github.com/tobymao/sqlglot/pull/7523) by [@burnison](https://github.com/burnison))*
|
|
66
|
+
- [`ceb14fa`](https://github.com/tobymao/sqlglot/commit/ceb14fad0b3e2be7e66523076a78b172d99eb306) - **duckdb**: Add transpilation unsupported for SOUNDEX function *(PR [#7517](https://github.com/tobymao/sqlglot/pull/7517) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
67
|
+
- [`d289db3`](https://github.com/tobymao/sqlglot/commit/d289db33be43b99096ee9ec8e1c6d695b1d2a4a5) - **starrocks**: stop eliminating semi/anti joins, QUALIFY, and FULL OUTER JOIN [CLAUDE] *(PR [#7524](https://github.com/tobymao/sqlglot/pull/7524) by [@dwoldemariam-klav](https://github.com/dwoldemariam-klav))*
|
|
68
|
+
|
|
69
|
+
### :bug: Bug Fixes
|
|
70
|
+
- [`ecd325b`](https://github.com/tobymao/sqlglot/commit/ecd325b4e3e09acfca4273661dffa4aba3302ad4) - **databricks**: support IFF as a synonym for IF [CLAUDE] *(PR [#7488](https://github.com/tobymao/sqlglot/pull/7488) by [@baruchoxman](https://github.com/baruchoxman))*
|
|
71
|
+
- :arrow_lower_right: *fixes issue [#7347](https://github.com/tobymao/sqlglot/issues/7347) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
72
|
+
- [`e3cd4a4`](https://github.com/tobymao/sqlglot/commit/e3cd4a4c175525948e319adede3a743f0128701d) - **bigquery**: parse FOR SYSTEM TIME AS OF (with spaces) *(PR [#7493](https://github.com/tobymao/sqlglot/pull/7493) by [@lawrence3699](https://github.com/lawrence3699))*
|
|
73
|
+
- :arrow_lower_right: *fixes issue [#7481](https://github.com/tobymao/sqlglot/issues/7481) opened by [@roykoand](https://github.com/roykoand)*
|
|
74
|
+
- [`c16630f`](https://github.com/tobymao/sqlglot/commit/c16630f61dfa738ac70079a275426549dfa547d6) - **snowflake**: map JSON type to VARIANT in Snowflake generator [CLAUDE] *(PR [#7496](https://github.com/tobymao/sqlglot/pull/7496) by [@maxa-jonathan-hallee](https://github.com/maxa-jonathan-hallee))*
|
|
75
|
+
- [`98ca4cd`](https://github.com/tobymao/sqlglot/commit/98ca4cdd60124c0e566d1de40855b30a169219fd) - **databricks**: transpile TRY_DIVIDE to/from other dialects [CLAUDE] *(PR [#7489](https://github.com/tobymao/sqlglot/pull/7489) by [@baruchoxman](https://github.com/baruchoxman))*
|
|
76
|
+
- :arrow_lower_right: *fixes issue [#7312](https://github.com/tobymao/sqlglot/issues/7312) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
77
|
+
- [`800ca41`](https://github.com/tobymao/sqlglot/commit/800ca4105583e74cf18fed737bd90f24f55de428) - **bigquery**: support LOAD DATA FROM FILES syntax *(PR [#7482](https://github.com/tobymao/sqlglot/pull/7482) by [@RedZapdos123](https://github.com/RedZapdos123))*
|
|
78
|
+
- :arrow_lower_right: *fixes issue [#7480](https://github.com/tobymao/sqlglot/issues/7480) opened by [@roykoand](https://github.com/roykoand)*
|
|
79
|
+
- [`efbc5e2`](https://github.com/tobymao/sqlglot/commit/efbc5e220c54c838e6684683fddb77f8056692bf) - **postgres**: add missing TO_CHAR format tokens (Mon, Month, Day, Dy, AM/PM, HH) *(PR [#7477](https://github.com/tobymao/sqlglot/pull/7477) by [@mwade0118](https://github.com/mwade0118))*
|
|
80
|
+
- :arrow_lower_right: *fixes issue [#7476](https://github.com/tobymao/sqlglot/issues/7476) opened by [@mwade0118](https://github.com/mwade0118)*
|
|
81
|
+
- [`0b46b39`](https://github.com/tobymao/sqlglot/commit/0b46b39639d149ff57b4b9dc0000732f9096468d) - **snowflake**: transpile REDUCE to DuckDB LIST_REDUCE *(PR [#7505](https://github.com/tobymao/sqlglot/pull/7505) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
82
|
+
- [`35c6d37`](https://github.com/tobymao/sqlglot/commit/35c6d37c5a32fa7dd95b998c5e06688e1bffb7ea) - **duckdb**: wrap OCTET_LENGTH string arguments with ENCODE *(PR [#7507](https://github.com/tobymao/sqlglot/pull/7507) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
83
|
+
- [`930ff33`](https://github.com/tobymao/sqlglot/commit/930ff330616f72966bb67231bfb26301022814c3) - **snowflake**: transpile DuckDB JSON_ARRAY to ARRAY_CONSTRUCT [CLAUDE] *(PR [#7497](https://github.com/tobymao/sqlglot/pull/7497) by [@maxa-jonathan-hallee](https://github.com/maxa-jonathan-hallee))*
|
|
84
|
+
- [`998b42b`](https://github.com/tobymao/sqlglot/commit/998b42b4edd650dd272284d511a724be27e1b89e) - **exasol**: enable minus *(PR [#7521](https://github.com/tobymao/sqlglot/pull/7521) by [@Hfuegl](https://github.com/Hfuegl))*
|
|
85
|
+
- [`18231ca`](https://github.com/tobymao/sqlglot/commit/18231cad0a187e2646e550b27af68b72eef2cd84) - **mysql**: parse quoted constraint names. *(PR [#7519](https://github.com/tobymao/sqlglot/pull/7519) by [@burnison](https://github.com/burnison))*
|
|
86
|
+
- [`6da9653`](https://github.com/tobymao/sqlglot/commit/6da9653d5f25f9d44ad002b9d072b0d8fd39bcc1) - **optimizer**: support bigquery type inference for unnest + array + struct *(PR [#7525](https://github.com/tobymao/sqlglot/pull/7525) by [@geooo109](https://github.com/geooo109))*
|
|
87
|
+
|
|
88
|
+
### :white_check_mark: Tests
|
|
89
|
+
- [`ad2c98d`](https://github.com/tobymao/sqlglot/commit/ad2c98d771a9818a521e15e26dbea3833ed0295a) - **databricks**: add explicit tests for SET VAR / SET VARIABLE [CLAUDE] *(PR [#7490](https://github.com/tobymao/sqlglot/pull/7490) by [@baruchoxman](https://github.com/baruchoxman))*
|
|
90
|
+
- :arrow_lower_right: *addresses issue [#7358](https://github.com/tobymao/sqlglot/issues/7358) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
91
|
+
|
|
92
|
+
### :wrench: Chores
|
|
93
|
+
- [`224e64d`](https://github.com/tobymao/sqlglot/commit/224e64dad3b0dcfc753b9bca78cff326080edbd0) - style for dbx tests *(commit by [@geooo109](https://github.com/geooo109))*
|
|
94
|
+
- [`c1f929f`](https://github.com/tobymao/sqlglot/commit/c1f929fa6cf775bf778a0b832f6df8860bfe62b7) - Fix PR 7510 *(PR [#7513](https://github.com/tobymao/sqlglot/pull/7513) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
95
|
+
|
|
96
|
+
|
|
4
97
|
## [v30.4.3] - 2026-04-13
|
|
5
98
|
### :bug: Bug Fixes
|
|
6
99
|
- [`713e95f`](https://github.com/tobymao/sqlglot/commit/713e95fb9bca5fa6ac0aa660f599a4be632872e2) - **snowflake**: parse GET_DDL #unknown_policy in ROW ACCESS POLICY [CLAUDE] *(PR [#7491](https://github.com/tobymao/sqlglot/pull/7491) by [@eakmanrq](https://github.com/eakmanrq))*
|
|
@@ -14149,3 +14242,5 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
14149
14242
|
[v30.4.0]: https://github.com/tobymao/sqlglot/compare/v30.3.0...v30.4.0
|
|
14150
14243
|
[v30.4.2]: https://github.com/tobymao/sqlglot/compare/v30.4.1...v30.4.2
|
|
14151
14244
|
[v30.4.3]: https://github.com/tobymao/sqlglot/compare/v30.4.2...v30.4.3
|
|
14245
|
+
[v30.5.0]: https://github.com/tobymao/sqlglot/compare/v30.4.3...v30.5.0
|
|
14246
|
+
[v30.6.0]: https://github.com/tobymao/sqlglot/compare/v30.5.0...v30.6.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: install install-dev install-devc install-devc-release install-pre-commit bench bench-parse bench-transpile bench-optimize test test-fast unit testc unitc 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 leakcheck style check docs docs-serve hidec showc clean resolve-integration-conflicts update-fixtures
|
|
2
2
|
|
|
3
3
|
ifdef UV
|
|
4
4
|
PIP := uv pip
|
|
@@ -8,6 +8,7 @@ endif
|
|
|
8
8
|
|
|
9
9
|
SO_BACKUP := /tmp/sqlglot_so_backup
|
|
10
10
|
FIND_SO := find sqlglot -name "*.so"
|
|
11
|
+
NPROC := $(shell python -c "import os; print(os.cpu_count() or 1)")
|
|
11
12
|
|
|
12
13
|
hidec:
|
|
13
14
|
rm -rf $(SO_BACKUP) && $(FIND_SO) | tar cf $(SO_BACKUP) -T - 2>/dev/null && $(FIND_SO) -delete; true
|
|
@@ -37,11 +38,23 @@ install-dev:
|
|
|
37
38
|
fi; \
|
|
38
39
|
fi
|
|
39
40
|
|
|
41
|
+
# sqlglotc requires Python 3.10+ (sqlglot-mypy 1.20+ dropped 3.9). On 3.9
|
|
42
|
+
# we skip the C build; tests fall back to pure-Python sqlglot.
|
|
43
|
+
PY_GE_310 := $(shell python -c "import sys; print(int(sys.version_info >= (3, 10)))")
|
|
44
|
+
|
|
40
45
|
install-devc:
|
|
41
|
-
|
|
46
|
+
@if [ "$(PY_GE_310)" = "1" ]; then \
|
|
47
|
+
cd sqlglotc && MYPYC_OPT=0 python setup.py build_ext --inplace -j $(NPROC); \
|
|
48
|
+
else \
|
|
49
|
+
echo "Skipping sqlglotc build: requires Python 3.10+"; \
|
|
50
|
+
fi
|
|
42
51
|
|
|
43
52
|
install-devc-release: clean
|
|
44
|
-
|
|
53
|
+
@if [ "$(PY_GE_310)" = "1" ]; then \
|
|
54
|
+
cd sqlglotc && python setup.py build_ext --inplace -j $(NPROC); \
|
|
55
|
+
else \
|
|
56
|
+
echo "Skipping sqlglotc build: requires Python 3.10+"; \
|
|
57
|
+
fi
|
|
45
58
|
|
|
46
59
|
install-pre-commit:
|
|
47
60
|
pre-commit install
|
|
@@ -77,6 +90,9 @@ testc: install-devc
|
|
|
77
90
|
unitc: install-devc
|
|
78
91
|
SKIP_INTEGRATION=1 python -m unittest
|
|
79
92
|
|
|
93
|
+
leakcheck: install-devc
|
|
94
|
+
python -m tests.leakcheck
|
|
95
|
+
|
|
80
96
|
style:
|
|
81
97
|
pre-commit run --all-files
|
|
82
98
|
@if [ -f sqlglot-integration-tests/Makefile ]; then $(MAKE) -C sqlglot-integration-tests check-submodule; fi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.7.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,7 +19,8 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Provides-Extra: dev
|
|
21
21
|
Requires-Dist: duckdb>=0.6; extra == "dev"
|
|
22
|
-
Requires-Dist: sqlglot-mypy; extra == "dev"
|
|
22
|
+
Requires-Dist: sqlglot-mypy>=1.20.0.post6; python_version >= "3.10" and extra == "dev"
|
|
23
|
+
Requires-Dist: mypy; python_version < "3.10" and extra == "dev"
|
|
23
24
|
Requires-Dist: setuptools_scm; extra == "dev"
|
|
24
25
|
Requires-Dist: pandas; extra == "dev"
|
|
25
26
|
Requires-Dist: pandas-stubs; extra == "dev"
|
|
@@ -33,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
33
34
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
34
35
|
Requires-Dist: pyperf; extra == "dev"
|
|
35
36
|
Provides-Extra: c
|
|
36
|
-
Requires-Dist: sqlglotc==30.
|
|
37
|
+
Requires-Dist: sqlglotc==30.7.0; python_version >= "3.10" and extra == "c"
|
|
37
38
|
Provides-Extra: rs
|
|
38
39
|
Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
|
|
39
|
-
Requires-Dist: sqlglotc==30.
|
|
40
|
+
Requires-Dist: sqlglotc==30.7.0; python_version >= "3.10" and extra == "rs"
|
|
40
41
|
Dynamic: license-file
|
|
41
42
|
Dynamic: provides-extra
|
|
42
43
|
|
sqlglot-30.7.0/setup.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
from setuptools_scm import get_version
|
|
3
|
+
|
|
4
|
+
version = get_version(local_scheme="no-local-version")
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
extras_require={
|
|
8
|
+
"dev": [
|
|
9
|
+
"duckdb>=0.6",
|
|
10
|
+
# sqlglot-mypy 1.20+ is the build dep for sqlglotc and only ships
|
|
11
|
+
# for py3.10+; on py3.9 just use upstream mypy for type checking.
|
|
12
|
+
"sqlglot-mypy >= 1.20.0.post6; python_version >= '3.10'",
|
|
13
|
+
"mypy; python_version < '3.10'",
|
|
14
|
+
"setuptools_scm",
|
|
15
|
+
"pandas",
|
|
16
|
+
"pandas-stubs",
|
|
17
|
+
"python-dateutil",
|
|
18
|
+
"pytz",
|
|
19
|
+
"pdoc",
|
|
20
|
+
"pre-commit",
|
|
21
|
+
"ruff==0.15.6",
|
|
22
|
+
"types-python-dateutil",
|
|
23
|
+
"types-pytz",
|
|
24
|
+
"typing_extensions",
|
|
25
|
+
"pyperf",
|
|
26
|
+
],
|
|
27
|
+
# Compiles from source on the user's machine. Requires Python 3.10+
|
|
28
|
+
# because the build dep (sqlglot-mypy 1.20+) dropped 3.9; on 3.9
|
|
29
|
+
# `pip install sqlglot[c]` is a no-op and you just get pure-Python sqlglot.
|
|
30
|
+
"c": [f"sqlglotc=={version}; python_version >= '3.10'"],
|
|
31
|
+
# Deprecated: the Rust tokenizer has been replaced by sqlglotc.
|
|
32
|
+
"rs": ["sqlglotrs==0.13.0", f"sqlglotc=={version}; python_version >= '3.10'"],
|
|
33
|
+
},
|
|
34
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ruff: noqa: F401
|
|
1
|
+
# ruff: noqa: F401
|
|
2
2
|
"""
|
|
3
3
|
.. include:: ../README.md
|
|
4
4
|
|
|
@@ -7,25 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
-
# bootstrap mypyc runtime: compiled .so modules do a top-level `import HASH__mypyc`,
|
|
11
|
-
# but the runtime .so lives inside sqlglot/. Pre-load it into sys.modules.
|
|
12
|
-
# this is only needed for editable builds
|
|
13
10
|
from collections.abc import Collection
|
|
14
|
-
import sys
|
|
15
|
-
from pathlib import Path
|
|
16
11
|
from builtins import type as Type
|
|
17
12
|
|
|
18
|
-
for path in Path(__file__).parent.glob("*__mypyc*.so"):
|
|
19
|
-
name = path.stem.split(".")[0]
|
|
20
|
-
if name not in sys.modules:
|
|
21
|
-
import importlib.util
|
|
22
|
-
|
|
23
|
-
spec = importlib.util.spec_from_file_location(name, path)
|
|
24
|
-
if spec and spec.loader:
|
|
25
|
-
mod = importlib.util.module_from_spec(spec)
|
|
26
|
-
sys.modules[name] = mod
|
|
27
|
-
spec.loader.exec_module(mod)
|
|
28
|
-
|
|
29
13
|
import logging
|
|
30
14
|
import typing as t
|
|
31
15
|
|
|
@@ -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.7.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 7, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g693f4ed6d'
|
|
@@ -399,6 +399,9 @@ class Dialect(metaclass=_Dialect):
|
|
|
399
399
|
CONCAT_COALESCE = False
|
|
400
400
|
"""A `NULL` arg in `CONCAT` yields `NULL` by default, but in some dialects it yields an empty string."""
|
|
401
401
|
|
|
402
|
+
CONCAT_WS_COALESCE = False
|
|
403
|
+
"""A `NULL` arg in `CONCAT_WS` yields `NULL` by default, but in some dialects it is skipped."""
|
|
404
|
+
|
|
402
405
|
HEX_LOWERCASE = False
|
|
403
406
|
"""Whether the `HEX` function returns a lowercase hexadecimal string."""
|
|
404
407
|
|
|
@@ -1761,15 +1764,16 @@ def count_if_to_sum(self: Generator, expression: exp.CountIf) -> str:
|
|
|
1761
1764
|
|
|
1762
1765
|
|
|
1763
1766
|
def trim_sql(self: Generator, expression: exp.Trim, default_trim_type: str = "") -> str:
|
|
1764
|
-
target = self.sql(expression, "this")
|
|
1765
|
-
trim_type = self.sql(expression, "position") or default_trim_type
|
|
1766
1767
|
remove_chars = self.sql(expression, "expression")
|
|
1767
|
-
collation = self.sql(expression, "collation")
|
|
1768
1768
|
|
|
1769
1769
|
# Use TRIM/LTRIM/RTRIM syntax if the expression isn't database-specific
|
|
1770
1770
|
if not remove_chars:
|
|
1771
1771
|
return self.trim_sql(expression)
|
|
1772
1772
|
|
|
1773
|
+
target = self.sql(expression, "this")
|
|
1774
|
+
trim_type = self.sql(expression, "position") or default_trim_type
|
|
1775
|
+
collation = self.sql(expression, "collation")
|
|
1776
|
+
|
|
1773
1777
|
trim_type = f"{trim_type} " if trim_type else ""
|
|
1774
1778
|
remove_chars = f"{remove_chars} " if remove_chars else ""
|
|
1775
1779
|
from_part = "FROM " if trim_type or remove_chars else ""
|
|
@@ -1827,7 +1831,7 @@ def pivot_column_names(aggregations: Iterable[exp.Expr], dialect: DialectType) -
|
|
|
1827
1831
|
be quoted in the base parser's `_parse_pivot` method, due to `to_identifier`.
|
|
1828
1832
|
Otherwise, we'd end up with `col_avg(`foo`)` (notice the double quotes).
|
|
1829
1833
|
"""
|
|
1830
|
-
agg_all_unquoted = agg.transform(
|
|
1834
|
+
agg_all_unquoted: exp.Expr = agg.transform(
|
|
1831
1835
|
lambda node: (
|
|
1832
1836
|
exp.Identifier(this=node.name, quoted=False)
|
|
1833
1837
|
if isinstance(node, exp.Identifier)
|
|
@@ -2236,7 +2240,7 @@ def build_default_decimal_type(
|
|
|
2236
2240
|
return dtype
|
|
2237
2241
|
|
|
2238
2242
|
params = f"{precision}{f', {scale}' if scale is not None else ''}"
|
|
2239
|
-
return exp.DataType.
|
|
2243
|
+
return exp.DataType.from_str(f"DECIMAL({params})")
|
|
2240
2244
|
|
|
2241
2245
|
return _builder
|
|
2242
2246
|
|
|
@@ -19,10 +19,12 @@ class DuckDB(Dialect):
|
|
|
19
19
|
SAFE_DIVISION = True
|
|
20
20
|
INDEX_OFFSET = 1
|
|
21
21
|
CONCAT_COALESCE = True
|
|
22
|
+
CONCAT_WS_COALESCE = True
|
|
22
23
|
SUPPORTS_ORDER_BY_ALL = True
|
|
23
24
|
SUPPORTS_FIXED_SIZE_ARRAYS = True
|
|
24
25
|
STRICT_JSON_PATH_SYNTAX = False
|
|
25
26
|
NUMBERS_CAN_BE_UNDERSCORE_SEPARATED = True
|
|
27
|
+
UUID_IS_STRING_TYPE = False
|
|
26
28
|
|
|
27
29
|
# https://duckdb.org/docs/sql/introduction.html#creating-a-new-table
|
|
28
30
|
NORMALIZATION_STRATEGY = NormalizationStrategy.CASE_INSENSITIVE
|
|
@@ -20,6 +20,7 @@ class Hive(Dialect):
|
|
|
20
20
|
IDENTIFIERS_CAN_START_WITH_DIGIT = True
|
|
21
21
|
SUPPORTS_USER_DEFINED_TYPES = False
|
|
22
22
|
SAFE_DIVISION = True
|
|
23
|
+
CONCAT_WS_COALESCE = True
|
|
23
24
|
ARRAY_AGG_INCLUDES_NULLS = None
|
|
24
25
|
REGEXP_EXTRACT_DEFAULT_GROUP = 1
|
|
25
26
|
ALTER_TABLE_SUPPORTS_CASCADE = True
|
|
@@ -2,13 +2,13 @@ import collections
|
|
|
2
2
|
import itertools
|
|
3
3
|
import math
|
|
4
4
|
|
|
5
|
-
from sqlglot import exp,
|
|
6
|
-
from sqlglot.dialects.dialect import Dialect
|
|
5
|
+
from sqlglot import exp, planner, tokens
|
|
6
|
+
from sqlglot.dialects.dialect import Dialect
|
|
7
7
|
from sqlglot.errors import ExecuteError
|
|
8
8
|
from sqlglot.executor.context import Context
|
|
9
9
|
from sqlglot.executor.env import ENV
|
|
10
10
|
from sqlglot.executor.table import RowReader, Table
|
|
11
|
-
from sqlglot.
|
|
11
|
+
from sqlglot.generators.python import PythonGenerator
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class PythonExecutor:
|
|
@@ -324,112 +324,8 @@ class PythonExecutor:
|
|
|
324
324
|
return self.context({step.name: sink})
|
|
325
325
|
|
|
326
326
|
|
|
327
|
-
def _ordered_py(self, expression):
|
|
328
|
-
this = self.sql(expression, "this")
|
|
329
|
-
desc = "True" if expression.args.get("desc") else "False"
|
|
330
|
-
nulls_first = "True" if expression.args.get("nulls_first") else "False"
|
|
331
|
-
return f"ORDERED({this}, {desc}, {nulls_first})"
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
def _rename(self, e):
|
|
335
|
-
try:
|
|
336
|
-
values = list(e.args.values())
|
|
337
|
-
|
|
338
|
-
if len(values) == 1:
|
|
339
|
-
values = values[0]
|
|
340
|
-
if not isinstance(values, list):
|
|
341
|
-
return self.func(e.key, values)
|
|
342
|
-
return self.func(e.key, *values)
|
|
343
|
-
|
|
344
|
-
if isinstance(e, exp.Func) and e.is_var_len_args:
|
|
345
|
-
args = itertools.chain.from_iterable(x if isinstance(x, list) else [x] for x in values)
|
|
346
|
-
return self.func(e.key, *args)
|
|
347
|
-
|
|
348
|
-
return self.func(e.key, *values)
|
|
349
|
-
except Exception as ex:
|
|
350
|
-
raise Exception(f"Could not rename {repr(e)}") from ex
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
def _case_sql(self, expression):
|
|
354
|
-
this = self.sql(expression, "this")
|
|
355
|
-
chain = self.sql(expression, "default") or "None"
|
|
356
|
-
|
|
357
|
-
for e in reversed(expression.args["ifs"]):
|
|
358
|
-
true = self.sql(e, "true")
|
|
359
|
-
condition = self.sql(e, "this")
|
|
360
|
-
condition = f"{this} = ({condition})" if this else condition
|
|
361
|
-
chain = f"{true} if {condition} else ({chain})"
|
|
362
|
-
|
|
363
|
-
return chain
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
def _lambda_sql(self, e: exp.Lambda) -> str:
|
|
367
|
-
names = {e.name.lower() for e in e.expressions}
|
|
368
|
-
|
|
369
|
-
e = e.transform(
|
|
370
|
-
lambda n: (
|
|
371
|
-
exp.var(n.name) if isinstance(n, exp.Identifier) and n.name.lower() in names else n
|
|
372
|
-
)
|
|
373
|
-
).assert_is(exp.Lambda)
|
|
374
|
-
|
|
375
|
-
return f"lambda {self.expressions(e, flat=True)}: {self.sql(e, 'this')}"
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
def _div_sql(self: generator.Generator, e: exp.Div) -> str:
|
|
379
|
-
denominator = self.sql(e, "expression")
|
|
380
|
-
|
|
381
|
-
if e.args.get("safe"):
|
|
382
|
-
denominator += " or None"
|
|
383
|
-
|
|
384
|
-
sql = f"DIV({self.sql(e, 'this')}, {denominator})"
|
|
385
|
-
|
|
386
|
-
if e.args.get("typed"):
|
|
387
|
-
sql = f"int({sql})"
|
|
388
|
-
|
|
389
|
-
return sql
|
|
390
|
-
|
|
391
|
-
|
|
392
327
|
class Python(Dialect):
|
|
393
328
|
class Tokenizer(tokens.Tokenizer):
|
|
394
329
|
STRING_ESCAPES = ["\\"]
|
|
395
330
|
|
|
396
|
-
|
|
397
|
-
TRANSFORMS = {
|
|
398
|
-
**{klass: _rename for klass in subclasses(exp.__name__, exp.Binary)},
|
|
399
|
-
**{klass: _rename for klass in exp.ALL_FUNCTIONS},
|
|
400
|
-
exp.Case: _case_sql,
|
|
401
|
-
exp.Alias: lambda self, e: self.sql(e.this),
|
|
402
|
-
exp.Array: inline_array_sql,
|
|
403
|
-
exp.And: lambda self, e: self.binary(e, "and"),
|
|
404
|
-
exp.Between: _rename,
|
|
405
|
-
exp.Boolean: lambda self, e: "True" if e.this else "False",
|
|
406
|
-
exp.Cast: lambda self, e: f"CAST({self.sql(e.this)}, exp.DType.{e.args['to']})",
|
|
407
|
-
exp.Column: lambda self, e: (
|
|
408
|
-
f"scope[{self.sql(e, 'table') or None}][{self.sql(e.this)}]"
|
|
409
|
-
),
|
|
410
|
-
exp.Concat: lambda self, e: self.func(
|
|
411
|
-
"SAFECONCAT" if e.args.get("safe") else "CONCAT", *e.expressions
|
|
412
|
-
),
|
|
413
|
-
exp.Distinct: lambda self, e: f"set({self.sql(e, 'this')})",
|
|
414
|
-
exp.Div: _div_sql,
|
|
415
|
-
exp.Extract: lambda self, e: (
|
|
416
|
-
f"EXTRACT('{e.name.lower()}', {self.sql(e, 'expression')})"
|
|
417
|
-
),
|
|
418
|
-
exp.In: lambda self, e: (
|
|
419
|
-
f"{self.sql(e, 'this')} in {{{self.expressions(e, flat=True)}}}"
|
|
420
|
-
),
|
|
421
|
-
exp.Interval: lambda self, e: f"INTERVAL({self.sql(e.this)}, '{self.sql(e.unit)}')",
|
|
422
|
-
exp.Is: lambda self, e: (
|
|
423
|
-
self.binary(e, "==") if isinstance(e.this, exp.Literal) else self.binary(e, "is")
|
|
424
|
-
),
|
|
425
|
-
exp.JSONExtract: lambda self, e: self.func(e.key, e.this, e.expression, *e.expressions),
|
|
426
|
-
exp.JSONPath: lambda self, e: f"[{','.join(self.sql(p) for p in e.expressions[1:])}]",
|
|
427
|
-
exp.JSONPathKey: lambda self, e: f"'{self.sql(e.this)}'",
|
|
428
|
-
exp.JSONPathSubscript: lambda self, e: f"'{e.this}'",
|
|
429
|
-
exp.Lambda: _lambda_sql,
|
|
430
|
-
exp.Not: lambda self, e: f"not {self.sql(e.this)}",
|
|
431
|
-
exp.Null: lambda *_: "None",
|
|
432
|
-
exp.Or: lambda self, e: self.binary(e, "or"),
|
|
433
|
-
exp.Ordered: _ordered_py,
|
|
434
|
-
exp.Star: lambda *_: "1",
|
|
435
|
-
}
|
|
331
|
+
Generator = PythonGenerator
|
|
@@ -189,7 +189,11 @@ class Flatten(Expression, Func):
|
|
|
189
189
|
|
|
190
190
|
class StringToArray(Expression, Func):
|
|
191
191
|
arg_types = {"this": True, "expression": False, "null": False}
|
|
192
|
-
_sql_names = ["STRING_TO_ARRAY", "SPLIT_BY_STRING"
|
|
192
|
+
_sql_names = ["STRING_TO_ARRAY", "SPLIT_BY_STRING"]
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class StrtokToArray(Expression, Func):
|
|
196
|
+
arg_types = {"this": True, "expression": False}
|
|
193
197
|
|
|
194
198
|
|
|
195
199
|
# Higher-order / lambda
|