sqlglot 27.11.0__tar.gz → 27.13.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.13.0}/CHANGELOG.md +297 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/PKG-INFO +1 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/_version.py +3 -3
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/bigquery.py +80 -32
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/clickhouse.py +4 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/databricks.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/dialect.py +13 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/doris.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/dremio.py +4 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/duckdb.py +4 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/hive.py +11 -5
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/mysql.py +11 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/oracle.py +4 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/postgres.py +1 -2
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/singlestore.py +137 -2
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/snowflake.py +34 -4
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/spark.py +14 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/expressions.py +111 -7
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/generator.py +36 -4
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/qualify_columns.py +18 -3
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/parser.py +56 -22
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/tokens.py +5 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.egg-info/PKG-INFO +1 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_bigquery.py +118 -6
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_clickhouse.py +3 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_databricks.py +1 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_dialect.py +13 -68
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_doris.py +2 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_duckdb.py +2 -9
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_hive.py +3 -9
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_mysql.py +7 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_oracle.py +7 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_postgres.py +27 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_presto.py +26 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_redshift.py +7 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_singlestore.py +188 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_snowflake.py +55 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/identity.sql +21 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/annotate_functions.sql +390 -2
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_optimizer.py +33 -13
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_parser.py +1 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_transpile.py +0 -1
- {sqlglot-27.11.0 → sqlglot-27.13.0}/.gitignore +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/.gitpod.yml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/CONTRIBUTING.md +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/LICENSE +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/MANIFEST.in +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/Makefile +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/README.md +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/pyproject.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/setup.cfg +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/setup.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/__main__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/_typing.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/diff.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/errors.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/helper.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/lineage.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/planner.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/py.typed +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/schema.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/serde.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/time.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/transforms.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot/trie.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.egg-info/requires.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglot.png +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/Cargo.lock +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/Cargo.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/benches/dialect_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/benches/long.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/benches/token_type_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/pyproject.toml +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/src/lib.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/src/settings.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/src/token.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/src/tokenizer.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/sqlglotrs/src/trie.rs +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_spark.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/helpers.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_build.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_diff.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_docs.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_executor.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_expressions.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_generator.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_helper.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_lineage.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_schema.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_serde.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_time.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_tokens.py +0 -0
- {sqlglot-27.11.0 → sqlglot-27.13.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,301 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v27.12.0] - 2025-09-04
|
|
5
|
+
### :boom: BREAKING CHANGES
|
|
6
|
+
- due to [`1c551d5`](https://github.com/tobymao/sqlglot/commit/1c551d5ed3315e314013c1f063deabd9d8613e5d) - parse and annotate type for bq TO_JSON *(PR [#5768](https://github.com/tobymao/sqlglot/pull/5768) by [@geooo109](https://github.com/geooo109))*:
|
|
7
|
+
|
|
8
|
+
parse and annotate type for bq TO_JSON (#5768)
|
|
9
|
+
|
|
10
|
+
- due to [`1707f2d`](https://github.com/tobymao/sqlglot/commit/1707f2d7f9d3b58e8c216db638f8e572f9fe6f13) - annotate type for ABS *(PR [#5770](https://github.com/tobymao/sqlglot/pull/5770) by [@geooo109](https://github.com/geooo109))*:
|
|
11
|
+
|
|
12
|
+
annotate type for ABS (#5770)
|
|
13
|
+
|
|
14
|
+
- due to [`69acc51`](https://github.com/tobymao/sqlglot/commit/69acc5142b2d4f0b30832c350aa49f16d1adabef) - annotate type for bq IS_INF, IS_NAN *(PR [#5771](https://github.com/tobymao/sqlglot/pull/5771) by [@geooo109](https://github.com/geooo109))*:
|
|
15
|
+
|
|
16
|
+
annotate type for bq IS_INF, IS_NAN (#5771)
|
|
17
|
+
|
|
18
|
+
- due to [`0da2076`](https://github.com/tobymao/sqlglot/commit/0da207652331920416b29e2cc67bdc3c3f964466) - annotate type for bq CBRT *(PR [#5772](https://github.com/tobymao/sqlglot/pull/5772) by [@geooo109](https://github.com/geooo109))*:
|
|
19
|
+
|
|
20
|
+
annotate type for bq CBRT (#5772)
|
|
21
|
+
|
|
22
|
+
- due to [`a4968cb`](https://github.com/tobymao/sqlglot/commit/a4968cb5693670c1a2e9cd2c86404dd90fd76160) - annotate type for bq RAND *(PR [#5774](https://github.com/tobymao/sqlglot/pull/5774) by [@geooo109](https://github.com/geooo109))*:
|
|
23
|
+
|
|
24
|
+
annotate type for bq RAND (#5774)
|
|
25
|
+
|
|
26
|
+
- due to [`3e63350`](https://github.com/tobymao/sqlglot/commit/3e63350bd1d58b510cecd1a573d27be3fd2565ce) - parse and annotate type for bq ACOS *(PR [#5776](https://github.com/tobymao/sqlglot/pull/5776) by [@geooo109](https://github.com/geooo109))*:
|
|
27
|
+
|
|
28
|
+
parse and annotate type for bq ACOS (#5776)
|
|
29
|
+
|
|
30
|
+
- due to [`2be9d01`](https://github.com/tobymao/sqlglot/commit/2be9d01830c778186dc274c94c6db0dd6c4116d1) - parse and annotate type for bq ACOSH *(PR [#5779](https://github.com/tobymao/sqlglot/pull/5779) by [@geooo109](https://github.com/geooo109))*:
|
|
31
|
+
|
|
32
|
+
parse and annotate type for bq ACOSH (#5779)
|
|
33
|
+
|
|
34
|
+
- due to [`b77d3da`](https://github.com/tobymao/sqlglot/commit/b77d3da8f2548858d2b9d8590fcde83e1ec62b8a) - remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake *(PR [#5766](https://github.com/tobymao/sqlglot/pull/5766) by [@treysp](https://github.com/treysp))*:
|
|
35
|
+
|
|
36
|
+
remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake (#5766)
|
|
37
|
+
|
|
38
|
+
- due to [`7da2f31`](https://github.com/tobymao/sqlglot/commit/7da2f31d6613f16585e98c3fa1f592c617ae40c9) - parse and annotate type for bq ASIN/H *(PR [#5783](https://github.com/tobymao/sqlglot/pull/5783) by [@geooo109](https://github.com/geooo109))*:
|
|
39
|
+
|
|
40
|
+
parse and annotate type for bq ASIN/H (#5783)
|
|
41
|
+
|
|
42
|
+
- due to [`341ea83`](https://github.com/tobymao/sqlglot/commit/341ea83a07c707fdbf565b8d9ef4b9b6341ed1d5) - parse and annotate type for bq ATAN/H/2 *(PR [#5784](https://github.com/tobymao/sqlglot/pull/5784) by [@geooo109](https://github.com/geooo109))*:
|
|
43
|
+
|
|
44
|
+
parse and annotate type for bq ATAN/H/2 (#5784)
|
|
45
|
+
|
|
46
|
+
- due to [`aa360cb`](https://github.com/tobymao/sqlglot/commit/aa360cb0e204aa056557ff8b15aa2d4f678430e6) - use regexp_like as it exists *(PR [#5781](https://github.com/tobymao/sqlglot/pull/5781) by [@jasonthomassql](https://github.com/jasonthomassql))*:
|
|
47
|
+
|
|
48
|
+
use regexp_like as it exists (#5781)
|
|
49
|
+
|
|
50
|
+
- due to [`c2a1ad4`](https://github.com/tobymao/sqlglot/commit/c2a1ad4050771401a5b26bcadd90060e4527fbff) - parse and annotate type for bq COT/H *(PR [#5786](https://github.com/tobymao/sqlglot/pull/5786) by [@geooo109](https://github.com/geooo109))*:
|
|
51
|
+
|
|
52
|
+
parse and annotate type for bq COT/H (#5786)
|
|
53
|
+
|
|
54
|
+
- due to [`316ae91`](https://github.com/tobymao/sqlglot/commit/316ae913d8b1a63f3071ebb1b826328108d74cef) - Added handling of UTC_DATE and exp.CurrentDate *(PR [#5785](https://github.com/tobymao/sqlglot/pull/5785) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*:
|
|
55
|
+
|
|
56
|
+
Added handling of UTC_DATE and exp.CurrentDate (#5785)
|
|
57
|
+
|
|
58
|
+
- due to [`2c6d237`](https://github.com/tobymao/sqlglot/commit/2c6d23742ea9fcc2b9c784315d3d5364e360fea5) - parse and annotate type for bq CSC/H *(PR [#5787](https://github.com/tobymao/sqlglot/pull/5787) by [@geooo109](https://github.com/geooo109))*:
|
|
59
|
+
|
|
60
|
+
parse and annotate type for bq CSC/H (#5787)
|
|
61
|
+
|
|
62
|
+
- due to [`8a35076`](https://github.com/tobymao/sqlglot/commit/8a350763c2337f6910a5f0e19af387ba488fcb70) - parse and annotate type for bq SEC/H *(PR [#5788](https://github.com/tobymao/sqlglot/pull/5788) by [@geooo109](https://github.com/geooo109))*:
|
|
63
|
+
|
|
64
|
+
parse and annotate type for bq SEC/H (#5788)
|
|
65
|
+
|
|
66
|
+
- due to [`79901cb`](https://github.com/tobymao/sqlglot/commit/79901cb506737ae1932fa44a705858d2597ee587) - parse and annotate type for bq SIN\H *(PR [#5790](https://github.com/tobymao/sqlglot/pull/5790) by [@geooo109](https://github.com/geooo109))*:
|
|
67
|
+
|
|
68
|
+
parse and annotate type for bq SIN\H (#5790)
|
|
69
|
+
|
|
70
|
+
- due to [`74fb547`](https://github.com/tobymao/sqlglot/commit/74fb5476def1b389da425885db56bd6592fd7f78) - parse and annotate type for bq RANGE_BUCKET *(PR [#5793](https://github.com/tobymao/sqlglot/pull/5793) by [@geooo109](https://github.com/geooo109))*:
|
|
71
|
+
|
|
72
|
+
parse and annotate type for bq RANGE_BUCKET (#5793)
|
|
73
|
+
|
|
74
|
+
- due to [`eca65e8`](https://github.com/tobymao/sqlglot/commit/eca65e8b79f65850b014a4cb7913ba4a5861dbe9) - parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE *(PR [#5792](https://github.com/tobymao/sqlglot/pull/5792) by [@geooo109](https://github.com/geooo109))*:
|
|
75
|
+
|
|
76
|
+
parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE (#5792)
|
|
77
|
+
|
|
78
|
+
- due to [`a180d3f`](https://github.com/tobymao/sqlglot/commit/a180d3f2f9f3938611027269028c03274aa1889c) - parse and annotate type for bq SAFE math funcs *(PR [#5797](https://github.com/tobymao/sqlglot/pull/5797) by [@geooo109](https://github.com/geooo109))*:
|
|
79
|
+
|
|
80
|
+
parse and annotate type for bq SAFE math funcs (#5797)
|
|
81
|
+
|
|
82
|
+
- due to [`fc7ad7a`](https://github.com/tobymao/sqlglot/commit/fc7ad7a4d953424b56542eacfe1835f5789921c7) - parse ALTER SESSION *(PR [#5734](https://github.com/tobymao/sqlglot/pull/5734) by [@tekumara](https://github.com/tekumara))*:
|
|
83
|
+
|
|
84
|
+
parse ALTER SESSION (#5734)
|
|
85
|
+
|
|
86
|
+
- due to [`8ec1a6c`](https://github.com/tobymao/sqlglot/commit/8ec1a6cf5a8edc2d834c713ce0fd8d87237f11ed) - annotate type for bq STRING_AGG *(PR [#5798](https://github.com/tobymao/sqlglot/pull/5798) by [@geooo109](https://github.com/geooo109))*:
|
|
87
|
+
|
|
88
|
+
annotate type for bq STRING_AGG (#5798)
|
|
89
|
+
|
|
90
|
+
- due to [`dd97bfa`](https://github.com/tobymao/sqlglot/commit/dd97bfa1dc2f86b727c55b06b3c54b18c02e360d) - annotate type for bq DATETIME_TRUNC *(PR [#5799](https://github.com/tobymao/sqlglot/pull/5799) by [@geooo109](https://github.com/geooo109))*:
|
|
91
|
+
|
|
92
|
+
annotate type for bq DATETIME_TRUNC (#5799)
|
|
93
|
+
|
|
94
|
+
- due to [`d3e9dda`](https://github.com/tobymao/sqlglot/commit/d3e9dda183695dd1e4a9832a6671bccc6db561a0) - annotate type for bq GENERATE_UUID *(commit by [@geooo109](https://github.com/geooo109))*:
|
|
95
|
+
|
|
96
|
+
annotate type for bq GENERATE_UUID
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### :sparkles: New Features
|
|
100
|
+
- [`1c551d5`](https://github.com/tobymao/sqlglot/commit/1c551d5ed3315e314013c1f063deabd9d8613e5d) - **optimizer**: parse and annotate type for bq TO_JSON *(PR [#5768](https://github.com/tobymao/sqlglot/pull/5768) by [@geooo109](https://github.com/geooo109))*
|
|
101
|
+
- [`a024d48`](https://github.com/tobymao/sqlglot/commit/a024d48fedd049796329050a1f51822dd1388695) - **singlestore**: Added generation of exp.TsOrDsDiff *(PR [#5769](https://github.com/tobymao/sqlglot/pull/5769) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
102
|
+
- [`1707f2d`](https://github.com/tobymao/sqlglot/commit/1707f2d7f9d3b58e8c216db638f8e572f9fe6f13) - **optimizer**: annotate type for ABS *(PR [#5770](https://github.com/tobymao/sqlglot/pull/5770) by [@geooo109](https://github.com/geooo109))*
|
|
103
|
+
- [`69acc51`](https://github.com/tobymao/sqlglot/commit/69acc5142b2d4f0b30832c350aa49f16d1adabef) - **optimizer**: annotate type for bq IS_INF, IS_NAN *(PR [#5771](https://github.com/tobymao/sqlglot/pull/5771) by [@geooo109](https://github.com/geooo109))*
|
|
104
|
+
- [`0da2076`](https://github.com/tobymao/sqlglot/commit/0da207652331920416b29e2cc67bdc3c3f964466) - **optimizer**: annotate type for bq CBRT *(PR [#5772](https://github.com/tobymao/sqlglot/pull/5772) by [@geooo109](https://github.com/geooo109))*
|
|
105
|
+
- [`a4968cb`](https://github.com/tobymao/sqlglot/commit/a4968cb5693670c1a2e9cd2c86404dd90fd76160) - **optimizer**: annotate type for bq RAND *(PR [#5774](https://github.com/tobymao/sqlglot/pull/5774) by [@geooo109](https://github.com/geooo109))*
|
|
106
|
+
- [`dd7781a`](https://github.com/tobymao/sqlglot/commit/dd7781a15b842a5826714958ed7af9024903cd1e) - **singlestore**: Fixed generation of exp.Collate *(PR [#5775](https://github.com/tobymao/sqlglot/pull/5775) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
107
|
+
- [`fb684cb`](https://github.com/tobymao/sqlglot/commit/fb684cbdb6178ddc441f598cc1a6e914291cd00e) - **singelstore**: Fixed generation of exp.RegexpILike *(PR [#5777](https://github.com/tobymao/sqlglot/pull/5777) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
108
|
+
- [`3e63350`](https://github.com/tobymao/sqlglot/commit/3e63350bd1d58b510cecd1a573d27be3fd2565ce) - **optimizer**: parse and annotate type for bq ACOS *(PR [#5776](https://github.com/tobymao/sqlglot/pull/5776) by [@geooo109](https://github.com/geooo109))*
|
|
109
|
+
- [`8705a78`](https://github.com/tobymao/sqlglot/commit/8705a787df034b4cecb4ba95e9599772c5561ba9) - **singlestore**: Fixed generation of exp.CastToStrType *(PR [#5778](https://github.com/tobymao/sqlglot/pull/5778) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
110
|
+
- [`e3c35ad`](https://github.com/tobymao/sqlglot/commit/e3c35ade797f46549cc803e1acd8816041713a10) - **singlestore**: Fixed generation of exp.UnicodeString *(PR [#5773](https://github.com/tobymao/sqlglot/pull/5773) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
111
|
+
- [`2be9d01`](https://github.com/tobymao/sqlglot/commit/2be9d01830c778186dc274c94c6db0dd6c4116d1) - **optimizer**: parse and annotate type for bq ACOSH *(PR [#5779](https://github.com/tobymao/sqlglot/pull/5779) by [@geooo109](https://github.com/geooo109))*
|
|
112
|
+
- [`7da2f31`](https://github.com/tobymao/sqlglot/commit/7da2f31d6613f16585e98c3fa1f592c617ae40c9) - **optimizer**: parse and annotate type for bq ASIN/H *(PR [#5783](https://github.com/tobymao/sqlglot/pull/5783) by [@geooo109](https://github.com/geooo109))*
|
|
113
|
+
- [`341ea83`](https://github.com/tobymao/sqlglot/commit/341ea83a07c707fdbf565b8d9ef4b9b6341ed1d5) - **optimizer**: parse and annotate type for bq ATAN/H/2 *(PR [#5784](https://github.com/tobymao/sqlglot/pull/5784) by [@geooo109](https://github.com/geooo109))*
|
|
114
|
+
- [`be54a45`](https://github.com/tobymao/sqlglot/commit/be54a458413ce3be6c321e5f4feb3e5df5ee6d08) - **singlestore**: Implemented generation of exp.Cbrt *(PR [#5782](https://github.com/tobymao/sqlglot/pull/5782) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
115
|
+
- [`aa360cb`](https://github.com/tobymao/sqlglot/commit/aa360cb0e204aa056557ff8b15aa2d4f678430e6) - **databricks**: use regexp_like as it exists *(PR [#5781](https://github.com/tobymao/sqlglot/pull/5781) by [@jasonthomassql](https://github.com/jasonthomassql))*
|
|
116
|
+
- [`c2a1ad4`](https://github.com/tobymao/sqlglot/commit/c2a1ad4050771401a5b26bcadd90060e4527fbff) - **optimizer**: parse and annotate type for bq COT/H *(PR [#5786](https://github.com/tobymao/sqlglot/pull/5786) by [@geooo109](https://github.com/geooo109))*
|
|
117
|
+
- [`316ae91`](https://github.com/tobymao/sqlglot/commit/316ae913d8b1a63f3071ebb1b826328108d74cef) - **singlestore**: Added handling of UTC_DATE and exp.CurrentDate *(PR [#5785](https://github.com/tobymao/sqlglot/pull/5785) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
118
|
+
- [`2c6d237`](https://github.com/tobymao/sqlglot/commit/2c6d23742ea9fcc2b9c784315d3d5364e360fea5) - **optimizer**: parse and annotate type for bq CSC/H *(PR [#5787](https://github.com/tobymao/sqlglot/pull/5787) by [@geooo109](https://github.com/geooo109))*
|
|
119
|
+
- [`8a35076`](https://github.com/tobymao/sqlglot/commit/8a350763c2337f6910a5f0e19af387ba488fcb70) - **optimizer**: parse and annotate type for bq SEC/H *(PR [#5788](https://github.com/tobymao/sqlglot/pull/5788) by [@geooo109](https://github.com/geooo109))*
|
|
120
|
+
- [`566bfb2`](https://github.com/tobymao/sqlglot/commit/566bfb2a64a64b74da63b3a89d68caf702ab6522) - **singlestore**: Added support of UTC_TIME and CURRENT_TIME *(PR [#5789](https://github.com/tobymao/sqlglot/pull/5789) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
121
|
+
- [`79901cb`](https://github.com/tobymao/sqlglot/commit/79901cb506737ae1932fa44a705858d2597ee587) - **optimizer**: parse and annotate type for bq SIN\H *(PR [#5790](https://github.com/tobymao/sqlglot/pull/5790) by [@geooo109](https://github.com/geooo109))*
|
|
122
|
+
- [`74fb547`](https://github.com/tobymao/sqlglot/commit/74fb5476def1b389da425885db56bd6592fd7f78) - **optimizer**: parse and annotate type for bq RANGE_BUCKET *(PR [#5793](https://github.com/tobymao/sqlglot/pull/5793) by [@geooo109](https://github.com/geooo109))*
|
|
123
|
+
- [`eca65e8`](https://github.com/tobymao/sqlglot/commit/eca65e8b79f65850b014a4cb7913ba4a5861dbe9) - **optimizer**: parse and annotate type for bq COSINE/EUCLIDEAN_DISTANCE *(PR [#5792](https://github.com/tobymao/sqlglot/pull/5792) by [@geooo109](https://github.com/geooo109))*
|
|
124
|
+
- [`a180d3f`](https://github.com/tobymao/sqlglot/commit/a180d3f2f9f3938611027269028c03274aa1889c) - **optimizer**: parse and annotate type for bq SAFE math funcs *(PR [#5797](https://github.com/tobymao/sqlglot/pull/5797) by [@geooo109](https://github.com/geooo109))*
|
|
125
|
+
- [`fc7ad7a`](https://github.com/tobymao/sqlglot/commit/fc7ad7a4d953424b56542eacfe1835f5789921c7) - **snowflake**: parse ALTER SESSION *(PR [#5734](https://github.com/tobymao/sqlglot/pull/5734) by [@tekumara](https://github.com/tekumara))*
|
|
126
|
+
- [`8ec1a6c`](https://github.com/tobymao/sqlglot/commit/8ec1a6cf5a8edc2d834c713ce0fd8d87237f11ed) - **optimizer**: annotate type for bq STRING_AGG *(PR [#5798](https://github.com/tobymao/sqlglot/pull/5798) by [@geooo109](https://github.com/geooo109))*
|
|
127
|
+
- [`dd97bfa`](https://github.com/tobymao/sqlglot/commit/dd97bfa1dc2f86b727c55b06b3c54b18c02e360d) - **optimizer**: annotate type for bq DATETIME_TRUNC *(PR [#5799](https://github.com/tobymao/sqlglot/pull/5799) by [@geooo109](https://github.com/geooo109))*
|
|
128
|
+
- [`d3e9dda`](https://github.com/tobymao/sqlglot/commit/d3e9dda183695dd1e4a9832a6671bccc6db561a0) - **optimizer**: annotate type for bq GENERATE_UUID *(commit by [@geooo109](https://github.com/geooo109))*
|
|
129
|
+
|
|
130
|
+
### :bug: Bug Fixes
|
|
131
|
+
- [`d8f6a37`](https://github.com/tobymao/sqlglot/commit/d8f6a376ba1fcca48e4a65923dd7a319ce6cfb91) - **optimizer**: allow aliased negative integer literal as group by column *(PR [#5791](https://github.com/tobymao/sqlglot/pull/5791) by [@treysp](https://github.com/treysp))*
|
|
132
|
+
- [`1259576`](https://github.com/tobymao/sqlglot/commit/1259576283f1d45abb70ec40c60e500214a27b6f) - **hive**: DATE_SUB to DATE_ADD use parens if needed *(PR [#5796](https://github.com/tobymao/sqlglot/pull/5796) by [@geooo109](https://github.com/geooo109))*
|
|
133
|
+
- :arrow_lower_right: *fixes issue [#5794](https://github.com/tobymao/sqlglot/issues/5794) opened by [@mingelchan](https://github.com/mingelchan)*
|
|
134
|
+
- [`b0516b4`](https://github.com/tobymao/sqlglot/commit/b0516b4bc9cf2bba2cb57e6bb79ff09b5e2244e3) - **optimizer**: Do not qualify columns if a projection coflicts with a source *(PR [#5780](https://github.com/tobymao/sqlglot/pull/5780) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
135
|
+
- :arrow_lower_right: *fixes issue [#5262](https://github.com/TobikoData/sqlmesh/issues/5262) opened by [@mChlopek](https://github.com/mChlopek)*
|
|
136
|
+
- [`8af0d40`](https://github.com/tobymao/sqlglot/commit/8af0d40055450f71b7e36e576f4a9a1104bc02b2) - **parser**: address edge case where `values` is used as an identifier *(PR [#5801](https://github.com/tobymao/sqlglot/pull/5801) by [@georgesittas](https://github.com/georgesittas))*
|
|
137
|
+
|
|
138
|
+
### :wrench: Chores
|
|
139
|
+
- [`b77d3da`](https://github.com/tobymao/sqlglot/commit/b77d3da8f2548858d2b9d8590fcde83e1ec62b8a) - remove `"EXCLUDE" -> TokenType.EXCEPT` in DuckDB, Snowflake *(PR [#5766](https://github.com/tobymao/sqlglot/pull/5766) by [@treysp](https://github.com/treysp))*
|
|
140
|
+
- [`005564a`](https://github.com/tobymao/sqlglot/commit/005564ab28cb14be469f09e89b01275d6e25874e) - **snowflake**: refactor logic related to ALTER SESSION *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
## [v27.11.0] - 2025-09-03
|
|
144
|
+
### :boom: BREAKING CHANGES
|
|
145
|
+
- 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))*:
|
|
146
|
+
|
|
147
|
+
parse and annotate type for bq REGEXP_INSTR (#5710)
|
|
148
|
+
|
|
149
|
+
- 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))*:
|
|
150
|
+
|
|
151
|
+
annotate type for bq ROW_NUMBER (#5716)
|
|
152
|
+
|
|
153
|
+
- 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))*:
|
|
154
|
+
|
|
155
|
+
annotate type for bq FIRST_VALUE (#5718)
|
|
156
|
+
|
|
157
|
+
- 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))*:
|
|
158
|
+
|
|
159
|
+
annotate type for bq PERCENTILE_DISC (#5722)
|
|
160
|
+
|
|
161
|
+
- 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))*:
|
|
162
|
+
|
|
163
|
+
annotate type for bq NTH_VALUE (#5720)
|
|
164
|
+
|
|
165
|
+
- 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))*:
|
|
166
|
+
|
|
167
|
+
annotate type for bq LEAD (#5719)
|
|
168
|
+
|
|
169
|
+
- 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))*:
|
|
170
|
+
|
|
171
|
+
annotate type for bq PERNCENTILE_CONT (#5729)
|
|
172
|
+
|
|
173
|
+
- 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))*:
|
|
174
|
+
|
|
175
|
+
parse and annotate type for bq FORMAT (#5715)
|
|
176
|
+
|
|
177
|
+
- 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))*:
|
|
178
|
+
|
|
179
|
+
parse and annotate type for bq CUME_DIST (#5735)
|
|
180
|
+
|
|
181
|
+
- 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))*:
|
|
182
|
+
|
|
183
|
+
parse and annotate type for bq DENSE_RANK (#5736)
|
|
184
|
+
|
|
185
|
+
- 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))*:
|
|
186
|
+
|
|
187
|
+
parse and annotate type for bq RANK (#5738)
|
|
188
|
+
|
|
189
|
+
- 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))*:
|
|
190
|
+
|
|
191
|
+
parse and annotate type for bq PERCENT_RANK (#5739)
|
|
192
|
+
|
|
193
|
+
- 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))*:
|
|
194
|
+
|
|
195
|
+
annotate type for bq JSON_OBJECT (#5740)
|
|
196
|
+
|
|
197
|
+
- 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))*:
|
|
198
|
+
|
|
199
|
+
annotate type for bq JSON_QUERY/JSON_QUERY_ARRAY (#5741)
|
|
200
|
+
|
|
201
|
+
- due to [`4753642`](https://github.com/tobymao/sqlglot/commit/4753642cfcfb1f192ec4d21a492737b27affef09) - annotate type for bq JSON_EXTRACT_SCALAR *(commit by [@geooo109](https://github.com/geooo109))*:
|
|
202
|
+
|
|
203
|
+
annotate type for bq JSON_EXTRACT_SCALAR
|
|
204
|
+
|
|
205
|
+
- 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))*:
|
|
206
|
+
|
|
207
|
+
parse and annotate type for bq JSON_ARRAY_APPEND (#5747)
|
|
208
|
+
|
|
209
|
+
- 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))*:
|
|
210
|
+
|
|
211
|
+
parse and annotate type for bq JSON_ARRAY_INSERT (#5748)
|
|
212
|
+
|
|
213
|
+
- 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))*:
|
|
214
|
+
|
|
215
|
+
parse and annotate type for bq JSON_KEYS (#5749)
|
|
216
|
+
|
|
217
|
+
- 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))*:
|
|
218
|
+
|
|
219
|
+
parse and annotate type for bq JSON_REMOVE (#5750)
|
|
220
|
+
|
|
221
|
+
- 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))*:
|
|
222
|
+
|
|
223
|
+
parse and annotate type for bq JSON_SET (#5751)
|
|
224
|
+
|
|
225
|
+
- 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))*:
|
|
226
|
+
|
|
227
|
+
parse and annotate type for bq JSON_STRIP_NULLS (#5753)
|
|
228
|
+
|
|
229
|
+
- 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))*:
|
|
230
|
+
|
|
231
|
+
parse and annotate type for bq JSON_EXTRACT_STRING_ARRAY (#5758)
|
|
232
|
+
|
|
233
|
+
- 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))*:
|
|
234
|
+
|
|
235
|
+
parse and annotate type for bq JSON LAX funcs (#5760)
|
|
236
|
+
|
|
237
|
+
- 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))*:
|
|
238
|
+
|
|
239
|
+
annotate type for bq TO_JSON_STRING (#5762)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
### :sparkles: New Features
|
|
243
|
+
- [`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))*
|
|
244
|
+
- [`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))*
|
|
245
|
+
- [`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))*
|
|
246
|
+
- [`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))*
|
|
247
|
+
- [`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))*
|
|
248
|
+
- [`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))*
|
|
249
|
+
- [`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))*
|
|
250
|
+
- [`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))*
|
|
251
|
+
- [`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))*
|
|
252
|
+
- [`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))*
|
|
253
|
+
- [`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))*
|
|
254
|
+
- [`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))*
|
|
255
|
+
- [`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))*
|
|
256
|
+
- [`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))*
|
|
257
|
+
- [`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))*
|
|
258
|
+
- [`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))*
|
|
259
|
+
- [`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))*
|
|
260
|
+
- [`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))*
|
|
261
|
+
- [`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))*
|
|
262
|
+
- [`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))*
|
|
263
|
+
- [`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))*
|
|
264
|
+
- [`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))*
|
|
265
|
+
- [`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))*
|
|
266
|
+
- [`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))*
|
|
267
|
+
- [`4753642`](https://github.com/tobymao/sqlglot/commit/4753642cfcfb1f192ec4d21a492737b27affef09) - **optimizer**: annotate type for bq JSON_EXTRACT_SCALAR *(commit by [@geooo109](https://github.com/geooo109))*
|
|
268
|
+
- [`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))*
|
|
269
|
+
- [`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))*
|
|
270
|
+
- [`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))*
|
|
271
|
+
- [`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))*
|
|
272
|
+
- [`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))*
|
|
273
|
+
- [`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))*
|
|
274
|
+
- [`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))*
|
|
275
|
+
- [`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))*
|
|
276
|
+
- [`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))*
|
|
277
|
+
- [`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))*
|
|
278
|
+
- [`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))*
|
|
279
|
+
- [`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))*
|
|
280
|
+
- [`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))*
|
|
281
|
+
- [`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))*
|
|
282
|
+
- [`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))*
|
|
283
|
+
- [`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))*
|
|
284
|
+
- [`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))*
|
|
285
|
+
- [`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))*
|
|
286
|
+
|
|
287
|
+
### :bug: Bug Fixes
|
|
288
|
+
- [`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))*
|
|
289
|
+
- [`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))*
|
|
290
|
+
- [`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))*
|
|
291
|
+
- :arrow_lower_right: *fixes issue [#5761](https://github.com/tobymao/sqlglot/issues/5761) opened by [@paulolieuthier](https://github.com/paulolieuthier)*
|
|
292
|
+
- [`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))*
|
|
293
|
+
- [`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))*
|
|
294
|
+
|
|
295
|
+
### :wrench: Chores
|
|
296
|
+
- [`41521e3`](https://github.com/tobymao/sqlglot/commit/41521e31b465acd51ab02b1ac4e5512b98175b7e) - bump sqlglotrs to 0.6.2 *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
297
|
+
|
|
298
|
+
|
|
4
299
|
## [v27.10.0] - 2025-08-28
|
|
5
300
|
### :boom: BREAKING CHANGES
|
|
6
301
|
- 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 +7108,5 @@ Changelog
|
|
|
6813
7108
|
[v27.8.0]: https://github.com/tobymao/sqlglot/compare/v27.7.0...v27.8.0
|
|
6814
7109
|
[v27.9.0]: https://github.com/tobymao/sqlglot/compare/v27.8.0...v27.9.0
|
|
6815
7110
|
[v27.10.0]: https://github.com/tobymao/sqlglot/compare/v27.9.0...v27.10.0
|
|
7111
|
+
[v27.11.0]: https://github.com/tobymao/sqlglot/compare/v27.10.0...v27.11.0
|
|
7112
|
+
[v27.12.0]: https://github.com/tobymao/sqlglot/compare/v27.11.0...v27.12.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.13.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (27, 13, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g5f39a83f1'
|
|
@@ -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
|
),
|
|
@@ -547,16 +572,21 @@ class BigQuery(Dialect):
|
|
|
547
572
|
e, exp.DataType.Type.VARCHAR
|
|
548
573
|
),
|
|
549
574
|
exp.Concat: _annotate_concat,
|
|
550
|
-
exp.Contains: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
551
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),
|
|
552
579
|
exp.CovarPop: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
553
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),
|
|
554
583
|
exp.CumeDist: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
555
584
|
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
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
|
+
),
|
|
558
589
|
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
590
|
exp.Unhex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
561
591
|
exp.Float64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
562
592
|
exp.Format: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
@@ -564,7 +594,8 @@ class BigQuery(Dialect):
|
|
|
564
594
|
e, exp.DataType.build("ARRAY<TIMESTAMP>", dialect="bigquery")
|
|
565
595
|
),
|
|
566
596
|
exp.Grouping: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
567
|
-
exp.
|
|
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),
|
|
568
599
|
exp.JSONArray: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
569
600
|
exp.JSONArrayAppend: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
570
601
|
exp.JSONArrayInsert: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
@@ -572,9 +603,10 @@ class BigQuery(Dialect):
|
|
|
572
603
|
exp.JSONExtractScalar: lambda self, e: self._annotate_with_type(
|
|
573
604
|
e, exp.DataType.Type.VARCHAR
|
|
574
605
|
),
|
|
575
|
-
exp.JSONExtract: lambda self, e: self._annotate_by_args(e, "this"),
|
|
576
606
|
exp.JSONExtractArray: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
577
|
-
exp.JSONFormat: lambda self, e: self._annotate_with_type(
|
|
607
|
+
exp.JSONFormat: lambda self, e: self._annotate_with_type(
|
|
608
|
+
e, exp.DataType.Type.JSON if e.args.get("to_json") else exp.DataType.Type.VARCHAR
|
|
609
|
+
),
|
|
578
610
|
exp.JSONKeysAtDepth: lambda self, e: self._annotate_with_type(
|
|
579
611
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
580
612
|
),
|
|
@@ -587,7 +619,6 @@ class BigQuery(Dialect):
|
|
|
587
619
|
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
588
620
|
),
|
|
589
621
|
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
622
|
exp.LowerHex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
592
623
|
exp.LaxBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
593
624
|
exp.LaxFloat64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
@@ -595,7 +626,6 @@ class BigQuery(Dialect):
|
|
|
595
626
|
exp.LaxString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
596
627
|
exp.MD5Digest: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
597
628
|
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
629
|
exp.Ntile: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
600
630
|
exp.ParseTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
601
631
|
exp.ParseDatetime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATETIME),
|
|
@@ -603,36 +633,39 @@ class BigQuery(Dialect):
|
|
|
603
633
|
e, exp.DataType.Type.BIGDECIMAL
|
|
604
634
|
),
|
|
605
635
|
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"),
|
|
636
|
+
exp.PercentileCont: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
608
637
|
exp.PercentRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
609
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),
|
|
610
640
|
exp.RegexpExtractAll: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
611
641
|
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
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),
|
|
616
644
|
exp.SafeConvertBytesToString: lambda self, e: self._annotate_with_type(
|
|
617
645
|
e, exp.DataType.Type.VARCHAR
|
|
618
646
|
),
|
|
647
|
+
exp.SafeAdd: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
648
|
+
exp.SafeMultiply: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
649
|
+
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),
|
|
619
652
|
exp.Soundex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
620
653
|
exp.SHA: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
621
654
|
exp.SHA2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
622
|
-
exp.
|
|
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),
|
|
623
657
|
exp.Split: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
624
658
|
exp.TimestampFromParts: lambda self, e: self._annotate_with_type(
|
|
625
659
|
e, exp.DataType.Type.DATETIME
|
|
626
660
|
),
|
|
627
|
-
exp.TimestampTrunc: lambda self, e: self._annotate_by_args(e, "this"),
|
|
628
661
|
exp.TimeFromParts: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
629
662
|
exp.TimeTrunc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
630
663
|
exp.ToCodePoints: lambda self, e: self._annotate_with_type(
|
|
631
664
|
e, exp.DataType.build("ARRAY<BIGINT>", dialect="bigquery")
|
|
632
665
|
),
|
|
633
666
|
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
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),
|
|
636
669
|
}
|
|
637
670
|
|
|
638
671
|
def normalize_identifier(self, expression: E) -> E:
|
|
@@ -734,6 +767,10 @@ class BigQuery(Dialect):
|
|
|
734
767
|
FUNCTIONS = {
|
|
735
768
|
**parser.Parser.FUNCTIONS,
|
|
736
769
|
"APPROX_TOP_COUNT": exp.ApproxTopK.from_arg_list,
|
|
770
|
+
"BIT_AND": exp.BitwiseAndAgg.from_arg_list,
|
|
771
|
+
"BIT_OR": exp.BitwiseOrAgg.from_arg_list,
|
|
772
|
+
"BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
|
|
773
|
+
"BIT_COUNT": exp.BitwiseCountAgg.from_arg_list,
|
|
737
774
|
"BOOL": exp.JSONBool.from_arg_list,
|
|
738
775
|
"CONTAINS_SUBSTR": _build_contains_substring,
|
|
739
776
|
"DATE": _build_date,
|
|
@@ -804,6 +841,9 @@ class BigQuery(Dialect):
|
|
|
804
841
|
this=seq_get(args, 0), scale=exp.UnixToTime.MILLIS
|
|
805
842
|
),
|
|
806
843
|
"TIMESTAMP_SECONDS": lambda args: exp.UnixToTime(this=seq_get(args, 0)),
|
|
844
|
+
"TO_JSON": lambda args: exp.JSONFormat(
|
|
845
|
+
this=seq_get(args, 0), options=seq_get(args, 1), to_json=True
|
|
846
|
+
),
|
|
807
847
|
"TO_JSON_STRING": exp.JSONFormat.from_arg_list,
|
|
808
848
|
"FORMAT_DATETIME": _build_format_time(exp.TsOrDsToDatetime),
|
|
809
849
|
"FORMAT_TIMESTAMP": _build_format_time(exp.TsOrDsToTimestamp),
|
|
@@ -1236,6 +1276,10 @@ class BigQuery(Dialect):
|
|
|
1236
1276
|
exp.ArrayContains: _array_contains_sql,
|
|
1237
1277
|
exp.ArrayFilter: filter_array_using_unnest,
|
|
1238
1278
|
exp.ArrayRemove: filter_array_using_unnest,
|
|
1279
|
+
exp.BitwiseAndAgg: rename_func("BIT_AND"),
|
|
1280
|
+
exp.BitwiseOrAgg: rename_func("BIT_OR"),
|
|
1281
|
+
exp.BitwiseXorAgg: rename_func("BIT_XOR"),
|
|
1282
|
+
exp.BitwiseCountAgg: rename_func("BIT_COUNT"),
|
|
1239
1283
|
exp.ByteLength: rename_func("BYTE_LENGTH"),
|
|
1240
1284
|
exp.Cast: transforms.preprocess([transforms.remove_precision_parameterized_types]),
|
|
1241
1285
|
exp.CollateProperty: lambda self, e: (
|
|
@@ -1274,7 +1318,11 @@ class BigQuery(Dialect):
|
|
|
1274
1318
|
exp.JSONExtract: _json_extract_sql,
|
|
1275
1319
|
exp.JSONExtractArray: _json_extract_sql,
|
|
1276
1320
|
exp.JSONExtractScalar: _json_extract_sql,
|
|
1277
|
-
exp.JSONFormat:
|
|
1321
|
+
exp.JSONFormat: lambda self, e: self.func(
|
|
1322
|
+
"TO_JSON" if e.args.get("to_json") else "TO_JSON_STRING",
|
|
1323
|
+
e.this,
|
|
1324
|
+
e.args.get("options"),
|
|
1325
|
+
),
|
|
1278
1326
|
exp.JSONKeysAtDepth: rename_func("JSON_KEYS"),
|
|
1279
1327
|
exp.JSONValueArray: rename_func("JSON_VALUE_ARRAY"),
|
|
1280
1328
|
exp.Levenshtein: _levenshtein_sql,
|