sqlglot 27.11.0__tar.gz → 27.12.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-27.11.0 → sqlglot-27.12.0}/CHANGELOG.md +157 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/PKG-INFO +1 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/_version.py +3 -3
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/bigquery.py +72 -31
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/clickhouse.py +4 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/databricks.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/doris.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/duckdb.py +4 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/hive.py +11 -5
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/oracle.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/singlestore.py +61 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/snowflake.py +7 -4
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/spark.py +6 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/expressions.py +102 -2
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/generator.py +14 -2
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify_columns.py +18 -3
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/parser.py +34 -10
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/tokens.py +4 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.egg-info/PKG-INFO +1 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_bigquery.py +42 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_clickhouse.py +3 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_databricks.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_doris.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_duckdb.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_hive.py +3 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_mysql.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_oracle.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_singlestore.py +84 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_snowflake.py +45 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/identity.sql +20 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/annotate_functions.sql +333 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_optimizer.py +33 -13
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_transpile.py +0 -1
- {sqlglot-27.11.0 → sqlglot-27.12.0}/.gitignore +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/.gitpod.yml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/CONTRIBUTING.md +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/LICENSE +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/MANIFEST.in +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/Makefile +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/README.md +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/pyproject.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/setup.cfg +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/setup.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/__main__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/_typing.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/diff.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/errors.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/helper.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/lineage.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/planner.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/py.typed +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/schema.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/serde.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/time.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/transforms.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot/trie.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.egg-info/requires.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglot.png +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/Cargo.lock +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/Cargo.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/benches/dialect_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/benches/long.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/benches/token_type_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/pyproject.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/src/lib.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/src/settings.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/src/token.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/src/tokenizer.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/sqlglotrs/src/trie.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_dialect.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_postgres.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_spark.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/helpers.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_build.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_diff.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_docs.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_executor.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_expressions.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_generator.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_helper.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_lineage.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_parser.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_schema.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_serde.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_time.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_tokens.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.12.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,162 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v27.11.0] - 2025-09-03
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`baffd2c`](https://github.com/tobymao/sqlglot/commit/baffd2c0be9657683781f3f8831c47e32dbf68bb) - parse and annotate type for bq REGEXP_INSTR *(PR [#5710](https://github.com/tobymao/sqlglot/pull/5710) by [@geooo109](https://github.com/geooo109))*:
|
|
7
|
+
|
|
8
|
+
parse and annotate type for bq REGEXP_INSTR (#5710)
|
|
9
|
+
|
|
10
|
+
- due to [`b79eb19`](https://github.com/tobymao/sqlglot/commit/b79eb198cc21203efa82128b357d435338e9133d) - annotate type for bq ROW_NUMBER *(PR [#5716](https://github.com/tobymao/sqlglot/pull/5716) by [@geooo109](https://github.com/geooo109))*:
|
|
11
|
+
|
|
12
|
+
annotate type for bq ROW_NUMBER (#5716)
|
|
13
|
+
|
|
14
|
+
- due to [`f709bef`](https://github.com/tobymao/sqlglot/commit/f709bef3af7cd0daa25fe3d58b1753c3e65720ef) - annotate type for bq FIRST_VALUE *(PR [#5718](https://github.com/tobymao/sqlglot/pull/5718) by [@geooo109](https://github.com/geooo109))*:
|
|
15
|
+
|
|
16
|
+
annotate type for bq FIRST_VALUE (#5718)
|
|
17
|
+
|
|
18
|
+
- due to [`15a9061`](https://github.com/tobymao/sqlglot/commit/15a906170e5d5cdaa207ec7607edfdd7d4a8b774) - annotate type for bq PERCENTILE_DISC *(PR [#5722](https://github.com/tobymao/sqlglot/pull/5722) by [@geooo109](https://github.com/geooo109))*:
|
|
19
|
+
|
|
20
|
+
annotate type for bq PERCENTILE_DISC (#5722)
|
|
21
|
+
|
|
22
|
+
- due to [`7d49609`](https://github.com/tobymao/sqlglot/commit/7d4960963f0ef70b96f5b969bb008d2742e833ea) - annotate type for bq NTH_VALUE *(PR [#5720](https://github.com/tobymao/sqlglot/pull/5720) by [@geooo109](https://github.com/geooo109))*:
|
|
23
|
+
|
|
24
|
+
annotate type for bq NTH_VALUE (#5720)
|
|
25
|
+
|
|
26
|
+
- due to [`d41acf1`](https://github.com/tobymao/sqlglot/commit/d41acf11221bee30a5ae089cbac9b158ed3dd515) - annotate type for bq LEAD *(PR [#5719](https://github.com/tobymao/sqlglot/pull/5719) by [@geooo109](https://github.com/geooo109))*:
|
|
27
|
+
|
|
28
|
+
annotate type for bq LEAD (#5719)
|
|
29
|
+
|
|
30
|
+
- due to [`ff12130`](https://github.com/tobymao/sqlglot/commit/ff12130c23a215917f20fda7d50322f1cb7de599) - annotate type for bq PERNCENTILE_CONT *(PR [#5729](https://github.com/tobymao/sqlglot/pull/5729) by [@geooo109](https://github.com/geooo109))*:
|
|
31
|
+
|
|
32
|
+
annotate type for bq PERNCENTILE_CONT (#5729)
|
|
33
|
+
|
|
34
|
+
- due to [`fdb8a0a`](https://github.com/tobymao/sqlglot/commit/fdb8a0a6d0d74194255f313bd934db7fc1ce0d3f) - parse and annotate type for bq FORMAT *(PR [#5715](https://github.com/tobymao/sqlglot/pull/5715) by [@geooo109](https://github.com/geooo109))*:
|
|
35
|
+
|
|
36
|
+
parse and annotate type for bq FORMAT (#5715)
|
|
37
|
+
|
|
38
|
+
- due to [`012bdd3`](https://github.com/tobymao/sqlglot/commit/012bdd3c8aeff180f85354ffd403fc1aa5815dcf) - parse and annotate type for bq CUME_DIST *(PR [#5735](https://github.com/tobymao/sqlglot/pull/5735) by [@geooo109](https://github.com/geooo109))*:
|
|
39
|
+
|
|
40
|
+
parse and annotate type for bq CUME_DIST (#5735)
|
|
41
|
+
|
|
42
|
+
- due to [`b99eaeb`](https://github.com/tobymao/sqlglot/commit/b99eaeb0c6eb3dc613e76d205e02632bd6af353b) - parse and annotate type for bq DENSE_RANK *(PR [#5736](https://github.com/tobymao/sqlglot/pull/5736) by [@geooo109](https://github.com/geooo109))*:
|
|
43
|
+
|
|
44
|
+
parse and annotate type for bq DENSE_RANK (#5736)
|
|
45
|
+
|
|
46
|
+
- due to [`bb95c73`](https://github.com/tobymao/sqlglot/commit/bb95c7312c942ef987955f01e060604d60e32e83) - parse and annotate type for bq RANK *(PR [#5738](https://github.com/tobymao/sqlglot/pull/5738) by [@geooo109](https://github.com/geooo109))*:
|
|
47
|
+
|
|
48
|
+
parse and annotate type for bq RANK (#5738)
|
|
49
|
+
|
|
50
|
+
- due to [`8713c08`](https://github.com/tobymao/sqlglot/commit/8713c082b0aa8454a5773fc2a85e08a132dc6ce3) - parse and annotate type for bq PERCENT_RANK *(PR [#5739](https://github.com/tobymao/sqlglot/pull/5739) by [@geooo109](https://github.com/geooo109))*:
|
|
51
|
+
|
|
52
|
+
parse and annotate type for bq PERCENT_RANK (#5739)
|
|
53
|
+
|
|
54
|
+
- due to [`9ce4e31`](https://github.com/tobymao/sqlglot/commit/9ce4e31aecbde6ea1f227a7166c0f3dc9e302a66) - annotate type for bq JSON_OBJECT *(PR [#5740](https://github.com/tobymao/sqlglot/pull/5740) by [@geooo109](https://github.com/geooo109))*:
|
|
55
|
+
|
|
56
|
+
annotate type for bq JSON_OBJECT (#5740)
|
|
57
|
+
|
|
58
|
+
- due to [`d35ec6e`](https://github.com/tobymao/sqlglot/commit/d35ec6e37e21cf3cec848ed55bd73128c4633cd2) - annotate type for bq JSON_QUERY/JSON_QUERY_ARRAY *(PR [#5741](https://github.com/tobymao/sqlglot/pull/5741) by [@geooo109](https://github.com/geooo109))*:
|
|
59
|
+
|
|
60
|
+
annotate type for bq JSON_QUERY/JSON_QUERY_ARRAY (#5741)
|
|
61
|
+
|
|
62
|
+
- due to [`4753642`](https://github.com/tobymao/sqlglot/commit/4753642cfcfb1f192ec4d21a492737b27affef09) - annotate type for bq JSON_EXTRACT_SCALAR *(commit by [@geooo109](https://github.com/geooo109))*:
|
|
63
|
+
|
|
64
|
+
annotate type for bq JSON_EXTRACT_SCALAR
|
|
65
|
+
|
|
66
|
+
- due to [`113a530`](https://github.com/tobymao/sqlglot/commit/113a5308d050fd5ceacab4c6188e5eea5dd740b1) - parse and annotate type for bq JSON_ARRAY_APPEND *(PR [#5747](https://github.com/tobymao/sqlglot/pull/5747) by [@geooo109](https://github.com/geooo109))*:
|
|
67
|
+
|
|
68
|
+
parse and annotate type for bq JSON_ARRAY_APPEND (#5747)
|
|
69
|
+
|
|
70
|
+
- due to [`268e2c6`](https://github.com/tobymao/sqlglot/commit/268e2c694d1eb99f1fe64477bc38ed4946bf1c32) - parse and annotate type for bq JSON_ARRAY_INSERT *(PR [#5748](https://github.com/tobymao/sqlglot/pull/5748) by [@geooo109](https://github.com/geooo109))*:
|
|
71
|
+
|
|
72
|
+
parse and annotate type for bq JSON_ARRAY_INSERT (#5748)
|
|
73
|
+
|
|
74
|
+
- due to [`455ec1f`](https://github.com/tobymao/sqlglot/commit/455ec1f4f8aecb5435fa4cb2912bfc21db8dd44d) - parse and annotate type for bq JSON_KEYS *(PR [#5749](https://github.com/tobymao/sqlglot/pull/5749) by [@geooo109](https://github.com/geooo109))*:
|
|
75
|
+
|
|
76
|
+
parse and annotate type for bq JSON_KEYS (#5749)
|
|
77
|
+
|
|
78
|
+
- due to [`59895fa`](https://github.com/tobymao/sqlglot/commit/59895faa23ebe1b27938c37a7b39df87de609844) - parse and annotate type for bq JSON_REMOVE *(PR [#5750](https://github.com/tobymao/sqlglot/pull/5750) by [@geooo109](https://github.com/geooo109))*:
|
|
79
|
+
|
|
80
|
+
parse and annotate type for bq JSON_REMOVE (#5750)
|
|
81
|
+
|
|
82
|
+
- due to [`06d7df7`](https://github.com/tobymao/sqlglot/commit/06d7df7a05f2824cabf48e8d1e8a4ebca8fda496) - parse and annotate type for bq JSON_SET *(PR [#5751](https://github.com/tobymao/sqlglot/pull/5751) by [@geooo109](https://github.com/geooo109))*:
|
|
83
|
+
|
|
84
|
+
parse and annotate type for bq JSON_SET (#5751)
|
|
85
|
+
|
|
86
|
+
- due to [`e72b341`](https://github.com/tobymao/sqlglot/commit/e72b3419c8a367caa0e5e80030979cd94e87a40d) - parse and annotate type for bq JSON_STRIP_NULLS *(PR [#5753](https://github.com/tobymao/sqlglot/pull/5753) by [@geooo109](https://github.com/geooo109))*:
|
|
87
|
+
|
|
88
|
+
parse and annotate type for bq JSON_STRIP_NULLS (#5753)
|
|
89
|
+
|
|
90
|
+
- due to [`5de61a7`](https://github.com/tobymao/sqlglot/commit/5de61a7ab850d4e68fde4d76ee396d30d7bdef33) - parse and annotate type for bq JSON_EXTRACT_STRING_ARRAY *(PR [#5758](https://github.com/tobymao/sqlglot/pull/5758) by [@geooo109](https://github.com/geooo109))*:
|
|
91
|
+
|
|
92
|
+
parse and annotate type for bq JSON_EXTRACT_STRING_ARRAY (#5758)
|
|
93
|
+
|
|
94
|
+
- due to [`36c9393`](https://github.com/tobymao/sqlglot/commit/36c93939575a19bd611269719c39d3d216be8cde) - parse and annotate type for bq JSON LAX funcs *(PR [#5760](https://github.com/tobymao/sqlglot/pull/5760) by [@geooo109](https://github.com/geooo109))*:
|
|
95
|
+
|
|
96
|
+
parse and annotate type for bq JSON LAX funcs (#5760)
|
|
97
|
+
|
|
98
|
+
- due to [`88862b5`](https://github.com/tobymao/sqlglot/commit/88862b56bc29c8a600b4d0e4693d5846d3a577ff) - annotate type for bq TO_JSON_STRING *(PR [#5762](https://github.com/tobymao/sqlglot/pull/5762) by [@geooo109](https://github.com/geooo109))*:
|
|
99
|
+
|
|
100
|
+
annotate type for bq TO_JSON_STRING (#5762)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### :sparkles: New Features
|
|
104
|
+
- [`baffd2c`](https://github.com/tobymao/sqlglot/commit/baffd2c0be9657683781f3f8831c47e32dbf68bb) - **optimizer**: parse and annotate type for bq REGEXP_INSTR *(PR [#5710](https://github.com/tobymao/sqlglot/pull/5710) by [@geooo109](https://github.com/geooo109))*
|
|
105
|
+
- [`b79eb19`](https://github.com/tobymao/sqlglot/commit/b79eb198cc21203efa82128b357d435338e9133d) - **optimizer**: annotate type for bq ROW_NUMBER *(PR [#5716](https://github.com/tobymao/sqlglot/pull/5716) by [@geooo109](https://github.com/geooo109))*
|
|
106
|
+
- [`f709bef`](https://github.com/tobymao/sqlglot/commit/f709bef3af7cd0daa25fe3d58b1753c3e65720ef) - **optimizer**: annotate type for bq FIRST_VALUE *(PR [#5718](https://github.com/tobymao/sqlglot/pull/5718) by [@geooo109](https://github.com/geooo109))*
|
|
107
|
+
- [`b9ae9e5`](https://github.com/tobymao/sqlglot/commit/b9ae9e534dee1e32fccbf22cab9bc17fbd920629) - **singlestore**: Implemeted generation of exp.TsOrDiToDi *(PR [#5724](https://github.com/tobymao/sqlglot/pull/5724) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
108
|
+
- [`9b14fff`](https://github.com/tobymao/sqlglot/commit/9b14fffd2c9404f76a3faced2ec9d6eaac8feb01) - **singlestore**: Implemented generation of exp.DateToDi *(PR [#5717](https://github.com/tobymao/sqlglot/pull/5717) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
109
|
+
- [`07d8c23`](https://github.com/tobymao/sqlglot/commit/07d8c2347baba6523310c4d31cddfb0e5c0eddc1) - **singlestore**: Implemented generation of exp.DiToDate *(PR [#5721](https://github.com/tobymao/sqlglot/pull/5721) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
110
|
+
- [`ad34a85`](https://github.com/tobymao/sqlglot/commit/ad34a855a433bc0f51a707cbcb66f8dce667a562) - **singlestore**: Implemented generation of exp.FromTimeZone *(PR [#5723](https://github.com/tobymao/sqlglot/pull/5723) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
111
|
+
- [`29d5e4f`](https://github.com/tobymao/sqlglot/commit/29d5e4f62a799f35c0904a23cedacc6efa95a63b) - **singlestore**: Implemented generation of exp.DatetimeAdd *(PR [#5728](https://github.com/tobymao/sqlglot/pull/5728) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
112
|
+
- [`15a9061`](https://github.com/tobymao/sqlglot/commit/15a906170e5d5cdaa207ec7607edfdd7d4a8b774) - **optimizer**: annotate type for bq PERCENTILE_DISC *(PR [#5722](https://github.com/tobymao/sqlglot/pull/5722) by [@geooo109](https://github.com/geooo109))*
|
|
113
|
+
- [`7d49609`](https://github.com/tobymao/sqlglot/commit/7d4960963f0ef70b96f5b969bb008d2742e833ea) - **optimizer**: annotate type for bq NTH_VALUE *(PR [#5720](https://github.com/tobymao/sqlglot/pull/5720) by [@geooo109](https://github.com/geooo109))*
|
|
114
|
+
- [`d41acf1`](https://github.com/tobymao/sqlglot/commit/d41acf11221bee30a5ae089cbac9b158ed3dd515) - **optimizer**: annotate type for bq LEAD *(PR [#5719](https://github.com/tobymao/sqlglot/pull/5719) by [@geooo109](https://github.com/geooo109))*
|
|
115
|
+
- [`113809a`](https://github.com/tobymao/sqlglot/commit/113809a07efee0f12758bd2571c8515885568466) - **singlestore**: Implemented exp.TimeStrToDate generation *(PR [#5725](https://github.com/tobymao/sqlglot/pull/5725) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
116
|
+
- [`cf63d0d`](https://github.com/tobymao/sqlglot/commit/cf63d0df4c2f58b2cf0c87e2a3a6f63f836a50a1) - **dremio**: add regexp_like and alias regexp_matches *(PR [#5731](https://github.com/tobymao/sqlglot/pull/5731) by [@jasonthomassql](https://github.com/jasonthomassql))*
|
|
117
|
+
- [`e42160f`](https://github.com/tobymao/sqlglot/commit/e42160f27fa68828898969073f2f4a0014f5e3e9) - **dremio**: support alias repeatstr *(PR [#5730](https://github.com/tobymao/sqlglot/pull/5730) by [@jasonthomassql](https://github.com/jasonthomassql))*
|
|
118
|
+
- [`ff12130`](https://github.com/tobymao/sqlglot/commit/ff12130c23a215917f20fda7d50322f1cb7de599) - **optimizer**: annotate type for bq PERNCENTILE_CONT *(PR [#5729](https://github.com/tobymao/sqlglot/pull/5729) by [@geooo109](https://github.com/geooo109))*
|
|
119
|
+
- [`fdb8a0a`](https://github.com/tobymao/sqlglot/commit/fdb8a0a6d0d74194255f313bd934db7fc1ce0d3f) - **optimizer**: parse and annotate type for bq FORMAT *(PR [#5715](https://github.com/tobymao/sqlglot/pull/5715) by [@geooo109](https://github.com/geooo109))*
|
|
120
|
+
- [`e272292`](https://github.com/tobymao/sqlglot/commit/e272292197f2bb81ccfad1de06a95f321f0b565f) - **singlestore**: Implemented generation of exp.Time *(PR [#5727](https://github.com/tobymao/sqlglot/pull/5727) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
121
|
+
- [`012bdd3`](https://github.com/tobymao/sqlglot/commit/012bdd3c8aeff180f85354ffd403fc1aa5815dcf) - **optimizer**: parse and annotate type for bq CUME_DIST *(PR [#5735](https://github.com/tobymao/sqlglot/pull/5735) by [@geooo109](https://github.com/geooo109))*
|
|
122
|
+
- [`b99eaeb`](https://github.com/tobymao/sqlglot/commit/b99eaeb0c6eb3dc613e76d205e02632bd6af353b) - **optimizer**: parse and annotate type for bq DENSE_RANK *(PR [#5736](https://github.com/tobymao/sqlglot/pull/5736) by [@geooo109](https://github.com/geooo109))*
|
|
123
|
+
- [`8cf6ef9`](https://github.com/tobymao/sqlglot/commit/8cf6ef92a0f43943efb0fe380f41dc09f43aca85) - **optimizer**: parse and annotate_type for bq NTILE *(PR [#5737](https://github.com/tobymao/sqlglot/pull/5737) by [@geooo109](https://github.com/geooo109))*
|
|
124
|
+
- [`bb95c73`](https://github.com/tobymao/sqlglot/commit/bb95c7312c942ef987955f01e060604d60e32e83) - **optimizer**: parse and annotate type for bq RANK *(PR [#5738](https://github.com/tobymao/sqlglot/pull/5738) by [@geooo109](https://github.com/geooo109))*
|
|
125
|
+
- [`8713c08`](https://github.com/tobymao/sqlglot/commit/8713c082b0aa8454a5773fc2a85e08a132dc6ce3) - **optimizer**: parse and annotate type for bq PERCENT_RANK *(PR [#5739](https://github.com/tobymao/sqlglot/pull/5739) by [@geooo109](https://github.com/geooo109))*
|
|
126
|
+
- [`9ce4e31`](https://github.com/tobymao/sqlglot/commit/9ce4e31aecbde6ea1f227a7166c0f3dc9e302a66) - **optimizer**: annotate type for bq JSON_OBJECT *(PR [#5740](https://github.com/tobymao/sqlglot/pull/5740) by [@geooo109](https://github.com/geooo109))*
|
|
127
|
+
- [`d35ec6e`](https://github.com/tobymao/sqlglot/commit/d35ec6e37e21cf3cec848ed55bd73128c4633cd2) - **optimizer**: annotate type for bq JSON_QUERY/JSON_QUERY_ARRAY *(PR [#5741](https://github.com/tobymao/sqlglot/pull/5741) by [@geooo109](https://github.com/geooo109))*
|
|
128
|
+
- [`4753642`](https://github.com/tobymao/sqlglot/commit/4753642cfcfb1f192ec4d21a492737b27affef09) - **optimizer**: annotate type for bq JSON_EXTRACT_SCALAR *(commit by [@geooo109](https://github.com/geooo109))*
|
|
129
|
+
- [`6249dbe`](https://github.com/tobymao/sqlglot/commit/6249dbe4173ad5278adf84452dcf7253a2395b91) - **singlestore**: Added generation of exp.DatetimeDiff *(PR [#5743](https://github.com/tobymao/sqlglot/pull/5743) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
130
|
+
- [`113a530`](https://github.com/tobymao/sqlglot/commit/113a5308d050fd5ceacab4c6188e5eea5dd740b1) - **optimizer**: parse and annotate type for bq JSON_ARRAY_APPEND *(PR [#5747](https://github.com/tobymao/sqlglot/pull/5747) by [@geooo109](https://github.com/geooo109))*
|
|
131
|
+
- [`8603705`](https://github.com/tobymao/sqlglot/commit/8603705a8e5513699adc2499389c67412eee70cb) - **singlestore**: feat(singlestore): Implemented generation of exp.DatetimeSub *(PR [#5744](https://github.com/tobymao/sqlglot/pull/5744) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
132
|
+
- [`7d71c0b`](https://github.com/tobymao/sqlglot/commit/7d71c0bb576f9de3447b4780ab64a3f4d92c6432) - **singlestore**: Fixed generation of exp.DatetimeTrunc and exp.DateTrunc *(PR [#5745](https://github.com/tobymao/sqlglot/pull/5745) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
133
|
+
- [`268e2c6`](https://github.com/tobymao/sqlglot/commit/268e2c694d1eb99f1fe64477bc38ed4946bf1c32) - **optimizer**: parse and annotate type for bq JSON_ARRAY_INSERT *(PR [#5748](https://github.com/tobymao/sqlglot/pull/5748) by [@geooo109](https://github.com/geooo109))*
|
|
134
|
+
- [`455ec1f`](https://github.com/tobymao/sqlglot/commit/455ec1f4f8aecb5435fa4cb2912bfc21db8dd44d) - **optimizer**: parse and annotate type for bq JSON_KEYS *(PR [#5749](https://github.com/tobymao/sqlglot/pull/5749) by [@geooo109](https://github.com/geooo109))*
|
|
135
|
+
- [`59895fa`](https://github.com/tobymao/sqlglot/commit/59895faa23ebe1b27938c37a7b39df87de609844) - **optimizer**: parse and annotate type for bq JSON_REMOVE *(PR [#5750](https://github.com/tobymao/sqlglot/pull/5750) by [@geooo109](https://github.com/geooo109))*
|
|
136
|
+
- [`06d7df7`](https://github.com/tobymao/sqlglot/commit/06d7df7a05f2824cabf48e8d1e8a4ebca8fda496) - **optimizer**: parse and annotate type for bq JSON_SET *(PR [#5751](https://github.com/tobymao/sqlglot/pull/5751) by [@geooo109](https://github.com/geooo109))*
|
|
137
|
+
- [`7f5079a`](https://github.com/tobymao/sqlglot/commit/7f5079a1b71c4dd28e98b77b5b749e074fce862c) - **singlestore**: Improved geneation of exp.DataType *(PR [#5746](https://github.com/tobymao/sqlglot/pull/5746) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
138
|
+
- [`ad9405c`](https://github.com/tobymao/sqlglot/commit/ad9405cd43108ff80d16711f8b33ff57430ed686) - **singlestore**: fixed generation of exp.TimestampTrunc *(PR [#5754](https://github.com/tobymao/sqlglot/pull/5754) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
139
|
+
- [`a1852f9`](https://github.com/tobymao/sqlglot/commit/a1852f93fdfe926072c12954c95796d038e15140) - **dremio**: parse date_part *(PR [#5756](https://github.com/tobymao/sqlglot/pull/5756) by [@jasonthomassql](https://github.com/jasonthomassql))*
|
|
140
|
+
- [`0db1df6`](https://github.com/tobymao/sqlglot/commit/0db1df617ec4f05b1ee6cf1d606272f6e799a9b9) - **singlestore**: Fixed generation of exp.DateDiff *(PR [#5752](https://github.com/tobymao/sqlglot/pull/5752) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
141
|
+
- [`e72b341`](https://github.com/tobymao/sqlglot/commit/e72b3419c8a367caa0e5e80030979cd94e87a40d) - **optimizer**: parse and annotate type for bq JSON_STRIP_NULLS *(PR [#5753](https://github.com/tobymao/sqlglot/pull/5753) by [@geooo109](https://github.com/geooo109))*
|
|
142
|
+
- [`5de61a7`](https://github.com/tobymao/sqlglot/commit/5de61a7ab850d4e68fde4d76ee396d30d7bdef33) - **optimizer**: parse and annotate type for bq JSON_EXTRACT_STRING_ARRAY *(PR [#5758](https://github.com/tobymao/sqlglot/pull/5758) by [@geooo109](https://github.com/geooo109))*
|
|
143
|
+
- [`36c9393`](https://github.com/tobymao/sqlglot/commit/36c93939575a19bd611269719c39d3d216be8cde) - **optimizer**: parse and annotate type for bq JSON LAX funcs *(PR [#5760](https://github.com/tobymao/sqlglot/pull/5760) by [@geooo109](https://github.com/geooo109))*
|
|
144
|
+
- [`c443d5c`](https://github.com/tobymao/sqlglot/commit/c443d5caf2d9695856103eebfff21cb215777112) - **dremio**: parse datetype *(PR [#5759](https://github.com/tobymao/sqlglot/pull/5759) by [@jasonthomassql](https://github.com/jasonthomassql))*
|
|
145
|
+
- [`5172a99`](https://github.com/tobymao/sqlglot/commit/5172a99fc4d5e21a1dbe4509d6d7ab1ccfe8bff7) - **singlestore**: Fixed parsing of columns with table name *(PR [#5767](https://github.com/tobymao/sqlglot/pull/5767) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
146
|
+
- [`88862b5`](https://github.com/tobymao/sqlglot/commit/88862b56bc29c8a600b4d0e4693d5846d3a577ff) - **optimizer**: annotate type for bq TO_JSON_STRING *(PR [#5762](https://github.com/tobymao/sqlglot/pull/5762) by [@geooo109](https://github.com/geooo109))*
|
|
147
|
+
|
|
148
|
+
### :bug: Bug Fixes
|
|
149
|
+
- [`ec93497`](https://github.com/tobymao/sqlglot/commit/ec93497bac82090b88c6e749ec2adc99bbc23a61) - **bigquery**: support commands inside for loops *(PR [#5732](https://github.com/tobymao/sqlglot/pull/5732) by [@treysp](https://github.com/treysp))*
|
|
150
|
+
- [`85845bb`](https://github.com/tobymao/sqlglot/commit/85845bb941ac9a4ee090a89cd3d3dab4ab5835a7) - **snowflake**: allow exclude as id var *(PR [#5764](https://github.com/tobymao/sqlglot/pull/5764) by [@treysp](https://github.com/treysp))*
|
|
151
|
+
- [`db2d9cc`](https://github.com/tobymao/sqlglot/commit/db2d9cca9718fb196066dbf60840124917d1f8ac) - **tokenizer**: handle empty hex strings *(PR [#5763](https://github.com/tobymao/sqlglot/pull/5763) by [@paulolieuthier](https://github.com/paulolieuthier))*
|
|
152
|
+
- :arrow_lower_right: *fixes issue [#5761](https://github.com/tobymao/sqlglot/issues/5761) opened by [@paulolieuthier](https://github.com/paulolieuthier)*
|
|
153
|
+
- [`982257b`](https://github.com/tobymao/sqlglot/commit/982257b40973cdfc20a8d6dd9a1674cda7eb75c4) - **bigquery**: Crash when ARRAY_CONCAT is called with no expressions *(PR [#5755](https://github.com/tobymao/sqlglot/pull/5755) by [@ozadari](https://github.com/ozadari))*
|
|
154
|
+
- [`24ca504`](https://github.com/tobymao/sqlglot/commit/24ca504360779c8a20a58accf506eb9600ac9bf8) - **bigquery**: Crash when ARRAY_CONCAT is called with no expressions *(PR [#5755](https://github.com/tobymao/sqlglot/pull/5755) by [@ozadari](https://github.com/ozadari))*
|
|
155
|
+
|
|
156
|
+
### :wrench: Chores
|
|
157
|
+
- [`41521e3`](https://github.com/tobymao/sqlglot/commit/41521e31b465acd51ab02b1ac4e5512b98175b7e) - bump sqlglotrs to 0.6.2 *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
158
|
+
|
|
159
|
+
|
|
4
160
|
## [v27.10.0] - 2025-08-28
|
|
5
161
|
### :boom: BREAKING CHANGES
|
|
6
162
|
- due to [`de2fe15`](https://github.com/tobymao/sqlglot/commit/de2fe1503b5bb003431d1f0c7b9ae87932a6cc1c) - annotate type for bq CONTAINS_SUBSTR *(PR [#5705](https://github.com/tobymao/sqlglot/pull/5705) by [@geooo109](https://github.com/geooo109))*:
|
|
@@ -6813,3 +6969,4 @@ Changelog
|
|
|
6813
6969
|
[v27.8.0]: https://github.com/tobymao/sqlglot/compare/v27.7.0...v27.8.0
|
|
6814
6970
|
[v27.9.0]: https://github.com/tobymao/sqlglot/compare/v27.8.0...v27.9.0
|
|
6815
6971
|
[v27.10.0]: https://github.com/tobymao/sqlglot/compare/v27.9.0...v27.10.0
|
|
6972
|
+
[v27.11.0]: https://github.com/tobymao/sqlglot/compare/v27.10.0...v27.11.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.12.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (27, 12, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g8af0d4005'
|
|
@@ -310,17 +310,16 @@ def _annotate_math_functions(self: TypeAnnotator, expression: E) -> E:
|
|
|
310
310
|
return expression
|
|
311
311
|
|
|
312
312
|
|
|
313
|
-
def
|
|
314
|
-
self: TypeAnnotator, expression: exp.PercentileCont
|
|
315
|
-
) -> exp.PercentileCont:
|
|
313
|
+
def _annotate_by_args_with_coerce(self: TypeAnnotator, expression: E) -> E:
|
|
316
314
|
"""
|
|
317
|
-
|
|
318
|
-
| INPUT | NUMERIC
|
|
319
|
-
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
|
323
|
-
|
|
315
|
+
+------------+------------+------------+-------------+---------+
|
|
316
|
+
| INPUT | INT64 | NUMERIC | BIGNUMERIC | FLOAT64 |
|
|
317
|
+
+------------+------------+------------+-------------+---------+
|
|
318
|
+
| INT64 | INT64 | NUMERIC | BIGNUMERIC | FLOAT64 |
|
|
319
|
+
| NUMERIC | NUMERIC | NUMERIC | BIGNUMERIC | FLOAT64 |
|
|
320
|
+
| BIGNUMERIC | BIGNUMERIC | BIGNUMERIC | BIGNUMERIC | FLOAT64 |
|
|
321
|
+
| FLOAT64 | FLOAT64 | FLOAT64 | FLOAT64 | FLOAT64 |
|
|
322
|
+
+------------+------------+------------+-------------+---------+
|
|
324
323
|
"""
|
|
325
324
|
self._annotate_args(expression)
|
|
326
325
|
|
|
@@ -492,6 +491,7 @@ class BigQuery(Dialect):
|
|
|
492
491
|
exp.DataType.Type.BIGDECIMAL: {exp.DataType.Type.DOUBLE},
|
|
493
492
|
}
|
|
494
493
|
COERCES_TO[exp.DataType.Type.DECIMAL] |= {exp.DataType.Type.BIGDECIMAL}
|
|
494
|
+
COERCES_TO[exp.DataType.Type.BIGINT] |= {exp.DataType.Type.BIGDECIMAL}
|
|
495
495
|
|
|
496
496
|
# BigQuery maps Type.TIMESTAMP to DATETIME, so we need to amend the inferred types
|
|
497
497
|
TYPE_TO_EXPRESSIONS = {
|
|
@@ -514,23 +514,47 @@ class BigQuery(Dialect):
|
|
|
514
514
|
**{
|
|
515
515
|
expr_type: lambda self, e: self._annotate_by_args(e, "this")
|
|
516
516
|
for expr_type in (
|
|
517
|
+
exp.Abs,
|
|
518
|
+
exp.ArgMax,
|
|
519
|
+
exp.ArgMin,
|
|
520
|
+
exp.DateTrunc,
|
|
521
|
+
exp.DatetimeTrunc,
|
|
522
|
+
exp.FirstValue,
|
|
523
|
+
exp.GroupConcat,
|
|
524
|
+
exp.IgnoreNulls,
|
|
525
|
+
exp.JSONExtract,
|
|
526
|
+
exp.Lead,
|
|
517
527
|
exp.Left,
|
|
518
|
-
exp.Right,
|
|
519
528
|
exp.Lower,
|
|
520
|
-
exp.
|
|
529
|
+
exp.NthValue,
|
|
521
530
|
exp.Pad,
|
|
522
|
-
exp.
|
|
531
|
+
exp.PercentileDisc,
|
|
523
532
|
exp.RegexpExtract,
|
|
524
533
|
exp.RegexpReplace,
|
|
525
534
|
exp.Repeat,
|
|
535
|
+
exp.Replace,
|
|
536
|
+
exp.RespectNulls,
|
|
537
|
+
exp.Reverse,
|
|
538
|
+
exp.Right,
|
|
539
|
+
exp.SafeNegate,
|
|
540
|
+
exp.Sign,
|
|
526
541
|
exp.Substring,
|
|
542
|
+
exp.TimestampTrunc,
|
|
543
|
+
exp.Translate,
|
|
544
|
+
exp.Trim,
|
|
545
|
+
exp.Upper,
|
|
527
546
|
)
|
|
528
547
|
},
|
|
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),
|
|
529
555
|
exp.ApproxTopSum: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
530
556
|
exp.ApproxTopK: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
531
557
|
exp.ApproxQuantiles: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
532
|
-
exp.ArgMax: lambda self, e: self._annotate_by_args(e, "this"),
|
|
533
|
-
exp.ArgMin: lambda self, e: self._annotate_by_args(e, "this"),
|
|
534
558
|
exp.Array: _annotate_array,
|
|
535
559
|
exp.ArrayConcat: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
|
536
560
|
exp.Ascii: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
@@ -540,6 +564,7 @@ class BigQuery(Dialect):
|
|
|
540
564
|
exp.BitwiseCountAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
541
565
|
exp.ByteLength: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
542
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),
|
|
543
568
|
exp.CodePointsToBytes: lambda self, e: self._annotate_with_type(
|
|
544
569
|
e, exp.DataType.Type.BINARY
|
|
545
570
|
),
|
|
@@ -549,14 +574,20 @@ class BigQuery(Dialect):
|
|
|
549
574
|
exp.Concat: _annotate_concat,
|
|
550
575
|
exp.Contains: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
551
576
|
exp.Corr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
577
|
+
exp.Cot: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
578
|
+
exp.CosineDistance: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
579
|
+
exp.Coth: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
552
580
|
exp.CovarPop: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
553
581
|
exp.CovarSamp: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
582
|
+
exp.Csc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
583
|
+
exp.Csch: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
554
584
|
exp.CumeDist: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
555
585
|
exp.DateFromUnixDate: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATE),
|
|
556
|
-
exp.DateTrunc: lambda self, e: self._annotate_by_args(e, "this"),
|
|
557
586
|
exp.DenseRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
587
|
+
exp.EuclideanDistance: lambda self, e: self._annotate_with_type(
|
|
588
|
+
e, exp.DataType.Type.DOUBLE
|
|
589
|
+
),
|
|
558
590
|
exp.FarmFingerprint: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
559
|
-
exp.FirstValue: lambda self, e: self._annotate_by_args(e, "this"),
|
|
560
591
|
exp.Unhex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
561
592
|
exp.Float64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
562
593
|
exp.Format: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
@@ -564,7 +595,8 @@ class BigQuery(Dialect):
|
|
|
564
595
|
e, exp.DataType.build("ARRAY<TIMESTAMP>", dialect="bigquery")
|
|
565
596
|
),
|
|
566
597
|
exp.Grouping: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
567
|
-
exp.
|
|
598
|
+
exp.IsInf: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
599
|
+
exp.IsNan: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
568
600
|
exp.JSONArray: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
569
601
|
exp.JSONArrayAppend: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
570
602
|
exp.JSONArrayInsert: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
@@ -572,9 +604,10 @@ class BigQuery(Dialect):
|
|
|
572
604
|
exp.JSONExtractScalar: lambda self, e: self._annotate_with_type(
|
|
573
605
|
e, exp.DataType.Type.VARCHAR
|
|
574
606
|
),
|
|
575
|
-
exp.JSONExtract: lambda self, e: self._annotate_by_args(e, "this"),
|
|
576
607
|
exp.JSONExtractArray: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
577
|
-
exp.JSONFormat: lambda self, e: self._annotate_with_type(
|
|
608
|
+
exp.JSONFormat: lambda self, e: self._annotate_with_type(
|
|
609
|
+
e, exp.DataType.Type.JSON if e.args.get("to_json") else exp.DataType.Type.VARCHAR
|
|
610
|
+
),
|
|
578
611
|
exp.JSONKeysAtDepth: lambda self, e: self._annotate_with_type(
|
|
579
612
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
580
613
|
),
|
|
@@ -587,7 +620,6 @@ class BigQuery(Dialect):
|
|
|
587
620
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
588
621
|
),
|
|
589
622
|
exp.Lag: lambda self, e: self._annotate_by_args(e, "this", "default"),
|
|
590
|
-
exp.Lead: lambda self, e: self._annotate_by_args(e, "this"),
|
|
591
623
|
exp.LowerHex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
592
624
|
exp.LaxBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
593
625
|
exp.LaxFloat64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
@@ -595,7 +627,6 @@ class BigQuery(Dialect):
|
|
|
595
627
|
exp.LaxString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
596
628
|
exp.MD5Digest: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
597
629
|
exp.Normalize: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
598
|
-
exp.NthValue: lambda self, e: self._annotate_by_args(e, "this"),
|
|
599
630
|
exp.Ntile: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
600
631
|
exp.ParseTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
601
632
|
exp.ParseDatetime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATETIME),
|
|
@@ -603,36 +634,39 @@ class BigQuery(Dialect):
|
|
|
603
634
|
e, exp.DataType.Type.BIGDECIMAL
|
|
604
635
|
),
|
|
605
636
|
exp.ParseNumeric: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DECIMAL),
|
|
606
|
-
exp.PercentileCont: lambda self, e:
|
|
607
|
-
exp.PercentileDisc: lambda self, e: self._annotate_by_args(e, "this"),
|
|
637
|
+
exp.PercentileCont: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
608
638
|
exp.PercentRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
609
639
|
exp.Rank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
640
|
+
exp.RangeBucket: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
610
641
|
exp.RegexpExtractAll: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
611
642
|
exp.RegexpInstr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
612
|
-
exp.Replace: lambda self, e: self._annotate_by_args(e, "this"),
|
|
613
|
-
exp.RespectNulls: lambda self, e: self._annotate_by_args(e, "this"),
|
|
614
|
-
exp.Reverse: lambda self, e: self._annotate_by_args(e, "this"),
|
|
615
643
|
exp.RowNumber: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
644
|
+
exp.Rand: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
616
645
|
exp.SafeConvertBytesToString: lambda self, e: self._annotate_with_type(
|
|
617
646
|
e, exp.DataType.Type.VARCHAR
|
|
618
647
|
),
|
|
648
|
+
exp.SafeAdd: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
649
|
+
exp.SafeMultiply: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
650
|
+
exp.SafeSubtract: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
651
|
+
exp.Sec: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
652
|
+
exp.Sech: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
619
653
|
exp.Soundex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
620
654
|
exp.SHA: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
621
655
|
exp.SHA2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
622
|
-
exp.
|
|
656
|
+
exp.Sin: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
657
|
+
exp.Sinh: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
623
658
|
exp.Split: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
624
659
|
exp.TimestampFromParts: lambda self, e: self._annotate_with_type(
|
|
625
660
|
e, exp.DataType.Type.DATETIME
|
|
626
661
|
),
|
|
627
|
-
exp.TimestampTrunc: lambda self, e: self._annotate_by_args(e, "this"),
|
|
628
662
|
exp.TimeFromParts: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
629
663
|
exp.TimeTrunc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
630
664
|
exp.ToCodePoints: lambda self, e: self._annotate_with_type(
|
|
631
665
|
e, exp.DataType.build("ARRAY<BIGINT>", dialect="bigquery")
|
|
632
666
|
),
|
|
633
667
|
exp.TsOrDsToTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
634
|
-
exp.Translate: lambda self, e: self._annotate_by_args(e, "this"),
|
|
635
668
|
exp.Unicode: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
669
|
+
exp.Uuid: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
636
670
|
}
|
|
637
671
|
|
|
638
672
|
def normalize_identifier(self, expression: E) -> E:
|
|
@@ -804,6 +838,9 @@ class BigQuery(Dialect):
|
|
|
804
838
|
this=seq_get(args, 0), scale=exp.UnixToTime.MILLIS
|
|
805
839
|
),
|
|
806
840
|
"TIMESTAMP_SECONDS": lambda args: exp.UnixToTime(this=seq_get(args, 0)),
|
|
841
|
+
"TO_JSON": lambda args: exp.JSONFormat(
|
|
842
|
+
this=seq_get(args, 0), options=seq_get(args, 1), to_json=True
|
|
843
|
+
),
|
|
807
844
|
"TO_JSON_STRING": exp.JSONFormat.from_arg_list,
|
|
808
845
|
"FORMAT_DATETIME": _build_format_time(exp.TsOrDsToDatetime),
|
|
809
846
|
"FORMAT_TIMESTAMP": _build_format_time(exp.TsOrDsToTimestamp),
|
|
@@ -1274,7 +1311,11 @@ class BigQuery(Dialect):
|
|
|
1274
1311
|
exp.JSONExtract: _json_extract_sql,
|
|
1275
1312
|
exp.JSONExtractArray: _json_extract_sql,
|
|
1276
1313
|
exp.JSONExtractScalar: _json_extract_sql,
|
|
1277
|
-
exp.JSONFormat:
|
|
1314
|
+
exp.JSONFormat: lambda self, e: self.func(
|
|
1315
|
+
"TO_JSON" if e.args.get("to_json") else "TO_JSON_STRING",
|
|
1316
|
+
e.this,
|
|
1317
|
+
e.args.get("options"),
|
|
1318
|
+
),
|
|
1278
1319
|
exp.JSONKeysAtDepth: rename_func("JSON_KEYS"),
|
|
1279
1320
|
exp.JSONValueArray: rename_func("JSON_VALUE_ARRAY"),
|
|
1280
1321
|
exp.Levenshtein: _levenshtein_sql,
|
|
@@ -312,6 +312,7 @@ class ClickHouse(Dialect):
|
|
|
312
312
|
"ARRAYREVERSE": exp.ArrayReverse.from_arg_list,
|
|
313
313
|
"ARRAYSLICE": exp.ArraySlice.from_arg_list,
|
|
314
314
|
"COUNTIF": _build_count_if,
|
|
315
|
+
"COSINEDISTANCE": exp.CosineDistance.from_arg_list,
|
|
315
316
|
"DATE_ADD": build_date_delta(exp.DateAdd, default_unit=None),
|
|
316
317
|
"DATEADD": build_date_delta(exp.DateAdd, default_unit=None),
|
|
317
318
|
"DATE_DIFF": build_date_delta(exp.DateDiff, default_unit=None, supports_timezone=True),
|
|
@@ -324,6 +325,7 @@ class ClickHouse(Dialect):
|
|
|
324
325
|
exp.JSONExtractScalar, zero_based_indexing=False
|
|
325
326
|
),
|
|
326
327
|
"LENGTH": lambda args: exp.Length(this=seq_get(args, 0), binary=True),
|
|
328
|
+
"L2Distance": exp.EuclideanDistance.from_arg_list,
|
|
327
329
|
"MAP": parser.build_var_map,
|
|
328
330
|
"MATCH": exp.RegexpLike.from_arg_list,
|
|
329
331
|
"PARSEDATETIME": _build_datetime_format(exp.ParseDatetime),
|
|
@@ -1094,6 +1096,7 @@ class ClickHouse(Dialect):
|
|
|
1094
1096
|
exp.Array: inline_array_sql,
|
|
1095
1097
|
exp.CastToStrType: rename_func("CAST"),
|
|
1096
1098
|
exp.CountIf: rename_func("countIf"),
|
|
1099
|
+
exp.CosineDistance: rename_func("cosineDistance"),
|
|
1097
1100
|
exp.CompressColumnConstraint: lambda self,
|
|
1098
1101
|
e: f"CODEC({self.expressions(e, key='this', flat=True)})",
|
|
1099
1102
|
exp.ComputedColumnConstraint: lambda self,
|
|
@@ -1123,6 +1126,7 @@ class ClickHouse(Dialect):
|
|
|
1123
1126
|
exp.Rand: rename_func("randCanonical"),
|
|
1124
1127
|
exp.StartsWith: rename_func("startsWith"),
|
|
1125
1128
|
exp.EndsWith: rename_func("endsWith"),
|
|
1129
|
+
exp.EuclideanDistance: rename_func("L2Distance"),
|
|
1126
1130
|
exp.StrPosition: lambda self, e: strposition_sql(
|
|
1127
1131
|
self,
|
|
1128
1132
|
e,
|
|
@@ -50,6 +50,7 @@ class Doris(MySQL):
|
|
|
50
50
|
**MySQL.Parser.FUNCTIONS,
|
|
51
51
|
"COLLECT_SET": exp.ArrayUniqueAgg.from_arg_list,
|
|
52
52
|
"DATE_TRUNC": _build_date_trunc,
|
|
53
|
+
"L2_DISTANCE": exp.EuclideanDistance.from_arg_list,
|
|
53
54
|
"MONTHS_ADD": exp.AddMonths.from_arg_list,
|
|
54
55
|
"REGEXP": exp.RegexpLike.from_arg_list,
|
|
55
56
|
"TO_DATE": exp.TsOrDsToDate.from_arg_list,
|
|
@@ -210,6 +211,7 @@ class Doris(MySQL):
|
|
|
210
211
|
exp.CurrentDate: lambda self, _: self.func("CURRENT_DATE"),
|
|
211
212
|
exp.CurrentTimestamp: lambda self, _: self.func("NOW"),
|
|
212
213
|
exp.DateTrunc: lambda self, e: self.func("DATE_TRUNC", e.this, unit_to_str(e)),
|
|
214
|
+
exp.EuclideanDistance: rename_func("L2_DISTANCE"),
|
|
213
215
|
exp.GroupConcat: lambda self, e: self.func(
|
|
214
216
|
"GROUP_CONCAT", e.this, e.args.get("separator") or exp.Literal.string(",")
|
|
215
217
|
),
|
|
@@ -304,7 +304,6 @@ class DuckDB(Dialect):
|
|
|
304
304
|
"CHAR": TokenType.TEXT,
|
|
305
305
|
"DATETIME": TokenType.TIMESTAMPNTZ,
|
|
306
306
|
"DETACH": TokenType.DETACH,
|
|
307
|
-
"EXCLUDE": TokenType.EXCEPT,
|
|
308
307
|
"LOGICAL": TokenType.BOOLEAN,
|
|
309
308
|
"ONLY": TokenType.ONLY,
|
|
310
309
|
"PIVOT_WIDER": TokenType.PIVOT,
|
|
@@ -386,6 +385,8 @@ class DuckDB(Dialect):
|
|
|
386
385
|
"JSON_EXTRACT_PATH": parser.build_extract_json_with_path(exp.JSONExtract),
|
|
387
386
|
"JSON_EXTRACT_STRING": parser.build_extract_json_with_path(exp.JSONExtractScalar),
|
|
388
387
|
"LIST_CONTAINS": exp.ArrayContains.from_arg_list,
|
|
388
|
+
"LIST_COSINE_DISTANCE": exp.CosineDistance.from_arg_list,
|
|
389
|
+
"LIST_DISTANCE": exp.EuclideanDistance.from_arg_list,
|
|
389
390
|
"LIST_FILTER": exp.ArrayFilter.from_arg_list,
|
|
390
391
|
"LIST_HAS": exp.ArrayContains.from_arg_list,
|
|
391
392
|
"LIST_HAS_ANY": exp.ArrayOverlaps.from_arg_list,
|
|
@@ -650,6 +651,7 @@ class DuckDB(Dialect):
|
|
|
650
651
|
),
|
|
651
652
|
exp.BitwiseXor: rename_func("XOR"),
|
|
652
653
|
exp.CommentColumnConstraint: no_comment_column_constraint_sql,
|
|
654
|
+
exp.CosineDistance: rename_func("LIST_COSINE_DISTANCE"),
|
|
653
655
|
exp.CurrentDate: lambda *_: "CURRENT_DATE",
|
|
654
656
|
exp.CurrentTime: lambda *_: "CURRENT_TIME",
|
|
655
657
|
exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
|
|
@@ -673,6 +675,7 @@ class DuckDB(Dialect):
|
|
|
673
675
|
exp.DiToDate: lambda self,
|
|
674
676
|
e: f"CAST(STRPTIME(CAST({self.sql(e, 'this')} AS TEXT), {DuckDB.DATEINT_FORMAT}) AS DATE)",
|
|
675
677
|
exp.Encode: lambda self, e: encode_decode_sql(self, e, "ENCODE", replace=False),
|
|
678
|
+
exp.EuclideanDistance: rename_func("LIST_DISTANCE"),
|
|
676
679
|
exp.GenerateDateArray: _generate_datetime_array_sql,
|
|
677
680
|
exp.GenerateTimestampArray: _generate_datetime_array_sql,
|
|
678
681
|
exp.GroupConcat: lambda self, e: groupconcat_sql(self, e, within_group=False),
|
|
@@ -194,6 +194,16 @@ def _build_to_date(args: t.List) -> exp.TsOrDsToDate:
|
|
|
194
194
|
return expr
|
|
195
195
|
|
|
196
196
|
|
|
197
|
+
def _build_date_add(args: t.List) -> exp.TsOrDsAdd:
|
|
198
|
+
expression = seq_get(args, 1)
|
|
199
|
+
if expression:
|
|
200
|
+
expression = expression * -1
|
|
201
|
+
|
|
202
|
+
return exp.TsOrDsAdd(
|
|
203
|
+
this=seq_get(args, 0), expression=expression, unit=exp.Literal.string("DAY")
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
|
|
197
207
|
class Hive(Dialect):
|
|
198
208
|
ALIAS_POST_TABLESAMPLE = True
|
|
199
209
|
IDENTIFIERS_CAN_START_WITH_DIGIT = True
|
|
@@ -314,11 +324,7 @@ class Hive(Dialect):
|
|
|
314
324
|
seq_get(args, 1),
|
|
315
325
|
]
|
|
316
326
|
),
|
|
317
|
-
"DATE_SUB":
|
|
318
|
-
this=seq_get(args, 0),
|
|
319
|
-
expression=exp.Mul(this=seq_get(args, 1), expression=exp.Literal.number(-1)),
|
|
320
|
-
unit=exp.Literal.string("DAY"),
|
|
321
|
-
),
|
|
327
|
+
"DATE_SUB": _build_date_add,
|
|
322
328
|
"DATEDIFF": lambda args: exp.DateDiff(
|
|
323
329
|
this=exp.TsOrDsToDate(this=seq_get(args, 0)),
|
|
324
330
|
expression=exp.TsOrDsToDate(this=seq_get(args, 1)),
|
|
@@ -107,6 +107,7 @@ class Oracle(Dialect):
|
|
|
107
107
|
FUNCTIONS = {
|
|
108
108
|
**parser.Parser.FUNCTIONS,
|
|
109
109
|
"CONVERT": exp.ConvertToCharset.from_arg_list,
|
|
110
|
+
"L2_DISTANCE": exp.EuclideanDistance.from_arg_list,
|
|
110
111
|
"NVL": lambda args: build_coalesce(args, is_nvl=True),
|
|
111
112
|
"SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)),
|
|
112
113
|
"TO_CHAR": build_timetostr_or_tochar,
|
|
@@ -305,6 +306,7 @@ class Oracle(Dialect):
|
|
|
305
306
|
"TO_DATE", e.this, exp.Literal.string("YYYY-MM-DD")
|
|
306
307
|
),
|
|
307
308
|
exp.DateTrunc: lambda self, e: self.func("TRUNC", e.this, e.unit),
|
|
309
|
+
exp.EuclideanDistance: rename_func("L2_DISTANCE"),
|
|
308
310
|
exp.Group: transforms.preprocess([transforms.unalias_group]),
|
|
309
311
|
exp.ILike: no_ilike_sql,
|
|
310
312
|
exp.LogicalOr: rename_func("MAX"),
|