sqlglot 30.36.0__tar.gz → 30.37.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.36.0 → sqlglot-30.37.0}/CHANGELOG.md +89 -0
- {sqlglot-30.36.0/sqlglot.egg-info → sqlglot-30.37.0}/PKG-INFO +3 -3
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/_version.py +3 -3
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/dialect.py +2 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/doris.py +5 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/presto.py +3 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/array.py +1 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generator.py +1 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/doris.py +104 -9
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/duckdb.py +35 -3
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/mysql.py +1 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/postgres.py +20 -12
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/presto.py +9 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/annotate_types.py +16 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/qualify_columns.py +6 -6
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/scope.py +3 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/simplify.py +22 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parser.py +10 -5
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/clickhouse.py +53 -7
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/doris.py +53 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/presto.py +80 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/spark2.py +28 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/duckdb.py +40 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/presto.py +30 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0/sqlglot.egg-info}/PKG-INFO +3 -3
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.egg-info/requires.txt +2 -2
- sqlglot-30.37.0/sqlglot.egg-info/scm_version.json +8 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_bigquery.py +22 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_clickhouse.py +45 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_doris.py +130 -4
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_duckdb.py +29 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_mysql.py +1 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_postgres.py +2 -2
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_presto.py +54 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_spark.py +28 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_trino.py +85 -1
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/annotate_functions.sql +136 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/annotate_types.sql +4 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/qualify_columns.sql +8 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/simplify.sql +23 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_optimizer.py +15 -0
- sqlglot-30.36.0/sqlglot.egg-info/scm_version.json +0 -8
- {sqlglot-30.36.0 → sqlglot-30.37.0}/.gitignore +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/.gitmodules +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/.gitpod.yml +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/AGENTS.md +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/CLAUDE.md +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/CONTRIBUTING.md +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/LICENSE +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/MANIFEST.in +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/Makefile +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/README.md +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/pyproject.toml +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/setup.cfg +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/setup.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/__main__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/_typing.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/anonymize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/bigquery.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/dax.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/duckdb.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/snowflake.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/diff.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/errors.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/aggregate.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/builders.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/constraints.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/core.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/datatypes.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/ddl.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/dml.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/functions.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/json.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/math.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/properties.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/query.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/string.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/expressions/temporal.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/athena.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/bigquery.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/clickhouse.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/databricks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/dax.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/dremio.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/drill.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/druid.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/dune.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/exasol.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/fabric.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/hive.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/materialize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/oracle.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/prql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/python.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/redshift.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/risingwave.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/singlestore.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/snowflake.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/solr.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/spark.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/spark2.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/sqlite.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/starrocks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/tableau.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/teradata.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/trino.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/generators/tsql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/helper.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/lineage.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/canonicalize_internal_names.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/helpers.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/journal.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/resolver.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/athena.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/base.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/bigquery.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/databricks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/dax.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/dremio.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/drill.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/druid.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/duckdb.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/dune.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/exasol.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/fabric.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/hive.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/materialize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/mysql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/oracle.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/postgres.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/prql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/redshift.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/risingwave.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/singlestore.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/snowflake.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/solr.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/spark.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/sqlite.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/starrocks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/tableau.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/teradata.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/trino.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/parsers/tsql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/planner.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/py.typed +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/schema.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/serde.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/time.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/tokenizer_core.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/tokens.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/transforms.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/trie.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/bigquery.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/clickhouse.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/databricks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/dremio.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/hive.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/mysql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/postgres.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/redshift.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/snowflake.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/spark.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/spark2.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/sqlite.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot/typing/tsql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.egg-info/scm_file_list.json +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglot.png +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglotc/MANIFEST.in +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglotc/pyproject.toml +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/sqlglotc/setup.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_dax.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_dialect.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_hive.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_snowflake.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_solr.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/identity.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/canonicalize_internal_names.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/helpers.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/leakcheck.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/sqlglot/__init__.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_anonymize.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_build.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_dialect_entry_points.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_diff.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_docs.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_errors.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_executor.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_expressions.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_generator.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_helper.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_integration_loader.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_lineage.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_optimize_cross_joins.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_parser.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_schema.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_serde.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_simplify_between.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_sqlglotc.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_time.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_tokens.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_transforms.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_transpile.py +0 -0
- {sqlglot-30.36.0 → sqlglot-30.37.0}/tests/test_typing.py +0 -0
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v30.36.0] - 2026-12-01
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`2c7c416`](https://github.com/tobymao/sqlglot/commit/2c7c416314cbb366acc30af253f48dff1474f53a) - preserve LIKE function argument order [CODEX] *(PR [#9416](https://github.com/tobymao/sqlglot/pull/9416) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
preserve LIKE function argument order [CODEX] (#9416)
|
|
9
|
+
|
|
10
|
+
- due to [`e9c80d4`](https://github.com/tobymao/sqlglot/commit/e9c80d46f17ec7d1c08085296a7d300831fa9b70) - parse MATCH_RECOGNIZE as a postfix of its relation *(PR [#9402](https://github.com/tobymao/sqlglot/pull/9402) by [@geooo109](https://github.com/geooo109))*:
|
|
11
|
+
|
|
12
|
+
parse MATCH_RECOGNIZE as a postfix of its relation (#9402)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### :bug: Bug Fixes
|
|
16
|
+
- [`d1db7a9`](https://github.com/tobymao/sqlglot/commit/d1db7a9e8b76b0bf6146087cbea5b460cbcaad83) - **optimizer**: don't treat window functions as aggregates when unnesting scalar subqueries *(PR [#9339](https://github.com/tobymao/sqlglot/pull/9339) by [@geooo109](https://github.com/geooo109))*
|
|
17
|
+
- :arrow_lower_right: *fixes issue [#9314](https://github.com/tobymao/sqlglot/issues/9314) opened by [@dayan02dev](https://github.com/dayan02dev)*
|
|
18
|
+
- [`7b7c526`](https://github.com/tobymao/sqlglot/commit/7b7c52660675501ddf4c5d04c5b9d9fbda124b4c) - **spark**: preserve STRING_AGG ordering on older runtimes *(PR [#9325](https://github.com/tobymao/sqlglot/pull/9325) by [@georgesittas](https://github.com/georgesittas))*
|
|
19
|
+
- :arrow_lower_right: *fixes issue [#9308](https://github.com/tobymao/sqlglot/issues/9308) opened by [@jackie-h](https://github.com/jackie-h)*
|
|
20
|
+
- [`5e405bb`](https://github.com/tobymao/sqlglot/commit/5e405bbef15c96f2e1befff06eb6abe64a4683d3) - **trino**: parse and generate bare CURRENT_SCHEMA *(PR [#9356](https://github.com/tobymao/sqlglot/pull/9356) by [@georgesittas](https://github.com/georgesittas))*
|
|
21
|
+
- [`d766930`](https://github.com/tobymao/sqlglot/commit/d766930d827d61d861b8bcee1a6ba8670d2a4b53) - **doris**: preserve ARRAY_FILTER *(PR [#9354](https://github.com/tobymao/sqlglot/pull/9354) by [@geooo109](https://github.com/geooo109))*
|
|
22
|
+
- :arrow_lower_right: *fixes issue [#9352](https://github.com/tobymao/sqlglot/issues/9352) opened by [@matanper](https://github.com/matanper)*
|
|
23
|
+
- [`a0baa22`](https://github.com/tobymao/sqlglot/commit/a0baa2200b77617ece1b7de94b5333a250287861) - **duckdb**: preserve zero-based offsets for named UNNEST values *(PR [#9357](https://github.com/tobymao/sqlglot/pull/9357) by [@georgesittas](https://github.com/georgesittas))*
|
|
24
|
+
- [`438adbf`](https://github.com/tobymao/sqlglot/commit/438adbf2dc362e8e0ede98b781add47725ad5aad) - **doris**: support LARGEINT, IPV4, and IPV6 types *(PR [#9360](https://github.com/tobymao/sqlglot/pull/9360) by [@georgesittas](https://github.com/georgesittas))*
|
|
25
|
+
- :arrow_lower_right: *fixes issue [#9350](https://github.com/tobymao/sqlglot/issues/9350) opened by [@matanper](https://github.com/matanper)*
|
|
26
|
+
- [`c5e479d`](https://github.com/tobymao/sqlglot/commit/c5e479d7e33f0666dd74b9010a6744d7aca568ec) - **doris**: preserve the COLLECT_SET size limit *(PR [#9362](https://github.com/tobymao/sqlglot/pull/9362) by [@georgesittas](https://github.com/georgesittas))*
|
|
27
|
+
- :arrow_lower_right: *fixes issue [#9353](https://github.com/tobymao/sqlglot/issues/9353) opened by [@matanper](https://github.com/matanper)*
|
|
28
|
+
- [`9e4cf21`](https://github.com/tobymao/sqlglot/commit/9e4cf21a6614d402b1afd61ef883dd60f4b35984) - **duckdb**: infer integer literal types by value *(PR [#9342](https://github.com/tobymao/sqlglot/pull/9342) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
29
|
+
- [`785366d`](https://github.com/tobymao/sqlglot/commit/785366d6d18421914385bfb78acbd6f87fa1d4b2) - **doris**: generate native null ordering in ORDER BY *(PR [#9361](https://github.com/tobymao/sqlglot/pull/9361) by [@georgesittas](https://github.com/georgesittas))*
|
|
30
|
+
- :arrow_lower_right: *fixes issue [#9351](https://github.com/tobymao/sqlglot/issues/9351) opened by [@matanper](https://github.com/matanper)*
|
|
31
|
+
- [`c6b4b85`](https://github.com/tobymao/sqlglot/commit/c6b4b85e8c470f071d5bf556511a2fcdafd3b172) - **optimizer**: preserve volatile projection values across rewrites *(PR [#9364](https://github.com/tobymao/sqlglot/pull/9364) by [@georgesittas](https://github.com/georgesittas))*
|
|
32
|
+
- :arrow_lower_right: *fixes issue [#9355](https://github.com/tobymao/sqlglot/issues/9355) opened by [@anishmehta24](https://github.com/anishmehta24)*
|
|
33
|
+
- [`729afd9`](https://github.com/tobymao/sqlglot/commit/729afd969ae43a94fda0e56275cdf3506b7d1fe6) - **optimizer**: preserve comparison strictness when merging equal bounds *(PR [#9363](https://github.com/tobymao/sqlglot/pull/9363) by [@georgesittas](https://github.com/georgesittas))*
|
|
34
|
+
- :arrow_lower_right: *fixes issue [#9349](https://github.com/tobymao/sqlglot/issues/9349) opened by [@1solomonwakhungu](https://github.com/1solomonwakhungu)*
|
|
35
|
+
- [`b152853`](https://github.com/tobymao/sqlglot/commit/b152853448e6cf62b6d177b4bb124f08c511ee0f) - **duckdb**: preserve aliases and comments in UNNEST offset rewrites *(PR [#9359](https://github.com/tobymao/sqlglot/pull/9359) by [@georgesittas](https://github.com/georgesittas))*
|
|
36
|
+
- [`b1896fd`](https://github.com/tobymao/sqlglot/commit/b1896fd0f5d22ff6477a78bddfad34025c6bb687) - **postgres**: preserve zero-based offsets for named UNNEST values *(PR [#9358](https://github.com/tobymao/sqlglot/pull/9358) by [@georgesittas](https://github.com/georgesittas))*
|
|
37
|
+
- [`8f5853c`](https://github.com/tobymao/sqlglot/commit/8f5853c539dec75eb6f55ad79bf678ba4ee91a23) - **trino**: quote reserved keywords used as identifiers *(PR [#9367](https://github.com/tobymao/sqlglot/pull/9367) by [@georgesittas](https://github.com/georgesittas))*
|
|
38
|
+
- :arrow_lower_right: *fixes issue [#9366](https://github.com/tobymao/sqlglot/issues/9366) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
39
|
+
- [`8da47dc`](https://github.com/tobymao/sqlglot/commit/8da47dc5cad9aaae0377226de38d52e0fd364e6d) - **duckdb**: preserve day-of-week numbering across dialects *(PR [#9365](https://github.com/tobymao/sqlglot/pull/9365) by [@georgesittas](https://github.com/georgesittas))*
|
|
40
|
+
- :arrow_lower_right: *fixes issue [#9347](https://github.com/tobymao/sqlglot/issues/9347) opened by [@tushar-mahalya](https://github.com/tushar-mahalya)*
|
|
41
|
+
- [`ebe4585`](https://github.com/tobymao/sqlglot/commit/ebe4585a6839238714b03e0bddc3b251b66d9a37) - **trino**: preserve zero-based offsets for named UNNEST values *(PR [#9371](https://github.com/tobymao/sqlglot/pull/9371) by [@georgesittas](https://github.com/georgesittas))*
|
|
42
|
+
- [`c7a2910`](https://github.com/tobymao/sqlglot/commit/c7a2910ad2ea508455c249da88f4c6037299f0e3) - **bigquery**: preserve JSON types through field and subscript access *(PR [#9348](https://github.com/tobymao/sqlglot/pull/9348) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
43
|
+
- [`e35d465`](https://github.com/tobymao/sqlglot/commit/e35d4651ac99cca5cb99b9850ecb7e6354568d44) - **tsql**: translate PostgreSQL DOW and DOY extraction [CODEX] *(PR [#9376](https://github.com/tobymao/sqlglot/pull/9376) by [@georgesittas](https://github.com/georgesittas))*
|
|
44
|
+
- :arrow_lower_right: *fixes issue [#9368](https://github.com/tobymao/sqlglot/issues/9368) opened by [@rahul05ranjan](https://github.com/rahul05ranjan)*
|
|
45
|
+
- [`0c79658`](https://github.com/tobymao/sqlglot/commit/0c79658d34b54ae7614472d4287d610d7fb052cd) - **doris**: support array value constructors *(PR [#9379](https://github.com/tobymao/sqlglot/pull/9379) by [@geooo109](https://github.com/geooo109))*
|
|
46
|
+
- :arrow_lower_right: *fixes issue [#9377](https://github.com/tobymao/sqlglot/issues/9377) opened by [@Ragnaroos](https://github.com/Ragnaroos)*
|
|
47
|
+
- [`43a4a49`](https://github.com/tobymao/sqlglot/commit/43a4a49bb11e8ad92f53410fc5c33774bbebf3da) - **postgres**: parse EVERY as a boolean aggregate [CODEX] *(PR [#9381](https://github.com/tobymao/sqlglot/pull/9381) by [@georgesittas](https://github.com/georgesittas))*
|
|
48
|
+
- :arrow_lower_right: *fixes issue [#9378](https://github.com/tobymao/sqlglot/issues/9378) opened by [@Ragnaroos](https://github.com/Ragnaroos)*
|
|
49
|
+
- [`0a27bf8`](https://github.com/tobymao/sqlglot/commit/0a27bf8a5d05e0ea7e0c75ff149339c3be46d6cd) - **clickhouse**: parse usernames in view DEFINER clauses *(PR [#9382](https://github.com/tobymao/sqlglot/pull/9382) by [@georgesittas](https://github.com/georgesittas))*
|
|
50
|
+
- :arrow_lower_right: *fixes issue [#9380](https://github.com/tobymao/sqlglot/issues/9380) opened by [@ne1r0n](https://github.com/ne1r0n)*
|
|
51
|
+
- [`c32d7e3`](https://github.com/tobymao/sqlglot/commit/c32d7e36c6d36caf17dd85e25675affff33568eb) - **databricks**: distinguish CURRENT_PATH from column references *(PR [#9374](https://github.com/tobymao/sqlglot/pull/9374) by [@georgesittas](https://github.com/georgesittas))*
|
|
52
|
+
- :arrow_lower_right: *fixes issue [#9370](https://github.com/tobymao/sqlglot/issues/9370) opened by [@baruchoxman](https://github.com/baruchoxman)*
|
|
53
|
+
- [`fb46cd7`](https://github.com/tobymao/sqlglot/commit/fb46cd784028f4c980b825245cfbdea41461ef86) - **sqlite**: translate EXTRACT for calendar date parts [CODEX] *(PR [#9386](https://github.com/tobymao/sqlglot/pull/9386) by [@georgesittas](https://github.com/georgesittas))*
|
|
54
|
+
- :arrow_lower_right: *fixes issue [#9385](https://github.com/tobymao/sqlglot/issues/9385) opened by [@joeharris76](https://github.com/joeharris76)*
|
|
55
|
+
- [`ba06510`](https://github.com/tobymao/sqlglot/commit/ba0651085c690b8b49e9b9dba2f4a37dbb9055e0) - **postgres**: infer integer literal types by value *(PR [#9373](https://github.com/tobymao/sqlglot/pull/9373) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
56
|
+
- [`e27077c`](https://github.com/tobymao/sqlglot/commit/e27077c9a0e4872447644bbf9ec2c8abc5a1796b) - **sqlite**: infer integer literal types by value *(PR [#9389](https://github.com/tobymao/sqlglot/pull/9389) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
57
|
+
- [`f0c46bb`](https://github.com/tobymao/sqlglot/commit/f0c46bb219badeabfd0c31dfbd457973d67ffac5) - **clickhouse**: parse ARRAY JOIN operands as expressions *(PR [#9397](https://github.com/tobymao/sqlglot/pull/9397) by [@georgesittas](https://github.com/georgesittas))*
|
|
58
|
+
- :arrow_lower_right: *fixes issue [#9387](https://github.com/tobymao/sqlglot/issues/9387) opened by [@ne1r0n](https://github.com/ne1r0n)*
|
|
59
|
+
- [`ab03a26`](https://github.com/tobymao/sqlglot/commit/ab03a263d80e65e546dd723c743260bdec5cb9e8) - **clickhouse**: render nested JSON selections without a write dialect *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
60
|
+
- [`eef45a5`](https://github.com/tobymao/sqlglot/commit/eef45a566c8cf764dff6a20ca7068e3cdab33b08) - **doris**: preserve PostgreSQL ARRAY_AGG null semantics [CODEX] *(PR [#9399](https://github.com/tobymao/sqlglot/pull/9399) by [@georgesittas](https://github.com/georgesittas))*
|
|
61
|
+
- :arrow_lower_right: *fixes issue [#9393](https://github.com/tobymao/sqlglot/issues/9393) opened by [@Ragnaroos](https://github.com/Ragnaroos)*
|
|
62
|
+
- [`70a5027`](https://github.com/tobymao/sqlglot/commit/70a5027e8637e28225577260e2f532da9c9821f2) - **doris**: rewrite filters on ordinary aggregates *(PR [#9400](https://github.com/tobymao/sqlglot/pull/9400) by [@georgesittas](https://github.com/georgesittas))*
|
|
63
|
+
- :arrow_lower_right: *fixes issue [#9392](https://github.com/tobymao/sqlglot/issues/9392) opened by [@Ragnaroos](https://github.com/Ragnaroos)*
|
|
64
|
+
- [`c891883`](https://github.com/tobymao/sqlglot/commit/c891883e936dbeae7fb8af84ec96d43ac4dcbda0) - **postgres**: distinguish positional parameters from dollar-quoted strings [CODEX] *(PR [#9401](https://github.com/tobymao/sqlglot/pull/9401) by [@georgesittas](https://github.com/georgesittas))*
|
|
65
|
+
- :arrow_lower_right: *fixes issue [#9396](https://github.com/tobymao/sqlglot/issues/9396) opened by [@shaurya-nstarx](https://github.com/shaurya-nstarx)*
|
|
66
|
+
- [`5d6f7f0`](https://github.com/tobymao/sqlglot/commit/5d6f7f0bd21a47b372c3b83948aa563fc0dfcbd7) - **bigquery**: infer GEOGRAPHY for ST_GEOGFROMGEOJSON *(PR [#9390](https://github.com/tobymao/sqlglot/pull/9390) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
67
|
+
- [`1bd4f3c`](https://github.com/tobymao/sqlglot/commit/1bd4f3c5c05ac3a6c68c7fad995544b8a8066b5a) - **optimizer**: annotate CURRENT_TIMESTAMP as TIMESTAMPTZ for Presto/Trino *(PR [#9412](https://github.com/tobymao/sqlglot/pull/9412) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
68
|
+
- [`2c7c416`](https://github.com/tobymao/sqlglot/commit/2c7c416314cbb366acc30af253f48dff1474f53a) - **postgres**: preserve LIKE function argument order [CODEX] *(PR [#9416](https://github.com/tobymao/sqlglot/pull/9416) by [@georgesittas](https://github.com/georgesittas))*
|
|
69
|
+
- :arrow_lower_right: *fixes issue [#9406](https://github.com/tobymao/sqlglot/issues/9406) opened by [@laravioli](https://github.com/laravioli)*
|
|
70
|
+
- [`ed5b9f9`](https://github.com/tobymao/sqlglot/commit/ed5b9f9b42c7ee7005da86dc8e34cff1387f23d5) - **postgres**: preserve the <=> extension operator *(PR [#9417](https://github.com/tobymao/sqlglot/pull/9417) by [@georgesittas](https://github.com/georgesittas))*
|
|
71
|
+
- :arrow_lower_right: *fixes issue [#9408](https://github.com/tobymao/sqlglot/issues/9408) opened by [@laravioli](https://github.com/laravioli)*
|
|
72
|
+
- [`e9c80d4`](https://github.com/tobymao/sqlglot/commit/e9c80d46f17ec7d1c08085296a7d300831fa9b70) - **parser**: parse MATCH_RECOGNIZE as a postfix of its relation *(PR [#9402](https://github.com/tobymao/sqlglot/pull/9402) by [@geooo109](https://github.com/geooo109))*
|
|
73
|
+
- [`a4c3e5e`](https://github.com/tobymao/sqlglot/commit/a4c3e5e5b90e994b3a3fb7e1eb73a88940de3f9a) - **sqlite**: compare dates with interval arithmetic results as datetimes *(PR [#9419](https://github.com/tobymao/sqlglot/pull/9419) by [@georgesittas](https://github.com/georgesittas))*
|
|
74
|
+
- :arrow_lower_right: *fixes issue [#9391](https://github.com/tobymao/sqlglot/issues/9391) opened by [@joeharris76](https://github.com/joeharris76)*
|
|
75
|
+
- [`cce8bd3`](https://github.com/tobymao/sqlglot/commit/cce8bd3bf7a884428b0df9402f57427bb3b09e71) - **hive**: infer integer literal types by value in Hive and Spark [CODEX] *(PR [#9398](https://github.com/tobymao/sqlglot/pull/9398) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
76
|
+
- [`ab8753a`](https://github.com/tobymao/sqlglot/commit/ab8753a25bcbf03db96f97509959c58a3f19b7d1) - **dremio**: infer integer literal types for Dremio *(PR [#9424](https://github.com/tobymao/sqlglot/pull/9424) by [@fivetran-kwoodbeck](https://github.com/fivetran-kwoodbeck))*
|
|
77
|
+
- [`e356698`](https://github.com/tobymao/sqlglot/commit/e356698c9e1e485d9623589ae438f316f672700b) - **spark**: parse OUTER/INNER/CROSS as identifiers and expressions in PIVOT aggregations *(PR [#9442](https://github.com/tobymao/sqlglot/pull/9442) by [@georgesittas](https://github.com/georgesittas))*
|
|
78
|
+
|
|
79
|
+
### :white_check_mark: Tests
|
|
80
|
+
- [`99e5419`](https://github.com/tobymao/sqlglot/commit/99e541939f9fd901a16ba201009f97c041740f75) - **postgres**: sync EVERY round-trip fixtures *(PR [#9383](https://github.com/tobymao/sqlglot/pull/9383) by [@georgesittas](https://github.com/georgesittas))*
|
|
81
|
+
|
|
82
|
+
### :wrench: Chores
|
|
83
|
+
- [`5794340`](https://github.com/tobymao/sqlglot/commit/5794340b6e4806fdac6316ee1c6d27ed065bb69c) - bump integration tests to the merged Redshift fixtures *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
84
|
+
- [`adb6997`](https://github.com/tobymao/sqlglot/commit/adb699743ae1645a040f5df815c0ed7d5f0c7347) - sync integration tests after Databricks fixture refresh *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
85
|
+
- [`4456240`](https://github.com/tobymao/sqlglot/commit/445624097edf0f63c222997a05e1d1cd903f6e74) - sync integration tests after BigQuery JSON type fix *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
86
|
+
- [`ec95a02`](https://github.com/tobymao/sqlglot/commit/ec95a02def0f1b61e953b93d23521b18596f1fbe) - sync integration tests *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
87
|
+
- [`73a4eab`](https://github.com/tobymao/sqlglot/commit/73a4eab6d25c5807f4049755726a4f6db5258232) - sync integration tests after SQLite literal typing *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
88
|
+
- [`4580280`](https://github.com/tobymao/sqlglot/commit/45802806e059a0e03577a7c4787364cffd022c71) - sync integration tests after BigQuery geography typing *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
89
|
+
- [`4e11e31`](https://github.com/tobymao/sqlglot/commit/4e11e316d1215d06d1a9a2a5a66586bccdfc5a95) - sync integration tests after BigQuery fixture update *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
90
|
+
|
|
91
|
+
|
|
4
92
|
## [v30.35.0] - 2026-11-24
|
|
5
93
|
### :sparkles: New Features
|
|
6
94
|
- [`aea3182`](https://github.com/tobymao/sqlglot/commit/aea31829266585a4cf3881801af958f3f84cf71d) - **trino**: support EXECUTE IMMEDIATE *(PR [#9345](https://github.com/tobymao/sqlglot/pull/9345) by [@georgesittas](https://github.com/georgesittas))*
|
|
@@ -17065,3 +17153,4 @@ pip install "sqlglot[c]" # compiled — faster, but no subclassing
|
|
|
17065
17153
|
[v30.33.0]: https://github.com/tobymao/sqlglot/compare/v30.32.0...v30.33.0
|
|
17066
17154
|
[v30.34.0]: https://github.com/tobymao/sqlglot/compare/v30.33.0...v30.34.0
|
|
17067
17155
|
[v30.35.0]: https://github.com/tobymao/sqlglot/compare/v30.34.0...v30.35.0
|
|
17156
|
+
[v30.36.0]: https://github.com/tobymao/sqlglot/compare/v30.35.0...v30.36.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.37.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,10 +34,10 @@ Requires-Dist: types-pytz; extra == "dev"
|
|
|
34
34
|
Requires-Dist: typing_extensions; extra == "dev"
|
|
35
35
|
Requires-Dist: pyperf; extra == "dev"
|
|
36
36
|
Provides-Extra: c
|
|
37
|
-
Requires-Dist: sqlglotc==30.
|
|
37
|
+
Requires-Dist: sqlglotc==30.37.0; python_version >= "3.10" and extra == "c"
|
|
38
38
|
Provides-Extra: rs
|
|
39
39
|
Requires-Dist: sqlglotrs==0.13.0; extra == "rs"
|
|
40
|
-
Requires-Dist: sqlglotc==30.
|
|
40
|
+
Requires-Dist: sqlglotc==30.37.0; python_version >= "3.10" and extra == "rs"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
Dynamic: provides-extra
|
|
43
43
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '30.
|
|
22
|
-
__version_tuple__ = version_tuple = (30,
|
|
21
|
+
__version__ = version = '30.37.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (30, 37, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'ga7124cf8e'
|
|
@@ -1856,7 +1856,8 @@ def var_map_sql(
|
|
|
1856
1856
|
values = expression.args.get("values")
|
|
1857
1857
|
|
|
1858
1858
|
if not isinstance(keys, exp.Array) or not isinstance(values, exp.Array):
|
|
1859
|
-
|
|
1859
|
+
if keys is not None or values is not None:
|
|
1860
|
+
self.unsupported("Cannot convert array columns into map.")
|
|
1860
1861
|
return self.func(map_func_name, keys, values)
|
|
1861
1862
|
|
|
1862
1863
|
args = []
|
|
@@ -24,9 +24,14 @@ class Doris(MySQL):
|
|
|
24
24
|
|
|
25
25
|
KEYWORDS = {
|
|
26
26
|
**MySQL.Tokenizer.KEYWORDS,
|
|
27
|
+
"DATETIMEV2": TokenType.DATETIME,
|
|
28
|
+
"DATEV2": TokenType.DATE,
|
|
29
|
+
"DECIMALV2": TokenType.DECIMAL,
|
|
30
|
+
"DECIMALV3": TokenType.DECIMAL,
|
|
27
31
|
"IPV4": TokenType.IPV4,
|
|
28
32
|
"IPV6": TokenType.IPV6,
|
|
29
33
|
"LARGEINT": TokenType.INT128,
|
|
34
|
+
"TIMESTAMP": TokenType.DATETIME,
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
Parser = DorisParser
|
|
@@ -50,6 +50,7 @@ class Presto(Dialect):
|
|
|
50
50
|
JODA_TIME_MAPPING = {
|
|
51
51
|
"yyyy": "%Y",
|
|
52
52
|
"yy": "%y",
|
|
53
|
+
"y": "%-Y",
|
|
53
54
|
"MMMM": "%B",
|
|
54
55
|
"MMM": "%b",
|
|
55
56
|
"MM": "%m",
|
|
@@ -96,6 +97,8 @@ class Presto(Dialect):
|
|
|
96
97
|
|
|
97
98
|
NESTED_COMMENTS = False
|
|
98
99
|
|
|
100
|
+
COMMANDS = tokens.Tokenizer.COMMANDS - {TokenType.SHOW}
|
|
101
|
+
|
|
99
102
|
KEYWORDS = {
|
|
100
103
|
**tokens.Tokenizer.KEYWORDS,
|
|
101
104
|
"DEALLOCATE PREPARE": TokenType.COMMAND,
|
|
@@ -1783,7 +1783,7 @@ class Generator:
|
|
|
1783
1783
|
left_quote, right_quote = self.dialect.QUOTE_START, self.dialect.QUOTE_END
|
|
1784
1784
|
|
|
1785
1785
|
if escape:
|
|
1786
|
-
escape_pattern = re.compile(rf"{escape.name}(\d+)")
|
|
1786
|
+
escape_pattern = re.compile(rf"{re.escape(escape.name)}(\d+)")
|
|
1787
1787
|
escape_sql = f" UESCAPE {self.sql(escape)}" if self.SUPPORTS_UESCAPE else ""
|
|
1788
1788
|
else:
|
|
1789
1789
|
escape_pattern = ESCAPED_UNICODE_RE
|
|
@@ -2,13 +2,16 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing as t
|
|
4
4
|
|
|
5
|
-
from sqlglot import exp
|
|
5
|
+
from sqlglot import exp, transforms
|
|
6
6
|
from sqlglot.dialects.dialect import (
|
|
7
7
|
approx_count_distinct_sql,
|
|
8
|
+
map_date_part,
|
|
8
9
|
no_filter_sql,
|
|
9
10
|
property_sql,
|
|
10
11
|
rename_func,
|
|
11
12
|
time_format,
|
|
13
|
+
var_map_sql,
|
|
14
|
+
week_unit_to_dow,
|
|
12
15
|
weekstart_unit_to_str,
|
|
13
16
|
)
|
|
14
17
|
from sqlglot.generators.mysql import MySQLGenerator
|
|
@@ -31,6 +34,7 @@ class DorisGenerator(MySQLGenerator):
|
|
|
31
34
|
analyzer = self.sql(expression, "analyzer")
|
|
32
35
|
return f"{sql} USING ANALYZER {analyzer}" if analyzer else sql
|
|
33
36
|
|
|
37
|
+
ARRAY_SIZE_NAME = "ARRAY_SIZE"
|
|
34
38
|
LAST_DAY_SUPPORTS_DATE_PART = False
|
|
35
39
|
NULL_ORDERING_SUPPORTED: bool | None = True
|
|
36
40
|
SUPPORTS_ALTER_COLUMN_NULLABILITY = False
|
|
@@ -59,12 +63,18 @@ class DorisGenerator(MySQLGenerator):
|
|
|
59
63
|
TIMESTAMP_FUNC_TYPES: t.ClassVar[set[exp.DType]] = set()
|
|
60
64
|
|
|
61
65
|
TRANSFORMS = {
|
|
62
|
-
**{
|
|
66
|
+
**{
|
|
67
|
+
k: v
|
|
68
|
+
for k, v in MySQLGenerator.TRANSFORMS.items()
|
|
69
|
+
if k not in (exp.ArrayAgg, exp.DateDiff, exp.JSONExtractScalar, exp.TryCast)
|
|
70
|
+
},
|
|
63
71
|
exp.AddMonths: rename_func("MONTHS_ADD"),
|
|
64
72
|
exp.ApproxDistinct: approx_count_distinct_sql,
|
|
65
73
|
exp.ArgMax: rename_func("MAX_BY"),
|
|
66
74
|
exp.ArgMin: rename_func("MIN_BY"),
|
|
67
75
|
exp.ArrayFilter: lambda self, e: self.func("ARRAY_FILTER", e.expression, e.this),
|
|
76
|
+
exp.ArrayFirst: lambda self, e: self.func("ARRAY_FIRST", e.expression, e.this),
|
|
77
|
+
exp.ArrayLast: lambda self, e: self.func("ARRAY_LAST", e.expression, e.this),
|
|
68
78
|
exp.ArrayToString: rename_func("ARRAY_JOIN"),
|
|
69
79
|
exp.ArrayUniqueAgg: rename_func("COLLECT_SET"),
|
|
70
80
|
exp.CurrentDate: lambda self, _: self.func("CURRENT_DATE"),
|
|
@@ -76,14 +86,20 @@ class DorisGenerator(MySQLGenerator):
|
|
|
76
86
|
exp.GroupConcat: lambda self, e: self.func(
|
|
77
87
|
"GROUP_CONCAT", e.this, e.args.get("separator") or exp.Literal.string(",")
|
|
78
88
|
),
|
|
79
|
-
exp.JSONExtractScalar: lambda self, e: self.func("JSON_EXTRACT", e.this, e.expression),
|
|
80
89
|
exp.Lag: _lag_lead_sql,
|
|
81
90
|
exp.Lead: _lag_lead_sql,
|
|
82
|
-
exp.Map:
|
|
91
|
+
exp.Map: var_map_sql,
|
|
83
92
|
exp.Property: property_sql,
|
|
93
|
+
exp.Quantile: rename_func("PERCENTILE"),
|
|
84
94
|
exp.RegexpLike: rename_func("REGEXP"),
|
|
85
95
|
exp.RegexpSplit: rename_func("SPLIT_BY_STRING"),
|
|
86
96
|
exp.SchemaCommentProperty: lambda self, e: self.naked_property(e),
|
|
97
|
+
exp.Select: transforms.preprocess(
|
|
98
|
+
[
|
|
99
|
+
transforms.eliminate_distinct_on,
|
|
100
|
+
transforms.unnest_generate_date_array_using_recursive_cte,
|
|
101
|
+
]
|
|
102
|
+
),
|
|
87
103
|
exp.Split: rename_func("SPLIT_BY_STRING"),
|
|
88
104
|
exp.StringToArray: rename_func("SPLIT_BY_STRING"),
|
|
89
105
|
exp.StrToUnix: lambda self, e: self.func("UNIX_TIMESTAMP", e.this, self.format_time(e)),
|
|
@@ -98,6 +114,7 @@ class DorisGenerator(MySQLGenerator):
|
|
|
98
114
|
"FROM_UNIXTIME", e.this, time_format("doris")(self, e)
|
|
99
115
|
),
|
|
100
116
|
exp.UnixToTime: rename_func("FROM_UNIXTIME"),
|
|
117
|
+
exp.VarMap: var_map_sql,
|
|
101
118
|
}
|
|
102
119
|
|
|
103
120
|
# https://github.com/apache/doris/blob/e4f41dbf1ec03f5937fdeba2ee1454a20254015b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4#L93
|
|
@@ -589,6 +606,11 @@ class DorisGenerator(MySQLGenerator):
|
|
|
589
606
|
"year",
|
|
590
607
|
}
|
|
591
608
|
|
|
609
|
+
def join_sql(self, expression: exp.Join, join_op: str | None = None) -> str:
|
|
610
|
+
if expression.is_semi_or_anti_join and not expression.side:
|
|
611
|
+
expression.set("side", "LEFT")
|
|
612
|
+
return super().join_sql(expression, join_op=join_op)
|
|
613
|
+
|
|
592
614
|
def filter_sql(self, expression: exp.Filter) -> str:
|
|
593
615
|
agg = expression.this
|
|
594
616
|
arg = agg.this
|
|
@@ -608,11 +630,53 @@ class DorisGenerator(MySQLGenerator):
|
|
|
608
630
|
self.unsupported("Cannot rewrite this aggregate FILTER for Doris")
|
|
609
631
|
return super().filter_sql(expression)
|
|
610
632
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
633
|
+
return no_filter_sql(self, expression.copy())
|
|
634
|
+
|
|
635
|
+
def countif_sql(self, expression: exp.CountIf) -> str:
|
|
636
|
+
cond = expression.this
|
|
637
|
+
distinct = isinstance(cond, exp.Distinct)
|
|
638
|
+
arg = exp.If(this=cond.expressions[0] if distinct else cond, true=exp.Literal.number(1))
|
|
639
|
+
return self.func("COUNT", exp.Distinct(expressions=[arg]) if distinct else arg)
|
|
640
|
+
|
|
641
|
+
def jsonextractscalar_sql(self, expression: exp.JSONExtractScalar) -> str:
|
|
642
|
+
value = self.func("GET_JSON_STRING", expression.this, expression.expression)
|
|
643
|
+
if expression.args.get("scalar_only"):
|
|
644
|
+
kind = exp.JSONType(this=expression.this, expression=expression.expression)
|
|
645
|
+
return self.func("IF", kind.isin("array", "object"), exp.null(), value)
|
|
646
|
+
return value
|
|
647
|
+
|
|
648
|
+
def datediff_sql(self, expression: exp.DateDiff) -> str:
|
|
649
|
+
unit = map_date_part(expression.unit)
|
|
650
|
+
boundary = expression.args.get("date_part_boundary")
|
|
651
|
+
if not unit or (boundary and unit.name == "DAY"):
|
|
652
|
+
return MySQLGenerator.TRANSFORMS[exp.DateDiff](self, expression)
|
|
653
|
+
|
|
654
|
+
start, end = expression.expression, expression.this
|
|
655
|
+
if dow := week_unit_to_dow(unit):
|
|
656
|
+
unit = exp.var("WEEK")
|
|
657
|
+
if boundary and dow != 1:
|
|
658
|
+
# Align the requested week start with the Monday used by DATE_TRUNC.
|
|
659
|
+
shift = exp.Interval(this=exp.Literal.number(8 - dow), unit=exp.var("DAY"))
|
|
660
|
+
start, end = start + shift, end + shift
|
|
661
|
+
|
|
662
|
+
if unit.name == "MILLISECOND":
|
|
663
|
+
if boundary:
|
|
664
|
+
# Doris DATE_TRUNC stops at seconds. Count milliseconds from the earliest date.
|
|
665
|
+
origin = exp.Literal.string("0000-01-01")
|
|
666
|
+
end_ms = exp.func("MILLISECONDS_DIFF", end, origin)
|
|
667
|
+
start_ms = exp.func("MILLISECONDS_DIFF", start, origin)
|
|
668
|
+
return self.sql(exp.paren(end_ms - start_ms))
|
|
669
|
+
return self.func("MILLISECONDS_DIFF", end, start)
|
|
670
|
+
|
|
671
|
+
if unit.name in ("YEAR", "QUARTER", "MONTH", "WEEK", "DAY", "HOUR", "MINUTE", "SECOND"):
|
|
672
|
+
if boundary:
|
|
673
|
+
# TIMESTAMPDIFF counts complete units. Truncating both operands counts boundaries.
|
|
674
|
+
start = exp.TimestampTrunc(this=start, unit=unit.copy())
|
|
675
|
+
end = exp.TimestampTrunc(this=end, unit=unit.copy())
|
|
676
|
+
elif unit.name != "MICROSECOND":
|
|
677
|
+
self.unsupported(f"Unsupported Doris date difference unit: {unit.name}")
|
|
678
|
+
|
|
679
|
+
return self.func("TIMESTAMPDIFF", unit, start, end)
|
|
616
680
|
|
|
617
681
|
def array_sql(self, expression: exp.Array) -> str:
|
|
618
682
|
args = expression.expressions
|
|
@@ -621,6 +685,31 @@ class DorisGenerator(MySQLGenerator):
|
|
|
621
685
|
self.unsupported("Doris does not support ARRAY constructors from a query")
|
|
622
686
|
return self.func("ARRAY", *args)
|
|
623
687
|
|
|
688
|
+
def columndef_sql(self, expression: exp.ColumnDef, sep: str = " ") -> str:
|
|
689
|
+
parent = expression.parent
|
|
690
|
+
if isinstance(parent, exp.DataType) and parent.is_type(exp.DType.STRUCT):
|
|
691
|
+
sep = ": "
|
|
692
|
+
return super().columndef_sql(expression, sep)
|
|
693
|
+
|
|
694
|
+
def struct_sql(self, expression: exp.Struct) -> str:
|
|
695
|
+
fields = expression.expressions
|
|
696
|
+
if not any(isinstance(field, exp.PropertyEQ) for field in fields):
|
|
697
|
+
return self.func("STRUCT", *fields)
|
|
698
|
+
|
|
699
|
+
args: list[exp.Expr] = []
|
|
700
|
+
for i, field in enumerate(fields, 1):
|
|
701
|
+
if isinstance(field, exp.PropertyEQ):
|
|
702
|
+
key = field.this
|
|
703
|
+
if isinstance(key, exp.Identifier):
|
|
704
|
+
key = exp.Literal.string(key.name)
|
|
705
|
+
elif not key.is_string:
|
|
706
|
+
self.unsupported("Doris requires literal field names in NAMED_STRUCT")
|
|
707
|
+
args.extend((key, field.expression))
|
|
708
|
+
else:
|
|
709
|
+
args.extend((exp.Literal.string(f"col{i}"), field))
|
|
710
|
+
|
|
711
|
+
return self.func("NAMED_STRUCT", *args)
|
|
712
|
+
|
|
624
713
|
def arrayagg_sql(self, expression: exp.ArrayAgg) -> str:
|
|
625
714
|
name = "COLLECT_LIST" if expression.args.get("nulls_excluded") else "ARRAY_AGG"
|
|
626
715
|
sql = self.func(name, expression.this)
|
|
@@ -696,3 +785,9 @@ class DorisGenerator(MySQLGenerator):
|
|
|
696
785
|
if not isinstance(ancestor, exp.Select):
|
|
697
786
|
sep = " "
|
|
698
787
|
return super().table_sql(expression, sep=sep)
|
|
788
|
+
|
|
789
|
+
def tsordstodatetime_sql(self, expression: exp.TsOrDsToDatetime) -> str:
|
|
790
|
+
if expression.this.is_string:
|
|
791
|
+
# A TIMESTAMP literal infers fractional precision. A bare DATETIME cast uses zero.
|
|
792
|
+
return f"TIMESTAMP {self.sql(expression, 'this')}"
|
|
793
|
+
return super().tsordstodatetime_sql(expression)
|
|
@@ -295,6 +295,22 @@ def _to_boolean_sql(self: DuckDBGenerator, expression: exp.ToBoolean) -> str:
|
|
|
295
295
|
return self.sql(case_expr)
|
|
296
296
|
|
|
297
297
|
|
|
298
|
+
def _normalize_timezone_offset(zone: exp.Expr) -> exp.Expr:
|
|
299
|
+
# DuckDB needs the GMT prefix to preserve minutes in offsets like UTC+05:30.
|
|
300
|
+
offset_prefix = r"^(?:UTC)?([+-])"
|
|
301
|
+
replacement = r"GMT\1"
|
|
302
|
+
if zone.is_string:
|
|
303
|
+
name = re.sub(offset_prefix, replacement, zone.name)
|
|
304
|
+
return exp.Literal.string(name) if name != zone.name else zone
|
|
305
|
+
|
|
306
|
+
return exp.RegexpReplace(
|
|
307
|
+
this=zone,
|
|
308
|
+
expression=exp.Literal.string(offset_prefix),
|
|
309
|
+
replacement=exp.Literal.string(replacement),
|
|
310
|
+
single_replace=True,
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
|
|
298
314
|
# BigQuery -> DuckDB conversion for the DATE function
|
|
299
315
|
def _date_sql(self: DuckDBGenerator, expression: exp.Date) -> str:
|
|
300
316
|
this = expression.this
|
|
@@ -1820,7 +1836,6 @@ class DuckDBGenerator(generator.Generator):
|
|
|
1820
1836
|
exp.TimeSub: _date_delta_to_binary_interval_op(),
|
|
1821
1837
|
exp.Time: no_time_sql,
|
|
1822
1838
|
exp.TimeDiff: _timediff_sql,
|
|
1823
|
-
exp.Timestamp: no_timestamp_sql,
|
|
1824
1839
|
exp.TimestampAdd: _date_delta_to_binary_interval_op(),
|
|
1825
1840
|
exp.TimestampSub: _date_delta_to_binary_interval_op(),
|
|
1826
1841
|
exp.TimeStrToDate: lambda self, e: self.sql(exp.cast(e.this, exp.DType.DATE)),
|
|
@@ -2979,6 +2994,12 @@ class DuckDBGenerator(generator.Generator):
|
|
|
2979
2994
|
)
|
|
2980
2995
|
return self.sql(expr)
|
|
2981
2996
|
|
|
2997
|
+
def currentdatetime_sql(self, expression: exp.CurrentDatetime) -> str:
|
|
2998
|
+
zone = expression.this or exp.Literal.string("UTC")
|
|
2999
|
+
return self.sql(
|
|
3000
|
+
exp.AtTimeZone(this=exp.CurrentTimestamp(), zone=_normalize_timezone_offset(zone))
|
|
3001
|
+
)
|
|
3002
|
+
|
|
2982
3003
|
def checkjson_sql(self, expression: exp.CheckJson) -> str:
|
|
2983
3004
|
arg = expression.this
|
|
2984
3005
|
return self.sql(
|
|
@@ -3212,6 +3233,17 @@ class DuckDBGenerator(generator.Generator):
|
|
|
3212
3233
|
|
|
3213
3234
|
return super().extract_sql(expression)
|
|
3214
3235
|
|
|
3236
|
+
def timestamp_sql(self, expression: exp.Timestamp) -> str:
|
|
3237
|
+
zone = expression.args.get("zone")
|
|
3238
|
+
if expression.args.get("with_tz") and zone:
|
|
3239
|
+
return self.sql(
|
|
3240
|
+
exp.AtTimeZone(
|
|
3241
|
+
this=exp.cast(expression.this, exp.DType.TIMESTAMP),
|
|
3242
|
+
zone=_normalize_timezone_offset(zone),
|
|
3243
|
+
)
|
|
3244
|
+
)
|
|
3245
|
+
return no_timestamp_sql(self, expression)
|
|
3246
|
+
|
|
3215
3247
|
def timestampfromparts_sql(self, expression: exp.TimestampFromParts) -> str:
|
|
3216
3248
|
# Check if this is the date/time expression form: TIMESTAMP_FROM_PARTS(date_expr, time_expr)
|
|
3217
3249
|
date_expr = expression.this
|
|
@@ -5038,8 +5070,8 @@ class DuckDBGenerator(generator.Generator):
|
|
|
5038
5070
|
def approxquantile_sql(self, expression: exp.ApproxQuantile) -> str:
|
|
5039
5071
|
result = self.func("APPROX_QUANTILE", expression.this, expression.args.get("quantile"))
|
|
5040
5072
|
|
|
5041
|
-
# DuckDB returns
|
|
5042
|
-
if expression.is_type(*exp.DataType.
|
|
5073
|
+
# DuckDB returns the input's type, e.g. an integer or DECIMAL, so cast when a float is expected
|
|
5074
|
+
if expression.is_type(*exp.DataType.FLOAT_TYPES):
|
|
5043
5075
|
result = f"CAST({result} AS DOUBLE)"
|
|
5044
5076
|
|
|
5045
5077
|
return result
|
|
@@ -721,7 +721,7 @@ class MySQLGenerator(generator.Generator):
|
|
|
721
721
|
|
|
722
722
|
if to:
|
|
723
723
|
expression.to.set("this", to)
|
|
724
|
-
return super().cast_sql(expression)
|
|
724
|
+
return super().cast_sql(expression, safe_prefix=safe_prefix)
|
|
725
725
|
|
|
726
726
|
def show_sql(self, expression: exp.Show) -> str:
|
|
727
727
|
this = f" {expression.name}"
|
|
@@ -39,6 +39,7 @@ from sqlglot.dialects.dialect import (
|
|
|
39
39
|
timestrtotime_sql,
|
|
40
40
|
trim_sql,
|
|
41
41
|
ts_or_ds_add_cast,
|
|
42
|
+
week_unit_to_dow,
|
|
42
43
|
)
|
|
43
44
|
from sqlglot.generator import unsupported_args
|
|
44
45
|
from sqlglot.helper import ensure_list, seq_get, to_int
|
|
@@ -61,6 +62,7 @@ DATE_DIFF_BOUNDARY_UNITS = {
|
|
|
61
62
|
"SECOND",
|
|
62
63
|
"MINUTE",
|
|
63
64
|
"HOUR",
|
|
65
|
+
"WEEK",
|
|
64
66
|
"MONTH",
|
|
65
67
|
"QUARTER",
|
|
66
68
|
"YEAR",
|
|
@@ -105,26 +107,32 @@ def _day_month_year_sql(self: PostgresGenerator, expression: exp.Day | exp.Month
|
|
|
105
107
|
|
|
106
108
|
|
|
107
109
|
def _date_diff_sql(self: PostgresGenerator, expression: exp.DateDiff | exp.TsOrDsDiff) -> str:
|
|
108
|
-
|
|
110
|
+
week_start = week_unit_to_dow(expression.unit)
|
|
111
|
+
unit = "WEEK" if week_start else expression.text("unit").upper() or "DAY"
|
|
112
|
+
boundary = expression.args.get("date_part_boundary")
|
|
109
113
|
|
|
110
114
|
# Dialects like MySQL count crossed day boundaries, which maps to DATE subtraction
|
|
111
|
-
if unit == "DAY" and
|
|
115
|
+
if unit == "DAY" and boundary:
|
|
112
116
|
this = exp.cast(expression.this, exp.DType.DATE)
|
|
113
117
|
expr = exp.cast(expression.expression, exp.DType.DATE)
|
|
114
118
|
return self.sql(exp.paren(this - expr))
|
|
115
119
|
|
|
120
|
+
def timestamp_sql(operand: exp.Expr) -> str:
|
|
121
|
+
value: exp.Expr = exp.cast(operand, exp.DType.TIMESTAMP)
|
|
122
|
+
if boundary and unit in DATE_DIFF_BOUNDARY_UNITS:
|
|
123
|
+
if week_start and week_start != 1:
|
|
124
|
+
# Shift the requested week start onto Monday before truncating both operands.
|
|
125
|
+
shift = (1 - week_start) % 7
|
|
126
|
+
value = value + exp.Interval(
|
|
127
|
+
this=exp.Literal.string(str(shift)), unit=exp.var("DAY")
|
|
128
|
+
)
|
|
129
|
+
value = exp.DateTrunc(this=value, unit=exp.Literal.string(unit))
|
|
130
|
+
return self.sql(value)
|
|
131
|
+
|
|
132
|
+
end = timestamp_sql(expression.this)
|
|
133
|
+
start = timestamp_sql(expression.expression)
|
|
116
134
|
factor = DATE_DIFF_FACTOR.get(unit)
|
|
117
135
|
|
|
118
|
-
end = f"CAST({self.sql(expression, 'this')} AS TIMESTAMP)"
|
|
119
|
-
start = f"CAST({self.sql(expression, 'expression')} AS TIMESTAMP)"
|
|
120
|
-
|
|
121
|
-
# The arithmetic below counts complete units between the operands, whereas dialects that set
|
|
122
|
-
# date_part_boundary count unit boundary crossings, so the operands are truncated down to the
|
|
123
|
-
# unit to make the two coincide. WEEK is left out: its start day differs across dialects
|
|
124
|
-
if expression.args.get("date_part_boundary") and unit in DATE_DIFF_BOUNDARY_UNITS:
|
|
125
|
-
end = self.func("DATE_TRUNC", exp.Literal.string(unit), end)
|
|
126
|
-
start = self.func("DATE_TRUNC", exp.Literal.string(unit), start)
|
|
127
|
-
|
|
128
136
|
if factor is not None:
|
|
129
137
|
return f"CAST(EXTRACT(epoch FROM {end} - {start}){factor} AS BIGINT)"
|
|
130
138
|
|
|
@@ -697,6 +697,15 @@ class PrestoGenerator(generator.Generator):
|
|
|
697
697
|
return f"({this.name} * INTERVAL '7' DAY)"
|
|
698
698
|
return super().interval_sql(expression)
|
|
699
699
|
|
|
700
|
+
def show_sql(self, expression: exp.Show) -> str:
|
|
701
|
+
target = self.sql(expression, "target")
|
|
702
|
+
target = f" FOR {target}" if target else ""
|
|
703
|
+
from_ = self.sql(expression, "from_")
|
|
704
|
+
from_ = f" FROM {from_}" if from_ else ""
|
|
705
|
+
like = self.sql(expression, "like")
|
|
706
|
+
like = f" LIKE {like}" if like else ""
|
|
707
|
+
return f"SHOW {expression.name}{target}{from_}{like}"
|
|
708
|
+
|
|
700
709
|
def transaction_sql(self, expression: exp.Transaction) -> str:
|
|
701
710
|
modes = expression.args.get("modes")
|
|
702
711
|
modes = f" {', '.join(modes)}" if modes else ""
|
|
@@ -104,6 +104,15 @@ def _coerce_date(l: exp.Expr, unit: exp.Expr | None) -> exp.DataType | exp.DType
|
|
|
104
104
|
return l.type or exp.DType.UNKNOWN
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
def _is_div_literal_operand(expression: exp.Expr) -> bool:
|
|
108
|
+
# BigQuery only treats a single Neg directly over a Literal as literal-like;
|
|
109
|
+
# don't recurse further, e.g. `-(0.5)` and `- -0.5` are not
|
|
110
|
+
unnested = expression.unnest()
|
|
111
|
+
if isinstance(unnested, exp.Neg):
|
|
112
|
+
return isinstance(unnested.this, exp.Literal)
|
|
113
|
+
return isinstance(unnested, exp.Literal)
|
|
114
|
+
|
|
115
|
+
|
|
107
116
|
def swap_args(func: BinaryCoercionFunc) -> BinaryCoercionFunc:
|
|
108
117
|
@functools.wraps(func)
|
|
109
118
|
def _swapped(l: exp.Expr, r: exp.Expr) -> exp.DataType | exp.DType | None:
|
|
@@ -1022,6 +1031,13 @@ class TypeAnnotator:
|
|
|
1022
1031
|
if coerce_integer_operands
|
|
1023
1032
|
else exp.DType.BIGINT,
|
|
1024
1033
|
)
|
|
1034
|
+
elif (
|
|
1035
|
+
self.dialect.PRIORITIZE_NON_LITERAL_TYPES
|
|
1036
|
+
and left_type in exp.DataType.REAL_TYPES
|
|
1037
|
+
and right_type in exp.DataType.REAL_TYPES
|
|
1038
|
+
and _is_div_literal_operand(left) != _is_div_literal_operand(right)
|
|
1039
|
+
):
|
|
1040
|
+
self._set_type(expression, right_type if _is_div_literal_operand(left) else left_type)
|
|
1025
1041
|
else:
|
|
1026
1042
|
self._set_type(expression, self._maybe_coerce(left_type, right_type))
|
|
1027
1043
|
if expression.type and expression.type.this not in exp.DataType.REAL_TYPES:
|
|
@@ -1462,19 +1462,19 @@ def _expand_stars(
|
|
|
1462
1462
|
continue
|
|
1463
1463
|
|
|
1464
1464
|
for name in columns:
|
|
1465
|
-
if name in columns_to_exclude
|
|
1465
|
+
if name in columns_to_exclude:
|
|
1466
1466
|
continue
|
|
1467
1467
|
if ilike_pattern and not re.fullmatch(ilike_pattern, name, re.IGNORECASE):
|
|
1468
1468
|
continue
|
|
1469
1469
|
if (
|
|
1470
1470
|
is_unqualified_star
|
|
1471
|
-
and
|
|
1472
|
-
and table in
|
|
1471
|
+
and (using_tables := using_column_tables.get(name))
|
|
1472
|
+
and table in using_tables
|
|
1473
1473
|
):
|
|
1474
|
+
if name in coalesced_columns:
|
|
1475
|
+
continue
|
|
1474
1476
|
coalesced_columns.add(name)
|
|
1475
|
-
|
|
1476
|
-
using_tables = using_column_tables[name]
|
|
1477
|
-
coalesce_args = [exp.column(name, table=table) for table in using_tables]
|
|
1477
|
+
coalesce_args = [exp.column(name, table=t) for t in using_tables]
|
|
1478
1478
|
|
|
1479
1479
|
selection = alias(exp.func("coalesce", *coalesce_args), alias=name, copy=False)
|
|
1480
1480
|
else:
|
|
@@ -1129,7 +1129,9 @@ def walk_in_scope(
|
|
|
1129
1129
|
and (
|
|
1130
1130
|
isinstance(node, exp.CTE)
|
|
1131
1131
|
or (isinstance(node.parent, (exp.From, exp.Join)) and _is_derived_table(node))
|
|
1132
|
-
|
|
1132
|
+
# _traverse_udtfs handles direct subqueries of LATERAL and FROM/JOIN UNNEST.
|
|
1133
|
+
or isinstance(node.parent, exp.Lateral)
|
|
1134
|
+
or (isinstance(node.parent, exp.Unnest) and _is_from_or_join(node.parent))
|
|
1133
1135
|
or isinstance(node, exp.UNWRAPPED_QUERIES)
|
|
1134
1136
|
)
|
|
1135
1137
|
):
|