sqlglot 27.27.0__tar.gz → 27.28.1__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.
Potentially problematic release.
This version of sqlglot might be problematic. Click here for more details.
- {sqlglot-27.27.0 → sqlglot-27.28.1}/CHANGELOG.md +177 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/PKG-INFO +1 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/_version.py +3 -3
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/bigquery.py +111 -94
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/clickhouse.py +6 -3
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/duckdb.py +20 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/mysql.py +2 -2
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/snowflake.py +58 -2
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/spark.py +10 -2
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/starrocks.py +3 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/tsql.py +4 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/expressions.py +53 -6
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/generator.py +1 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/lineage.py +9 -3
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/qualify_columns.py +7 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/simplify.py +6 -5
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/parser.py +5 -3
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.egg-info/PKG-INFO +1 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_bigquery.py +17 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_clickhouse.py +4 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_dialect.py +9 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_duckdb.py +54 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_postgres.py +1 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_snowflake.py +57 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_spark.py +7 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_starrocks.py +10 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_tsql.py +6 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/identity.sql +5 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/annotate_functions.sql +224 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/simplify.sql +17 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/unnest_subqueries.sql +4 -1
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_lineage.py +66 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/.gitignore +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/.gitpod.yml +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/.pre-commit-config.yaml +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/CONTRIBUTING.md +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/LICENSE +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/MANIFEST.in +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/Makefile +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/README.md +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/pyproject.toml +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/setup.cfg +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/setup.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/__main__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/_typing.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/oracle.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/singlestore.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/solr.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/diff.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/errors.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/executor/context.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/executor/env.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/executor/python.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/executor/table.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/helper.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/jsonpath.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/planner.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/py.typed +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/schema.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/serde.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/time.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/tokens.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/transforms.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot/trie.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.egg-info/requires.txt +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglot.png +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/Cargo.lock +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/Cargo.toml +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/benches/dialect_settings.json +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/benches/long.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/benches/token_type_settings.json +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/benches/tokenizer_settings.json +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/pyproject.toml +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/src/lib.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/src/settings.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/src/token.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/src/tokenizer.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/sqlglotrs/src/trie.rs +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/__init__.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_athena.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_doris.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_drill.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_druid.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_dune.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_hive.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_mysql.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_oracle.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_presto.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_prql.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_singlestore.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_solr.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/dialects/test_trino.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/partial.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/gen_fixtures.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/helpers.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_build.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_dialect_imports.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_diff.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_docs.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_executor.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_expressions.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_generator.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_helper.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_jsonpath.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_optimizer.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_parser.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_schema.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_serde.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_time.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_tokens.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_transforms.py +0 -0
- {sqlglot-27.27.0 → sqlglot-27.28.1}/tests/test_transpile.py +0 -0
|
@@ -1,6 +1,181 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v27.28.0] - 2025-10-21
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`2238ac2`](https://github.com/tobymao/sqlglot/commit/2238ac27478bd272ba39928bbec1075c4191ee1b) - transpile timestamp literals in datediff fixes [#6083](https://github.com/tobymao/sqlglot/pull/6083) *(PR [#6086](https://github.com/tobymao/sqlglot/pull/6086) by [@georgesittas](https://github.com/georgesittas))*:
|
|
7
|
+
|
|
8
|
+
transpile timestamp literals in datediff fixes #6083 (#6086)
|
|
9
|
+
|
|
10
|
+
- due to [`c49ba0e`](https://github.com/tobymao/sqlglot/commit/c49ba0eee21f7776703d2a26c6641b4a32a1cff7) - Annotate type for snowflake WIDTH_BUCKET function *(PR [#6078](https://github.com/tobymao/sqlglot/pull/6078) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
11
|
+
|
|
12
|
+
Annotate type for snowflake WIDTH_BUCKET function (#6078)
|
|
13
|
+
|
|
14
|
+
- due to [`fbc1f13`](https://github.com/tobymao/sqlglot/commit/fbc1f1335eecaaaab4fc93ddbb74611a4df0aea7) - annotate type for Snowflake CONVERT_TIMEZONE function *(PR [#6076](https://github.com/tobymao/sqlglot/pull/6076) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
|
|
15
|
+
|
|
16
|
+
annotate type for Snowflake CONVERT_TIMEZONE function (#6076)
|
|
17
|
+
|
|
18
|
+
- due to [`70e977c`](https://github.com/tobymao/sqlglot/commit/70e977c5edfb495529d38a9096cb40762a9b5d7b) - annotate type for Snowflake DATE_TRUNC function *(PR [#6080](https://github.com/tobymao/sqlglot/pull/6080) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
|
|
19
|
+
|
|
20
|
+
annotate type for Snowflake DATE_TRUNC function (#6080)
|
|
21
|
+
|
|
22
|
+
- due to [`e9cf146`](https://github.com/tobymao/sqlglot/commit/e9cf146a4a6cd78f6a59c195e7ec12240b836e5e) - annotate type for Snowflake DATE_PART function *(PR [#6079](https://github.com/tobymao/sqlglot/pull/6079) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
|
|
23
|
+
|
|
24
|
+
annotate type for Snowflake DATE_PART function (#6079)
|
|
25
|
+
|
|
26
|
+
- due to [`5109890`](https://github.com/tobymao/sqlglot/commit/510989043d18baa17502a971262462814a2eb5be) - VALUES with ORDER BY/LIMIT/OFFSET *(PR [#6094](https://github.com/tobymao/sqlglot/pull/6094) by [@geooo109](https://github.com/geooo109))*:
|
|
27
|
+
|
|
28
|
+
VALUES with ORDER BY/LIMIT/OFFSET (#6094)
|
|
29
|
+
|
|
30
|
+
- due to [`6fe5824`](https://github.com/tobymao/sqlglot/commit/6fe58247888c326093618657fb027e482d82d107) - Annotate type for hour, minute, second functions *(PR [#6100](https://github.com/tobymao/sqlglot/pull/6100) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
31
|
+
|
|
32
|
+
Annotate type for hour, minute, second functions (#6100)
|
|
33
|
+
|
|
34
|
+
- due to [`a4d07a0`](https://github.com/tobymao/sqlglot/commit/a4d07a07eefbdaf88d30df2310a9533afdc75a82) - Annotate type for snowflake EXTRACT function *(PR [#6099](https://github.com/tobymao/sqlglot/pull/6099) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
35
|
+
|
|
36
|
+
Annotate type for snowflake EXTRACT function (#6099)
|
|
37
|
+
|
|
38
|
+
- due to [`483770b`](https://github.com/tobymao/sqlglot/commit/483770b816fab14b7eb7222974ed2c99045302a7) - Annotate type for snowflake TIME_SLICE function *(PR [#6098](https://github.com/tobymao/sqlglot/pull/6098) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
39
|
+
|
|
40
|
+
Annotate type for snowflake TIME_SLICE function (#6098)
|
|
41
|
+
|
|
42
|
+
- due to [`06f40f9`](https://github.com/tobymao/sqlglot/commit/06f40f900ce693ba4203514e422cba8cda0dbb07) - don't simplify x XOR x due to NULL semantics *(PR [#6115](https://github.com/tobymao/sqlglot/pull/6115) by [@geooo109](https://github.com/geooo109))*:
|
|
43
|
+
|
|
44
|
+
don't simplify x XOR x due to NULL semantics (#6115)
|
|
45
|
+
|
|
46
|
+
- due to [`c286cee`](https://github.com/tobymao/sqlglot/commit/c286cee54ab93e1fd0b3be658f7e767e3e00afe9) - Annotate type for snowflake MONTHNAME function *(PR [#6116](https://github.com/tobymao/sqlglot/pull/6116) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
47
|
+
|
|
48
|
+
Annotate type for snowflake MONTHNAME function (#6116)
|
|
49
|
+
|
|
50
|
+
- due to [`1a34788`](https://github.com/tobymao/sqlglot/commit/1a34788025bdd8a018c4bb9214f72152e68bdd14) - Annotate type for snowflake PREVIOUS_DAY function *(PR [#6117](https://github.com/tobymao/sqlglot/pull/6117) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
51
|
+
|
|
52
|
+
Annotate type for snowflake PREVIOUS_DAY function (#6117)
|
|
53
|
+
|
|
54
|
+
- due to [`533faf8`](https://github.com/tobymao/sqlglot/commit/533faf87b6df351070b565dd1fe9ce4e13b6c46e) - transpile duckdb `READ_PARQUET` to `parquet.<path>` closes [#6122](https://github.com/tobymao/sqlglot/pull/6122) *(commit by [@georgesittas](https://github.com/georgesittas))*:
|
|
55
|
+
|
|
56
|
+
transpile duckdb `READ_PARQUET` to `parquet.<path>` closes #6122
|
|
57
|
+
|
|
58
|
+
- due to [`cd4e557`](https://github.com/tobymao/sqlglot/commit/cd4e557658b1384f36c9a1ef9da5a09b893229b1) - Annotate type for snowflake RANDOM function *(PR [#6124](https://github.com/tobymao/sqlglot/pull/6124) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*:
|
|
59
|
+
|
|
60
|
+
Annotate type for snowflake RANDOM function (#6124)
|
|
61
|
+
|
|
62
|
+
- due to [`fe63d84`](https://github.com/tobymao/sqlglot/commit/fe63d84f1bd365b22221f348d79c0546aa3118b0) - annotate type for Snowflake MONTHS_BETWEEN function *(PR [#6120](https://github.com/tobymao/sqlglot/pull/6120) by [@fivetran-MichaelLee](https://github.com/fivetran-MichaelLee))*:
|
|
63
|
+
|
|
64
|
+
annotate type for Snowflake MONTHS_BETWEEN function (#6120)
|
|
65
|
+
|
|
66
|
+
- due to [`598d09b`](https://github.com/tobymao/sqlglot/commit/598d09b036d938c90a44955d67175ea868090ba2) - annotate type for Snowflake DATEADD function *(PR [#6089](https://github.com/tobymao/sqlglot/pull/6089) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*:
|
|
67
|
+
|
|
68
|
+
annotate type for Snowflake DATEADD function (#6089)
|
|
69
|
+
|
|
70
|
+
- due to [`b98bcee`](https://github.com/tobymao/sqlglot/commit/b98bcee148ba426816e166dbfa9ba8e0979aae21) - Annotate type for snowflake next_day function *(PR [#6125](https://github.com/tobymao/sqlglot/pull/6125) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*:
|
|
71
|
+
|
|
72
|
+
Annotate type for snowflake next_day function (#6125)
|
|
73
|
+
|
|
74
|
+
- due to [`e2129c6`](https://github.com/tobymao/sqlglot/commit/e2129c6766ca1f10ff6663bec98be984abb33c91) - Do not consider BIT_COUNT an aggregate function *(PR [#6135](https://github.com/tobymao/sqlglot/pull/6135) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
75
|
+
|
|
76
|
+
Do not consider BIT_COUNT an aggregate function (#6135)
|
|
77
|
+
|
|
78
|
+
- due to [`d136414`](https://github.com/tobymao/sqlglot/commit/d136414e520270ac9ab2fd8e9df4691d269b3af0) - avoid simplifying AND with NULL *(PR [#6148](https://github.com/tobymao/sqlglot/pull/6148) by [@geooo109](https://github.com/geooo109))*:
|
|
79
|
+
|
|
80
|
+
avoid simplifying AND with NULL (#6148)
|
|
81
|
+
|
|
82
|
+
- due to [`3a334f3`](https://github.com/tobymao/sqlglot/commit/3a334f376b9766b6b99fdf195ae763bb44976ec4) - annotate type for boolnot snowflake function *(PR [#6141](https://github.com/tobymao/sqlglot/pull/6141) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*:
|
|
83
|
+
|
|
84
|
+
annotate type for boolnot snowflake function (#6141)
|
|
85
|
+
|
|
86
|
+
- due to [`99949cc`](https://github.com/tobymao/sqlglot/commit/99949ccd3ff81b524edeae437d874b86250dbb5b) - avoid needlessly copying in lineage *(PR [#6150](https://github.com/tobymao/sqlglot/pull/6150) by [@georgesittas](https://github.com/georgesittas))*:
|
|
87
|
+
|
|
88
|
+
avoid needlessly copying in lineage (#6150)
|
|
89
|
+
|
|
90
|
+
- due to [`4e36f9d`](https://github.com/tobymao/sqlglot/commit/4e36f9dd6a854b378c9bbf6b2e9811045affc63d) - Annotate type for snowflake TIMEADD function *(PR [#6134](https://github.com/tobymao/sqlglot/pull/6134) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
91
|
+
|
|
92
|
+
Annotate type for snowflake TIMEADD function (#6134)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### :sparkles: New Features
|
|
96
|
+
- [`c49ba0e`](https://github.com/tobymao/sqlglot/commit/c49ba0eee21f7776703d2a26c6641b4a32a1cff7) - **optimizer**: Annotate type for snowflake WIDTH_BUCKET function *(PR [#6078](https://github.com/tobymao/sqlglot/pull/6078) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
97
|
+
- [`fbc1f13`](https://github.com/tobymao/sqlglot/commit/fbc1f1335eecaaaab4fc93ddbb74611a4df0aea7) - **optimizer**: annotate type for Snowflake CONVERT_TIMEZONE function *(PR [#6076](https://github.com/tobymao/sqlglot/pull/6076) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
98
|
+
- [`70e977c`](https://github.com/tobymao/sqlglot/commit/70e977c5edfb495529d38a9096cb40762a9b5d7b) - **optimizer**: annotate type for Snowflake DATE_TRUNC function *(PR [#6080](https://github.com/tobymao/sqlglot/pull/6080) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
99
|
+
- [`e9cf146`](https://github.com/tobymao/sqlglot/commit/e9cf146a4a6cd78f6a59c195e7ec12240b836e5e) - **optimizer**: annotate type for Snowflake DATE_PART function *(PR [#6079](https://github.com/tobymao/sqlglot/pull/6079) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
100
|
+
- [`cdf3b1b`](https://github.com/tobymao/sqlglot/commit/cdf3b1b34dc044064d0a5ba7ff22723b8ae33e5d) - **optimizer**: Annotate type for snowflake add_months function *(PR [#6097](https://github.com/tobymao/sqlglot/pull/6097) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
101
|
+
- [`6fe5824`](https://github.com/tobymao/sqlglot/commit/6fe58247888c326093618657fb027e482d82d107) - **optimizer**: Annotate type for hour, minute, second functions *(PR [#6100](https://github.com/tobymao/sqlglot/pull/6100) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
102
|
+
- [`483770b`](https://github.com/tobymao/sqlglot/commit/483770b816fab14b7eb7222974ed2c99045302a7) - **optimizer**: Annotate type for snowflake TIME_SLICE function *(PR [#6098](https://github.com/tobymao/sqlglot/pull/6098) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
103
|
+
- [`071a995`](https://github.com/tobymao/sqlglot/commit/071a9954aad220c1e13ba7a6714a083058a8e03f) - **tsql**: add support for iso_week on DATEPART *(PR [#6111](https://github.com/tobymao/sqlglot/pull/6111) by [@lBilali](https://github.com/lBilali))*
|
|
104
|
+
- :arrow_lower_right: *addresses issue [#6110](https://github.com/tobymao/sqlglot/issues/6110) opened by [@lBilali](https://github.com/lBilali)*
|
|
105
|
+
- [`c286cee`](https://github.com/tobymao/sqlglot/commit/c286cee54ab93e1fd0b3be658f7e767e3e00afe9) - **optimizer**: Annotate type for snowflake MONTHNAME function *(PR [#6116](https://github.com/tobymao/sqlglot/pull/6116) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
106
|
+
- [`1a34788`](https://github.com/tobymao/sqlglot/commit/1a34788025bdd8a018c4bb9214f72152e68bdd14) - **optimizer**: Annotate type for snowflake PREVIOUS_DAY function *(PR [#6117](https://github.com/tobymao/sqlglot/pull/6117) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
107
|
+
- [`533faf8`](https://github.com/tobymao/sqlglot/commit/533faf87b6df351070b565dd1fe9ce4e13b6c46e) - **spark**: transpile duckdb `READ_PARQUET` to `parquet.<path>` closes [#6122](https://github.com/tobymao/sqlglot/pull/6122) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
108
|
+
- [`cd4e557`](https://github.com/tobymao/sqlglot/commit/cd4e557658b1384f36c9a1ef9da5a09b893229b1) - **optimizer**: Annotate type for snowflake RANDOM function *(PR [#6124](https://github.com/tobymao/sqlglot/pull/6124) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*
|
|
109
|
+
- [`fe63d84`](https://github.com/tobymao/sqlglot/commit/fe63d84f1bd365b22221f348d79c0546aa3118b0) - **optimizer**: annotate type for Snowflake MONTHS_BETWEEN function *(PR [#6120](https://github.com/tobymao/sqlglot/pull/6120) by [@fivetran-MichaelLee](https://github.com/fivetran-MichaelLee))*
|
|
110
|
+
- [`7cb7598`](https://github.com/tobymao/sqlglot/commit/7cb7598e13260aa45c851dc620b4994ddfa089fe) - **optimizer**: Annotate type for snowflake TIME_FROM_PARTS function *(PR [#6119](https://github.com/tobymao/sqlglot/pull/6119) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
111
|
+
- [`598d09b`](https://github.com/tobymao/sqlglot/commit/598d09b036d938c90a44955d67175ea868090ba2) - **optimizer**: annotate type for Snowflake DATEADD function *(PR [#6089](https://github.com/tobymao/sqlglot/pull/6089) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
112
|
+
- [`b98bcee`](https://github.com/tobymao/sqlglot/commit/b98bcee148ba426816e166dbfa9ba8e0979aae21) - **optimizer**: Annotate type for snowflake next_day function *(PR [#6125](https://github.com/tobymao/sqlglot/pull/6125) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
113
|
+
- [`fe1927f`](https://github.com/tobymao/sqlglot/commit/fe1927f28600e2d8863a4e7f06e6a21bf6ff7f9c) - **duckdb**: Transpile unix_micros to epoch_us *(PR [#6127](https://github.com/tobymao/sqlglot/pull/6127) by [@vchan](https://github.com/vchan))*
|
|
114
|
+
- [`a531f10`](https://github.com/tobymao/sqlglot/commit/a531f107235c29ac6a7e627a323f00b8ecf7023d) - **duckdb**: transpile TimeSub *(PR [#6142](https://github.com/tobymao/sqlglot/pull/6142) by [@toriwei](https://github.com/toriwei))*
|
|
115
|
+
- [`b1a9dff`](https://github.com/tobymao/sqlglot/commit/b1a9dfff52a0ffbb0b7c8bfedb0a90e245b97851) - make qualify faster by owly resetting scope when needed *(PR [#6081](https://github.com/tobymao/sqlglot/pull/6081) by [@tobymao](https://github.com/tobymao))*
|
|
116
|
+
- [`3a334f3`](https://github.com/tobymao/sqlglot/commit/3a334f376b9766b6b99fdf195ae763bb44976ec4) - **optimizer**: annotate type for boolnot snowflake function *(PR [#6141](https://github.com/tobymao/sqlglot/pull/6141) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*
|
|
117
|
+
- [`4e36f9d`](https://github.com/tobymao/sqlglot/commit/4e36f9dd6a854b378c9bbf6b2e9811045affc63d) - **optimizer**: Annotate type for snowflake TIMEADD function *(PR [#6134](https://github.com/tobymao/sqlglot/pull/6134) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
118
|
+
|
|
119
|
+
### :bug: Bug Fixes
|
|
120
|
+
- [`2238ac2`](https://github.com/tobymao/sqlglot/commit/2238ac27478bd272ba39928bbec1075c4191ee1b) - **duckdb**: transpile timestamp literals in datediff fixes [#6083](https://github.com/tobymao/sqlglot/pull/6083) *(PR [#6086](https://github.com/tobymao/sqlglot/pull/6086) by [@georgesittas](https://github.com/georgesittas))*
|
|
121
|
+
- [`bef541c`](https://github.com/tobymao/sqlglot/commit/bef541cec36f8c4295f815c3f5cd22491738901b) - **parser**: query mods and set ops in FROM-first syntax *(PR [#6092](https://github.com/tobymao/sqlglot/pull/6092) by [@geooo109](https://github.com/geooo109))*
|
|
122
|
+
- :arrow_lower_right: *fixes issue [#6088](https://github.com/tobymao/sqlglot/issues/6088) opened by [@denis-komarov](https://github.com/denis-komarov)*
|
|
123
|
+
- :arrow_lower_right: *fixes issue [#6091](https://github.com/tobymao/sqlglot/issues/6091) opened by [@denis-komarov](https://github.com/denis-komarov)*
|
|
124
|
+
- :arrow_lower_right: *fixes issue [#6093](https://github.com/tobymao/sqlglot/issues/6093) opened by [@denis-komarov](https://github.com/denis-komarov)*
|
|
125
|
+
- [`5109890`](https://github.com/tobymao/sqlglot/commit/510989043d18baa17502a971262462814a2eb5be) - **parser**: VALUES with ORDER BY/LIMIT/OFFSET *(PR [#6094](https://github.com/tobymao/sqlglot/pull/6094) by [@geooo109](https://github.com/geooo109))*
|
|
126
|
+
- :arrow_lower_right: *fixes issue [#6087](https://github.com/tobymao/sqlglot/issues/6087) opened by [@denis-komarov](https://github.com/denis-komarov)*
|
|
127
|
+
- [`4b062c8`](https://github.com/tobymao/sqlglot/commit/4b062c850bd9867be0d622f3f526762fa2b72302) - consume more syntax for cubes/rollups fixes [#6101](https://github.com/tobymao/sqlglot/pull/6101) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
128
|
+
- [`f00866a`](https://github.com/tobymao/sqlglot/commit/f00866aeb8b7f51e27173c688225fe16d777eb1a) - **duckdb**: 1 arg FORMAT func *(PR [#6109](https://github.com/tobymao/sqlglot/pull/6109) by [@geooo109](https://github.com/geooo109))*
|
|
129
|
+
- :arrow_lower_right: *fixes issue [#6108](https://github.com/tobymao/sqlglot/issues/6108) opened by [@erindru](https://github.com/erindru)*
|
|
130
|
+
- [`77dfd5a`](https://github.com/tobymao/sqlglot/commit/77dfd5a41bb9ce5450e0f6b7a78c953c8ade14d5) - lineage does not modify sql input if expression *(PR [#6113](https://github.com/tobymao/sqlglot/pull/6113) by [@snovik75](https://github.com/snovik75))*
|
|
131
|
+
- :arrow_lower_right: *fixes issue [#6112](https://github.com/tobymao/sqlglot/issues/6112) opened by [@snovik75](https://github.com/snovik75)*
|
|
132
|
+
- [`06f40f9`](https://github.com/tobymao/sqlglot/commit/06f40f900ce693ba4203514e422cba8cda0dbb07) - **optimizer**: don't simplify x XOR x due to NULL semantics *(PR [#6115](https://github.com/tobymao/sqlglot/pull/6115) by [@geooo109](https://github.com/geooo109))*
|
|
133
|
+
- :arrow_lower_right: *fixes issue [#6104](https://github.com/tobymao/sqlglot/issues/6104) opened by [@dllggyx](https://github.com/dllggyx)*
|
|
134
|
+
- [`03e2dff`](https://github.com/tobymao/sqlglot/commit/03e2dff9b074dc228cf3854ff1f4357e091aa9b3) - allow parsing `analyze` as an identifier fixes [#6123](https://github.com/tobymao/sqlglot/pull/6123) *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
135
|
+
- [`8744431`](https://github.com/tobymao/sqlglot/commit/874443148c8ec2a773dfaca5da10d3587a49de3e) - transpile bigquery DATETIME_DIFF to duckdb *(PR [#6126](https://github.com/tobymao/sqlglot/pull/6126) by [@toriwei](https://github.com/toriwei))*
|
|
136
|
+
- :arrow_lower_right: *fixes issue [#6107](https://github.com/tobymao/sqlglot/issues/6107) opened by [@izeigerman](https://github.com/izeigerman)*
|
|
137
|
+
- [`b94e81b`](https://github.com/tobymao/sqlglot/commit/b94e81b42b89c75625b2da779c0f53777d9b6b48) - **optimizer**: avoid removing string literals from WHERE clause *(PR [#6131](https://github.com/tobymao/sqlglot/pull/6131) by [@geooo109](https://github.com/geooo109))*
|
|
138
|
+
- :arrow_lower_right: *fixes issue [#6128](https://github.com/tobymao/sqlglot/issues/6128) opened by [@dllggyx](https://github.com/dllggyx)*
|
|
139
|
+
- [`e2129c6`](https://github.com/tobymao/sqlglot/commit/e2129c6766ca1f10ff6663bec98be984abb33c91) - **optimizer**: Do not consider BIT_COUNT an aggregate function *(PR [#6135](https://github.com/tobymao/sqlglot/pull/6135) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
140
|
+
- :arrow_lower_right: *fixes issue [#6130](https://github.com/tobymao/sqlglot/issues/6130) opened by [@dllggyx](https://github.com/dllggyx)*
|
|
141
|
+
- [`03bfeed`](https://github.com/tobymao/sqlglot/commit/03bfeed56c5c2f143ce2e1be38d519f902d19961) - **starrocks**: disable IS TRUE/FALSE syntax support *(PR [#6145](https://github.com/tobymao/sqlglot/pull/6145) by [@petrikoro](https://github.com/petrikoro))*
|
|
142
|
+
- :arrow_lower_right: *fixes issue [#6144](https://github.com/tobymao/sqlglot/issues/6144) opened by [@petrikoro](https://github.com/petrikoro)*
|
|
143
|
+
- [`d136414`](https://github.com/tobymao/sqlglot/commit/d136414e520270ac9ab2fd8e9df4691d269b3af0) - **optimizer**: avoid simplifying AND with NULL *(PR [#6148](https://github.com/tobymao/sqlglot/pull/6148) by [@geooo109](https://github.com/geooo109))*
|
|
144
|
+
- :arrow_lower_right: *fixes issue [#6136](https://github.com/tobymao/sqlglot/issues/6136) opened by [@dllggyx](https://github.com/dllggyx)*
|
|
145
|
+
- [`1fd9991`](https://github.com/tobymao/sqlglot/commit/1fd99911a60f0543fbc79221a8c6a6f232ed0a2a) - **clickhouse**: NOT + IN precedence *(PR [#6149](https://github.com/tobymao/sqlglot/pull/6149) by [@georgesittas](https://github.com/georgesittas))*
|
|
146
|
+
- :arrow_lower_right: *fixes issue [#6143](https://github.com/tobymao/sqlglot/issues/6143) opened by [@mlipiev](https://github.com/mlipiev)*
|
|
147
|
+
|
|
148
|
+
### :recycle: Refactors
|
|
149
|
+
- [`58dbce3`](https://github.com/tobymao/sqlglot/commit/58dbce30da5ab94af82247ab8a7eb85200d9b8af) - bq static type annotators *(PR [#6103](https://github.com/tobymao/sqlglot/pull/6103) by [@geooo109](https://github.com/geooo109))*
|
|
150
|
+
- [`c970235`](https://github.com/tobymao/sqlglot/commit/c97023549623fe5974d6bff57e64339eff74187e) - clean up MONTHNAME test *(commit by [@geooo109](https://github.com/geooo109))*
|
|
151
|
+
|
|
152
|
+
### :wrench: Chores
|
|
153
|
+
- [`d36ba87`](https://github.com/tobymao/sqlglot/commit/d36ba8774a2a4b53c122e3b78086ce0f09e77244) - **optimizer**: add tests for Snowflake DATE_FROM_PARTS function *(PR [#6077](https://github.com/tobymao/sqlglot/pull/6077) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
154
|
+
- [`2bc05cf`](https://github.com/tobymao/sqlglot/commit/2bc05cf3bd53b874a1505c747e38f8a6a1dbf8c7) - **optimizer**: add tests for Snowflake DATEDIFF function *(PR [#6090](https://github.com/tobymao/sqlglot/pull/6090) by [@fivetran-BradfordPaskewitz](https://github.com/fivetran-BradfordPaskewitz))*
|
|
155
|
+
- [`a4d07a0`](https://github.com/tobymao/sqlglot/commit/a4d07a07eefbdaf88d30df2310a9533afdc75a82) - **optimizer**: Annotate type for snowflake EXTRACT function *(PR [#6099](https://github.com/tobymao/sqlglot/pull/6099) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
156
|
+
- [`ab1da2e`](https://github.com/tobymao/sqlglot/commit/ab1da2e54a83e29d708047d4b3f8abcc1094229d) - **optimizer**: add type annotation tests for snowflake LAST_DAY function *(PR [#6105](https://github.com/tobymao/sqlglot/pull/6105) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
157
|
+
- [`4e24c0a`](https://github.com/tobymao/sqlglot/commit/4e24c0ad92e7071a1f1537886173e29999b46f72) - **optimizer**: add type annotation tests for snowflake TIMESTAMPDIFF function *(PR [#6138](https://github.com/tobymao/sqlglot/pull/6138) by [@fivetran-MichaelLee](https://github.com/fivetran-MichaelLee))*
|
|
158
|
+
- [`ae8571f`](https://github.com/tobymao/sqlglot/commit/ae8571fdec71587188e45fe087e1967f5ba641bc) - **optimizer**: add type annotation tests for snowflake TIMEDIFF *(PR [#6140](https://github.com/tobymao/sqlglot/pull/6140) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*
|
|
159
|
+
- [`3059320`](https://github.com/tobymao/sqlglot/commit/30593202b30001933f05747937975013754b75fa) - copy by default in `lineage` *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
160
|
+
- [`99949cc`](https://github.com/tobymao/sqlglot/commit/99949ccd3ff81b524edeae437d874b86250dbb5b) - avoid needlessly copying in lineage *(PR [#6150](https://github.com/tobymao/sqlglot/pull/6150) by [@georgesittas](https://github.com/georgesittas))*
|
|
161
|
+
- [`e7756d8`](https://github.com/tobymao/sqlglot/commit/e7756d8e9f347bfba3f861463890bf57e532cc54) - **optimizer**: add annotation tests for snowflake's BOOLXOR *(PR [#6154](https://github.com/tobymao/sqlglot/pull/6154) by [@fivetran-felixhuang](https://github.com/fivetran-felixhuang))*
|
|
162
|
+
- [`72e43e3`](https://github.com/tobymao/sqlglot/commit/72e43e3ea08f9dce5a32654060a56f2ee31bea8f) - **optimizer**: add type annotation tests for snowflake's TIMESTAMPADD function *(PR [#6146](https://github.com/tobymao/sqlglot/pull/6146) by [@fivetran-ashashankar](https://github.com/fivetran-ashashankar))*
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## [v27.27.0] - 2025-10-13
|
|
166
|
+
### :boom: BREAKING CHANGES
|
|
167
|
+
- due to [`c67276d`](https://github.com/tobymao/sqlglot/commit/c67276d5be970252e14d1817d8498fc9985222d9) - Annotate type for snowflake RADIANS function. *(PR [#6064](https://github.com/tobymao/sqlglot/pull/6064) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
168
|
+
|
|
169
|
+
Annotate type for snowflake RADIANS function. (#6064)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### :sparkles: New Features
|
|
173
|
+
- [`c67276d`](https://github.com/tobymao/sqlglot/commit/c67276d5be970252e14d1817d8498fc9985222d9) - **optimizer**: Annotate type for snowflake RADIANS function. *(PR [#6064](https://github.com/tobymao/sqlglot/pull/6064) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*
|
|
174
|
+
|
|
175
|
+
### :wrench: Chores
|
|
176
|
+
- [`dab2a3f`](https://github.com/tobymao/sqlglot/commit/dab2a3fbdb8a523f05319eb34a1fd34534272206) - bump sqlglotrs version to 0.7.3 *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
177
|
+
|
|
178
|
+
|
|
4
179
|
## [v27.26.0] - 2025-10-10
|
|
5
180
|
### :boom: BREAKING CHANGES
|
|
6
181
|
- due to [`9060f60`](https://github.com/tobymao/sqlglot/commit/9060f603818db863b7570a2c3c50c3eb88155e76) - Annotate type for snowflake ATAN2 function. *(PR [#6060](https://github.com/tobymao/sqlglot/pull/6060) by [@fivetran-amrutabhimsenayachit](https://github.com/fivetran-amrutabhimsenayachit))*:
|
|
@@ -7870,3 +8045,5 @@ Changelog
|
|
|
7870
8045
|
[v27.22.2]: https://github.com/tobymao/sqlglot/compare/v27.22.1...v27.22.2
|
|
7871
8046
|
[v27.25.0]: https://github.com/tobymao/sqlglot/compare/v27.24.2...v27.25.0
|
|
7872
8047
|
[v27.26.0]: https://github.com/tobymao/sqlglot/compare/v27.25.2...v27.26.0
|
|
8048
|
+
[v27.27.0]: https://github.com/tobymao/sqlglot/compare/v27.26.0...v27.27.0
|
|
8049
|
+
[v27.28.0]: https://github.com/tobymao/sqlglot/compare/v27.27.0...v27.28.0
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '27.
|
|
32
|
-
__version_tuple__ = version_tuple = (27,
|
|
31
|
+
__version__ = version = '27.28.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (27, 28, 1)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g0c5387499'
|
|
@@ -496,6 +496,115 @@ class BigQuery(Dialect):
|
|
|
496
496
|
# BigQuery maps Type.TIMESTAMP to DATETIME, so we need to amend the inferred types
|
|
497
497
|
TYPE_TO_EXPRESSIONS = {
|
|
498
498
|
**Dialect.TYPE_TO_EXPRESSIONS,
|
|
499
|
+
exp.DataType.Type.BIGINT: {
|
|
500
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BIGINT],
|
|
501
|
+
exp.Ascii,
|
|
502
|
+
exp.BitwiseAndAgg,
|
|
503
|
+
exp.BitwiseOrAgg,
|
|
504
|
+
exp.BitwiseXorAgg,
|
|
505
|
+
exp.BitwiseCount,
|
|
506
|
+
exp.ByteLength,
|
|
507
|
+
exp.DenseRank,
|
|
508
|
+
exp.FarmFingerprint,
|
|
509
|
+
exp.Grouping,
|
|
510
|
+
exp.LaxInt64,
|
|
511
|
+
exp.Ntile,
|
|
512
|
+
exp.Rank,
|
|
513
|
+
exp.RangeBucket,
|
|
514
|
+
exp.RegexpInstr,
|
|
515
|
+
exp.RowNumber,
|
|
516
|
+
exp.Unicode,
|
|
517
|
+
},
|
|
518
|
+
exp.DataType.Type.BINARY: {
|
|
519
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BINARY],
|
|
520
|
+
exp.ByteString,
|
|
521
|
+
exp.CodePointsToBytes,
|
|
522
|
+
exp.MD5Digest,
|
|
523
|
+
exp.SHA,
|
|
524
|
+
exp.SHA2,
|
|
525
|
+
exp.Unhex,
|
|
526
|
+
},
|
|
527
|
+
exp.DataType.Type.BOOLEAN: {
|
|
528
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.BOOLEAN],
|
|
529
|
+
exp.IsInf,
|
|
530
|
+
exp.IsNan,
|
|
531
|
+
exp.JSONBool,
|
|
532
|
+
exp.LaxBool,
|
|
533
|
+
},
|
|
534
|
+
exp.DataType.Type.DATE: {
|
|
535
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DATE],
|
|
536
|
+
exp.DateFromUnixDate,
|
|
537
|
+
},
|
|
538
|
+
exp.DataType.Type.DATETIME: {
|
|
539
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DATETIME],
|
|
540
|
+
exp.ParseDatetime,
|
|
541
|
+
exp.TimestampFromParts,
|
|
542
|
+
},
|
|
543
|
+
exp.DataType.Type.DECIMAL: {
|
|
544
|
+
exp.ParseNumeric,
|
|
545
|
+
},
|
|
546
|
+
exp.DataType.Type.BIGDECIMAL: {
|
|
547
|
+
exp.ParseBignumeric,
|
|
548
|
+
},
|
|
549
|
+
exp.DataType.Type.DOUBLE: {
|
|
550
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.DOUBLE],
|
|
551
|
+
exp.Acos,
|
|
552
|
+
exp.Acosh,
|
|
553
|
+
exp.Asin,
|
|
554
|
+
exp.Asinh,
|
|
555
|
+
exp.Atan,
|
|
556
|
+
exp.Atanh,
|
|
557
|
+
exp.Atan2,
|
|
558
|
+
exp.Cbrt,
|
|
559
|
+
exp.Corr,
|
|
560
|
+
exp.Cot,
|
|
561
|
+
exp.CosineDistance,
|
|
562
|
+
exp.Coth,
|
|
563
|
+
exp.CovarPop,
|
|
564
|
+
exp.CovarSamp,
|
|
565
|
+
exp.Csc,
|
|
566
|
+
exp.Csch,
|
|
567
|
+
exp.CumeDist,
|
|
568
|
+
exp.EuclideanDistance,
|
|
569
|
+
exp.Float64,
|
|
570
|
+
exp.LaxFloat64,
|
|
571
|
+
exp.PercentRank,
|
|
572
|
+
exp.Rand,
|
|
573
|
+
exp.Sec,
|
|
574
|
+
exp.Sech,
|
|
575
|
+
exp.Sin,
|
|
576
|
+
exp.Sinh,
|
|
577
|
+
},
|
|
578
|
+
exp.DataType.Type.JSON: {
|
|
579
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.JSON],
|
|
580
|
+
exp.JSONArray,
|
|
581
|
+
exp.JSONArrayAppend,
|
|
582
|
+
exp.JSONArrayInsert,
|
|
583
|
+
exp.JSONObject,
|
|
584
|
+
exp.JSONRemove,
|
|
585
|
+
exp.JSONSet,
|
|
586
|
+
exp.JSONStripNulls,
|
|
587
|
+
},
|
|
588
|
+
exp.DataType.Type.TIME: {
|
|
589
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.TIME],
|
|
590
|
+
exp.ParseTime,
|
|
591
|
+
exp.TimeFromParts,
|
|
592
|
+
exp.TimeTrunc,
|
|
593
|
+
exp.TsOrDsToTime,
|
|
594
|
+
},
|
|
595
|
+
exp.DataType.Type.VARCHAR: {
|
|
596
|
+
*Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.VARCHAR],
|
|
597
|
+
exp.CodePointsToString,
|
|
598
|
+
exp.Format,
|
|
599
|
+
exp.JSONExtractScalar,
|
|
600
|
+
exp.JSONType,
|
|
601
|
+
exp.LaxString,
|
|
602
|
+
exp.LowerHex,
|
|
603
|
+
exp.Normalize,
|
|
604
|
+
exp.SafeConvertBytesToString,
|
|
605
|
+
exp.Soundex,
|
|
606
|
+
exp.Uuid,
|
|
607
|
+
},
|
|
499
608
|
exp.DataType.Type.TIMESTAMPTZ: Dialect.TYPE_TO_EXPRESSIONS[exp.DataType.Type.TIMESTAMP],
|
|
500
609
|
}
|
|
501
610
|
TYPE_TO_EXPRESSIONS.pop(exp.DataType.Type.TIMESTAMP)
|
|
@@ -545,64 +654,15 @@ class BigQuery(Dialect):
|
|
|
545
654
|
exp.Upper,
|
|
546
655
|
)
|
|
547
656
|
},
|
|
548
|
-
exp.Acos: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
549
|
-
exp.Acosh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
550
|
-
exp.Asin: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
551
|
-
exp.Asinh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
552
|
-
exp.Atan: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
553
|
-
exp.Atanh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
554
|
-
exp.Atan2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
555
657
|
exp.ApproxTopSum: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
556
658
|
exp.ApproxTopK: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
557
659
|
exp.ApproxQuantiles: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
558
660
|
exp.Array: _annotate_array,
|
|
559
661
|
exp.ArrayConcat: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
|
560
|
-
exp.Ascii: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
561
|
-
exp.BitwiseAndAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
562
|
-
exp.BitwiseOrAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
563
|
-
exp.BitwiseXorAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
564
|
-
exp.BitwiseCountAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
565
|
-
exp.ByteLength: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
566
|
-
exp.ByteString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
567
|
-
exp.Cbrt: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
568
|
-
exp.CodePointsToBytes: lambda self, e: self._annotate_with_type(
|
|
569
|
-
e, exp.DataType.Type.BINARY
|
|
570
|
-
),
|
|
571
|
-
exp.CodePointsToString: lambda self, e: self._annotate_with_type(
|
|
572
|
-
e, exp.DataType.Type.VARCHAR
|
|
573
|
-
),
|
|
574
662
|
exp.Concat: _annotate_concat,
|
|
575
|
-
exp.Corr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
576
|
-
exp.Cot: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
577
|
-
exp.CosineDistance: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
578
|
-
exp.Coth: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
579
|
-
exp.CovarPop: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
580
|
-
exp.CovarSamp: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
581
|
-
exp.Csc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
582
|
-
exp.Csch: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
583
|
-
exp.CumeDist: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
584
|
-
exp.DateFromUnixDate: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATE),
|
|
585
|
-
exp.DenseRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
586
|
-
exp.EuclideanDistance: lambda self, e: self._annotate_with_type(
|
|
587
|
-
e, exp.DataType.Type.DOUBLE
|
|
588
|
-
),
|
|
589
|
-
exp.FarmFingerprint: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
590
|
-
exp.Unhex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
591
|
-
exp.Float64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
592
|
-
exp.Format: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
593
663
|
exp.GenerateTimestampArray: lambda self, e: self._annotate_with_type(
|
|
594
664
|
e, exp.DataType.build("ARRAY<TIMESTAMP>", dialect="bigquery")
|
|
595
665
|
),
|
|
596
|
-
exp.Grouping: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
597
|
-
exp.IsInf: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
598
|
-
exp.IsNan: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
599
|
-
exp.JSONArray: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
600
|
-
exp.JSONArrayAppend: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
601
|
-
exp.JSONArrayInsert: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
602
|
-
exp.JSONBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
603
|
-
exp.JSONExtractScalar: lambda self, e: self._annotate_with_type(
|
|
604
|
-
e, exp.DataType.Type.VARCHAR
|
|
605
|
-
),
|
|
606
666
|
exp.JSONExtractArray: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
607
667
|
exp.JSONFormat: lambda self, e: self._annotate_with_type(
|
|
608
668
|
e, exp.DataType.Type.JSON if e.args.get("to_json") else exp.DataType.Type.VARCHAR
|
|
@@ -610,62 +670,19 @@ class BigQuery(Dialect):
|
|
|
610
670
|
exp.JSONKeysAtDepth: lambda self, e: self._annotate_with_type(
|
|
611
671
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
612
672
|
),
|
|
613
|
-
exp.JSONObject: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
614
|
-
exp.JSONRemove: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
615
|
-
exp.JSONSet: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
616
|
-
exp.JSONStripNulls: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
617
|
-
exp.JSONType: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
618
673
|
exp.JSONValueArray: lambda self, e: self._annotate_with_type(
|
|
619
674
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
620
675
|
),
|
|
621
676
|
exp.Lag: lambda self, e: self._annotate_by_args(e, "this", "default"),
|
|
622
|
-
exp.LowerHex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
623
|
-
exp.LaxBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
624
|
-
exp.LaxFloat64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
625
|
-
exp.LaxInt64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
626
|
-
exp.LaxString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
627
|
-
exp.MD5Digest: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
628
|
-
exp.Normalize: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
629
|
-
exp.Ntile: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
630
|
-
exp.ParseTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
631
|
-
exp.ParseDatetime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATETIME),
|
|
632
|
-
exp.ParseBignumeric: lambda self, e: self._annotate_with_type(
|
|
633
|
-
e, exp.DataType.Type.BIGDECIMAL
|
|
634
|
-
),
|
|
635
|
-
exp.ParseNumeric: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DECIMAL),
|
|
636
677
|
exp.PercentileCont: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
637
|
-
exp.PercentRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
638
|
-
exp.Rank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
639
|
-
exp.RangeBucket: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
640
678
|
exp.RegexpExtractAll: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
641
|
-
exp.RegexpInstr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
642
|
-
exp.RowNumber: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
643
|
-
exp.Rand: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
644
|
-
exp.SafeConvertBytesToString: lambda self, e: self._annotate_with_type(
|
|
645
|
-
e, exp.DataType.Type.VARCHAR
|
|
646
|
-
),
|
|
647
679
|
exp.SafeAdd: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
648
680
|
exp.SafeMultiply: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
649
681
|
exp.SafeSubtract: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
650
|
-
exp.Sec: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
651
|
-
exp.Sech: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
652
|
-
exp.Soundex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
653
|
-
exp.SHA: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
654
|
-
exp.SHA2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
655
|
-
exp.Sin: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
656
|
-
exp.Sinh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
657
682
|
exp.Split: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
658
|
-
exp.TimestampFromParts: lambda self, e: self._annotate_with_type(
|
|
659
|
-
e, exp.DataType.Type.DATETIME
|
|
660
|
-
),
|
|
661
|
-
exp.TimeFromParts: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
662
|
-
exp.TimeTrunc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
663
683
|
exp.ToCodePoints: lambda self, e: self._annotate_with_type(
|
|
664
684
|
e, exp.DataType.build("ARRAY<BIGINT>", dialect="bigquery")
|
|
665
685
|
),
|
|
666
|
-
exp.TsOrDsToTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
667
|
-
exp.Unicode: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
668
|
-
exp.Uuid: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
669
686
|
}
|
|
670
687
|
|
|
671
688
|
def normalize_identifier(self, expression: E) -> E:
|
|
@@ -786,7 +803,7 @@ class BigQuery(Dialect):
|
|
|
786
803
|
"BIT_AND": exp.BitwiseAndAgg.from_arg_list,
|
|
787
804
|
"BIT_OR": exp.BitwiseOrAgg.from_arg_list,
|
|
788
805
|
"BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
|
|
789
|
-
"BIT_COUNT": exp.
|
|
806
|
+
"BIT_COUNT": exp.BitwiseCount.from_arg_list,
|
|
790
807
|
"BOOL": exp.JSONBool.from_arg_list,
|
|
791
808
|
"CONTAINS_SUBSTR": _build_contains_substring,
|
|
792
809
|
"DATE": _build_date,
|
|
@@ -1302,7 +1319,7 @@ class BigQuery(Dialect):
|
|
|
1302
1319
|
exp.BitwiseAndAgg: rename_func("BIT_AND"),
|
|
1303
1320
|
exp.BitwiseOrAgg: rename_func("BIT_OR"),
|
|
1304
1321
|
exp.BitwiseXorAgg: rename_func("BIT_XOR"),
|
|
1305
|
-
exp.
|
|
1322
|
+
exp.BitwiseCount: rename_func("BIT_COUNT"),
|
|
1306
1323
|
exp.ByteLength: rename_func("BYTE_LENGTH"),
|
|
1307
1324
|
exp.Cast: transforms.preprocess([transforms.remove_precision_parameterized_types]),
|
|
1308
1325
|
exp.CollateProperty: lambda self, e: (
|
|
@@ -1418,9 +1418,12 @@ class ClickHouse(Dialect):
|
|
|
1418
1418
|
return in_sql
|
|
1419
1419
|
|
|
1420
1420
|
def not_sql(self, expression: exp.Not) -> str:
|
|
1421
|
-
if isinstance(expression.this, exp.In)
|
|
1422
|
-
|
|
1423
|
-
|
|
1421
|
+
if isinstance(expression.this, exp.In):
|
|
1422
|
+
if expression.this.args.get("is_global"):
|
|
1423
|
+
# let `GLOBAL IN` child interpose `NOT`
|
|
1424
|
+
return self.sql(expression, "this")
|
|
1425
|
+
|
|
1426
|
+
expression.set("this", exp.paren(expression.this, copy=False))
|
|
1424
1427
|
|
|
1425
1428
|
return super().not_sql(expression)
|
|
1426
1429
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import re
|
|
3
4
|
import typing as t
|
|
4
5
|
|
|
5
6
|
from sqlglot import exp, generator, parser, tokens, transforms
|
|
@@ -44,6 +45,10 @@ from sqlglot.helper import seq_get
|
|
|
44
45
|
from sqlglot.tokens import TokenType
|
|
45
46
|
from sqlglot.parser import binary_range_parser
|
|
46
47
|
|
|
48
|
+
# Regex to detect time zones in timestamps of the form [+|-]TT[:tt]
|
|
49
|
+
# The pattern matches timezone offsets that appear after the time portion
|
|
50
|
+
TIMEZONE_PATTERN = re.compile(r":\d{2}.*?[+\-]\d{2}(?::\d{2})?")
|
|
51
|
+
|
|
47
52
|
|
|
48
53
|
# BigQuery -> DuckDB conversion for the DATE function
|
|
49
54
|
def _date_sql(self: DuckDB.Generator, expression: exp.Date) -> str:
|
|
@@ -211,7 +216,18 @@ def _arrow_json_extract_sql(self: DuckDB.Generator, expression: JSON_EXTRACT_TYP
|
|
|
211
216
|
def _implicit_datetime_cast(
|
|
212
217
|
arg: t.Optional[exp.Expression], type: exp.DataType.Type = exp.DataType.Type.DATE
|
|
213
218
|
) -> t.Optional[exp.Expression]:
|
|
214
|
-
|
|
219
|
+
if isinstance(arg, exp.Literal) and arg.is_string:
|
|
220
|
+
ts = arg.name
|
|
221
|
+
if type == exp.DataType.Type.DATE and ":" in ts:
|
|
222
|
+
type = (
|
|
223
|
+
exp.DataType.Type.TIMESTAMPTZ
|
|
224
|
+
if TIMEZONE_PATTERN.search(ts)
|
|
225
|
+
else exp.DataType.Type.TIMESTAMP
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
arg = exp.cast(arg, type)
|
|
229
|
+
|
|
230
|
+
return arg
|
|
215
231
|
|
|
216
232
|
|
|
217
233
|
def _date_diff_sql(self: DuckDB.Generator, expression: exp.DateDiff) -> str:
|
|
@@ -694,6 +710,7 @@ class DuckDB(Dialect):
|
|
|
694
710
|
exp.DateDiff: _date_diff_sql,
|
|
695
711
|
exp.DateStrToDate: datestrtodate_sql,
|
|
696
712
|
exp.Datetime: no_datetime_sql,
|
|
713
|
+
exp.DatetimeDiff: _date_diff_sql,
|
|
697
714
|
exp.DatetimeSub: date_delta_to_binary_interval_op(),
|
|
698
715
|
exp.DatetimeAdd: date_delta_to_binary_interval_op(),
|
|
699
716
|
exp.DateToDi: lambda self,
|
|
@@ -758,6 +775,7 @@ class DuckDB(Dialect):
|
|
|
758
775
|
exp.Struct: _struct_sql,
|
|
759
776
|
exp.Transform: rename_func("LIST_TRANSFORM"),
|
|
760
777
|
exp.TimeAdd: date_delta_to_binary_interval_op(),
|
|
778
|
+
exp.TimeSub: date_delta_to_binary_interval_op(),
|
|
761
779
|
exp.Time: no_time_sql,
|
|
762
780
|
exp.TimeDiff: _timediff_sql,
|
|
763
781
|
exp.Timestamp: no_timestamp_sql,
|
|
@@ -781,6 +799,7 @@ class DuckDB(Dialect):
|
|
|
781
799
|
exp.cast(e.expression, exp.DataType.Type.TIMESTAMP),
|
|
782
800
|
exp.cast(e.this, exp.DataType.Type.TIMESTAMP),
|
|
783
801
|
),
|
|
802
|
+
exp.UnixMicros: rename_func("EPOCH_US"),
|
|
784
803
|
exp.UnixToStr: lambda self, e: self.func(
|
|
785
804
|
"STRFTIME", self.func("TO_TIMESTAMP", e.this), self.format_time(e)
|
|
786
805
|
),
|
|
@@ -325,7 +325,7 @@ class MySQL(Dialect):
|
|
|
325
325
|
"BIT_AND": exp.BitwiseAndAgg.from_arg_list,
|
|
326
326
|
"BIT_OR": exp.BitwiseOrAgg.from_arg_list,
|
|
327
327
|
"BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
|
|
328
|
-
"BIT_COUNT": exp.
|
|
328
|
+
"BIT_COUNT": exp.BitwiseCount.from_arg_list,
|
|
329
329
|
"CONVERT_TZ": lambda args: exp.ConvertTimezone(
|
|
330
330
|
source_tz=seq_get(args, 1), target_tz=seq_get(args, 2), timestamp=seq_get(args, 0)
|
|
331
331
|
),
|
|
@@ -755,7 +755,7 @@ class MySQL(Dialect):
|
|
|
755
755
|
exp.BitwiseAndAgg: rename_func("BIT_AND"),
|
|
756
756
|
exp.BitwiseOrAgg: rename_func("BIT_OR"),
|
|
757
757
|
exp.BitwiseXorAgg: rename_func("BIT_XOR"),
|
|
758
|
-
exp.
|
|
758
|
+
exp.BitwiseCount: rename_func("BIT_COUNT"),
|
|
759
759
|
exp.CurrentDate: no_paren_current_date_sql,
|
|
760
760
|
exp.DateDiff: _remove_ts_or_ds_to_date(
|
|
761
761
|
lambda self, e: self.func("DATEDIFF", e.this, e.expression), ("this", "expression")
|