sqlglot 27.10.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.10.0 → sqlglot-27.12.0}/CHANGELOG.md +196 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/PKG-INFO +2 -2
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/_version.py +3 -3
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/bigquery.py +136 -15
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/clickhouse.py +4 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/databricks.py +1 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/doris.py +2 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/dremio.py +29 -4
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/duckdb.py +4 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/hive.py +11 -5
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/oracle.py +2 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/singlestore.py +216 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/snowflake.py +8 -4
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/spark.py +6 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/spark2.py +2 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/sqlite.py +1 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/expressions.py +200 -2
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/generator.py +26 -4
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify_columns.py +18 -3
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/parser.py +34 -10
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/tokens.py +5 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.egg-info/PKG-INFO +2 -2
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.egg-info/requires.txt +1 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/Cargo.lock +1 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/Cargo.toml +1 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/src/tokenizer.rs +1 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_bigquery.py +97 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_clickhouse.py +3 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_databricks.py +2 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_dialect.py +173 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_doris.py +2 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_dremio.py +27 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_duckdb.py +14 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_hive.py +3 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_mysql.py +1 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_oracle.py +11 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_singlestore.py +330 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_snowflake.py +46 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_spark.py +10 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/identity.sql +25 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/annotate_functions.sql +616 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_optimizer.py +33 -13
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_transpile.py +0 -1
- {sqlglot-27.10.0 → sqlglot-27.12.0}/.gitignore +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/.gitpod.yml +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/.pre-commit-config.yaml +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/CONTRIBUTING.md +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/LICENSE +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/MANIFEST.in +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/Makefile +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/README.md +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/pyproject.toml +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/setup.cfg +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/setup.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/__main__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/_typing.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/exasol.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/materialize.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/postgres.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/redshift.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/risingwave.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/diff.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/errors.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/executor/context.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/executor/env.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/executor/python.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/executor/table.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/helper.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/jsonpath.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/lineage.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_joins.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/scope.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/planner.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/py.typed +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/schema.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/serde.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/time.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/transforms.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot/trie.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglot.png +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/benches/dialect_settings.json +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/benches/long.rs +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/benches/token_type_settings.json +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/benches/tokenizer_settings.json +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/pyproject.toml +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/src/lib.rs +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/src/settings.rs +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/src/token.rs +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/sqlglotrs/src/trie.rs +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/__init__.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_athena.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_drill.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_druid.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_dune.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_exasol.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_postgres.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_presto.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_prql.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_trino.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_ctes.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_joins.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/partial.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/gen_fixtures.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/helpers.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_build.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_dialect_imports.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_diff.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_docs.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_executor.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_expressions.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_generator.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_helper.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_jsonpath.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_lineage.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_parser.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_schema.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_serde.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_time.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_tokens.py +0 -0
- {sqlglot-27.10.0 → sqlglot-27.12.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,200 @@
|
|
|
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
|
+
|
|
160
|
+
## [v27.10.0] - 2025-08-28
|
|
161
|
+
### :boom: BREAKING CHANGES
|
|
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))*:
|
|
163
|
+
|
|
164
|
+
annotate type for bq CONTAINS_SUBSTR (#5705)
|
|
165
|
+
|
|
166
|
+
- due to [`770888f`](https://github.com/tobymao/sqlglot/commit/770888f4e9a9061329e3c416f968f7dd9639fb81) - annotate type for bq NORMALIZE *(PR [#5711](https://github.com/tobymao/sqlglot/pull/5711) by [@geooo109](https://github.com/geooo109))*:
|
|
167
|
+
|
|
168
|
+
annotate type for bq NORMALIZE (#5711)
|
|
169
|
+
|
|
170
|
+
- due to [`506033f`](https://github.com/tobymao/sqlglot/commit/506033f299f7a4c28f6efd8bf715be5dcf73e929) - parse and annotate type for bq NORMALIZE_AND_CASEFOLD *(PR [#5712](https://github.com/tobymao/sqlglot/pull/5712) by [@geooo109](https://github.com/geooo109))*:
|
|
171
|
+
|
|
172
|
+
parse and annotate type for bq NORMALIZE_AND_CASEFOLD (#5712)
|
|
173
|
+
|
|
174
|
+
- due to [`848aea1`](https://github.com/tobymao/sqlglot/commit/848aea1dbaaeb580b633796dcca06c28314b9c3e) - parse and annotate type for bq OCTET_LENGTH *(PR [#5713](https://github.com/tobymao/sqlglot/pull/5713) by [@geooo109](https://github.com/geooo109))*:
|
|
175
|
+
|
|
176
|
+
parse and annotate type for bq OCTET_LENGTH (#5713)
|
|
177
|
+
|
|
178
|
+
- due to [`727bf83`](https://github.com/tobymao/sqlglot/commit/727bf8378f232188d35834d980b035552999ea3b) - add support for REVOKE DDL *(PR [#5703](https://github.com/tobymao/sqlglot/pull/5703) by [@newtonapple](https://github.com/newtonapple))*:
|
|
179
|
+
|
|
180
|
+
add support for REVOKE DDL (#5703)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### :sparkles: New Features
|
|
184
|
+
- [`f6f8f56`](https://github.com/tobymao/sqlglot/commit/f6f8f56a59d550dfc7dfcab0c3b9a6885c7e758a) - **singlestore**: Fixed parsing/generation of exp.JSONFormat *(PR [#5706](https://github.com/tobymao/sqlglot/pull/5706) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
185
|
+
- [`de2fe15`](https://github.com/tobymao/sqlglot/commit/de2fe1503b5bb003431d1f0c7b9ae87932a6cc1c) - **optimizer**: annotate type for bq CONTAINS_SUBSTR *(PR [#5705](https://github.com/tobymao/sqlglot/pull/5705) by [@geooo109](https://github.com/geooo109))*
|
|
186
|
+
- [`a78146e`](https://github.com/tobymao/sqlglot/commit/a78146e37bfc972050b4467c39769407061e9bc3) - **singlestore**: Fixed parsing/generation of exp.DateBin *(PR [#5709](https://github.com/tobymao/sqlglot/pull/5709) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
187
|
+
- [`ab0c985`](https://github.com/tobymao/sqlglot/commit/ab0c985424ae9d9340eafd15ecdc9b31bdd8837c) - **singlestore**: Marked exp.Reduce finish argument as unsupported *(PR [#5707](https://github.com/tobymao/sqlglot/pull/5707) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
188
|
+
- [`770888f`](https://github.com/tobymao/sqlglot/commit/770888f4e9a9061329e3c416f968f7dd9639fb81) - **optimizer**: annotate type for bq NORMALIZE *(PR [#5711](https://github.com/tobymao/sqlglot/pull/5711) by [@geooo109](https://github.com/geooo109))*
|
|
189
|
+
- [`506033f`](https://github.com/tobymao/sqlglot/commit/506033f299f7a4c28f6efd8bf715be5dcf73e929) - **optimizer**: parse and annotate type for bq NORMALIZE_AND_CASEFOLD *(PR [#5712](https://github.com/tobymao/sqlglot/pull/5712) by [@geooo109](https://github.com/geooo109))*
|
|
190
|
+
- [`848aea1`](https://github.com/tobymao/sqlglot/commit/848aea1dbaaeb580b633796dcca06c28314b9c3e) - **optimizer**: parse and annotate type for bq OCTET_LENGTH *(PR [#5713](https://github.com/tobymao/sqlglot/pull/5713) by [@geooo109](https://github.com/geooo109))*
|
|
191
|
+
- [`727bf83`](https://github.com/tobymao/sqlglot/commit/727bf8378f232188d35834d980b035552999ea3b) - add support for REVOKE DDL *(PR [#5703](https://github.com/tobymao/sqlglot/pull/5703) by [@newtonapple](https://github.com/newtonapple))*
|
|
192
|
+
|
|
193
|
+
### :bug: Bug Fixes
|
|
194
|
+
- [`0427c7b`](https://github.com/tobymao/sqlglot/commit/0427c7b7aa9f8161324085a98c5f531fa35c8b0c) - **optimizer**: qualify columns for AggFunc with DISTINCT *(PR [#5708](https://github.com/tobymao/sqlglot/pull/5708) by [@geooo109](https://github.com/geooo109))*
|
|
195
|
+
- :arrow_lower_right: *fixes issue [#5698](https://github.com/tobymao/sqlglot/issues/5698) opened by [@georgesittas](https://github.com/georgesittas)*
|
|
196
|
+
|
|
197
|
+
|
|
4
198
|
## [v27.9.0] - 2025-08-27
|
|
5
199
|
### :boom: BREAKING CHANGES
|
|
6
200
|
- due to [`7b180bd`](https://github.com/tobymao/sqlglot/commit/7b180bdc3da9e39946c22970bd2523f7d8beaf29) - raise if query modifier is specified multiple times *(PR [#5608](https://github.com/tobymao/sqlglot/pull/5608) by [@georgesittas](https://github.com/georgesittas))*:
|
|
@@ -6774,3 +6968,5 @@ Changelog
|
|
|
6774
6968
|
[v27.7.0]: https://github.com/tobymao/sqlglot/compare/v27.6.0...v27.7.0
|
|
6775
6969
|
[v27.8.0]: https://github.com/tobymao/sqlglot/compare/v27.7.0...v27.8.0
|
|
6776
6970
|
[v27.9.0]: https://github.com/tobymao/sqlglot/compare/v27.8.0...v27.9.0
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 27.
|
|
3
|
+
Version: 27.12.0
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -33,7 +33,7 @@ Requires-Dist: typing_extensions; extra == "dev"
|
|
|
33
33
|
Requires-Dist: maturin<2.0,>=1.4; extra == "dev"
|
|
34
34
|
Requires-Dist: pyperf; extra == "dev"
|
|
35
35
|
Provides-Extra: rs
|
|
36
|
-
Requires-Dist: sqlglotrs==0.6.
|
|
36
|
+
Requires-Dist: sqlglotrs==0.6.2; extra == "rs"
|
|
37
37
|
Dynamic: license-file
|
|
38
38
|
Dynamic: provides-extra
|
|
39
39
|
|
|
@@ -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'
|
|
@@ -4,6 +4,9 @@ import logging
|
|
|
4
4
|
import re
|
|
5
5
|
import typing as t
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
from sqlglot.optimizer.annotate_types import TypeAnnotator
|
|
9
|
+
|
|
7
10
|
from sqlglot import exp, generator, jsonpath, parser, tokens, transforms
|
|
8
11
|
from sqlglot._typing import E
|
|
9
12
|
from sqlglot.dialects.dialect import (
|
|
@@ -172,6 +175,18 @@ def _build_to_hex(args: t.List) -> exp.Hex | exp.MD5:
|
|
|
172
175
|
return exp.MD5(this=arg.this) if isinstance(arg, exp.MD5Digest) else exp.LowerHex(this=arg)
|
|
173
176
|
|
|
174
177
|
|
|
178
|
+
def _build_json_strip_nulls(args: t.List) -> exp.JSONStripNulls:
|
|
179
|
+
expression = exp.JSONStripNulls(this=seq_get(args, 0))
|
|
180
|
+
|
|
181
|
+
for arg in args[1:]:
|
|
182
|
+
if isinstance(arg, exp.Kwarg):
|
|
183
|
+
expression.set(arg.this.name.lower(), arg)
|
|
184
|
+
else:
|
|
185
|
+
expression.set("expression", arg)
|
|
186
|
+
|
|
187
|
+
return expression
|
|
188
|
+
|
|
189
|
+
|
|
175
190
|
def _array_contains_sql(self: BigQuery.Generator, expression: exp.ArrayContains) -> str:
|
|
176
191
|
return self.sql(
|
|
177
192
|
exp.Exists(
|
|
@@ -295,6 +310,23 @@ def _annotate_math_functions(self: TypeAnnotator, expression: E) -> E:
|
|
|
295
310
|
return expression
|
|
296
311
|
|
|
297
312
|
|
|
313
|
+
def _annotate_by_args_with_coerce(self: TypeAnnotator, expression: E) -> E:
|
|
314
|
+
"""
|
|
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
|
+
+------------+------------+------------+-------------+---------+
|
|
323
|
+
"""
|
|
324
|
+
self._annotate_args(expression)
|
|
325
|
+
|
|
326
|
+
self._set_type(expression, self._maybe_coerce(expression.this.type, expression.expression.type))
|
|
327
|
+
return expression
|
|
328
|
+
|
|
329
|
+
|
|
298
330
|
def _annotate_by_args_approx_top(self: TypeAnnotator, expression: exp.ApproxTopK) -> exp.ApproxTopK:
|
|
299
331
|
self._annotate_args(expression)
|
|
300
332
|
|
|
@@ -453,6 +485,14 @@ class BigQuery(Dialect):
|
|
|
453
485
|
# All set operations require either a DISTINCT or ALL specifier
|
|
454
486
|
SET_OP_DISTINCT_BY_DEFAULT = dict.fromkeys((exp.Except, exp.Intersect, exp.Union), None)
|
|
455
487
|
|
|
488
|
+
# https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions#percentile_cont
|
|
489
|
+
COERCES_TO = {
|
|
490
|
+
**TypeAnnotator.COERCES_TO,
|
|
491
|
+
exp.DataType.Type.BIGDECIMAL: {exp.DataType.Type.DOUBLE},
|
|
492
|
+
}
|
|
493
|
+
COERCES_TO[exp.DataType.Type.DECIMAL] |= {exp.DataType.Type.BIGDECIMAL}
|
|
494
|
+
COERCES_TO[exp.DataType.Type.BIGINT] |= {exp.DataType.Type.BIGDECIMAL}
|
|
495
|
+
|
|
456
496
|
# BigQuery maps Type.TIMESTAMP to DATETIME, so we need to amend the inferred types
|
|
457
497
|
TYPE_TO_EXPRESSIONS = {
|
|
458
498
|
**Dialect.TYPE_TO_EXPRESSIONS,
|
|
@@ -474,23 +514,47 @@ class BigQuery(Dialect):
|
|
|
474
514
|
**{
|
|
475
515
|
expr_type: lambda self, e: self._annotate_by_args(e, "this")
|
|
476
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,
|
|
477
527
|
exp.Left,
|
|
478
|
-
exp.Right,
|
|
479
528
|
exp.Lower,
|
|
480
|
-
exp.
|
|
529
|
+
exp.NthValue,
|
|
481
530
|
exp.Pad,
|
|
482
|
-
exp.
|
|
531
|
+
exp.PercentileDisc,
|
|
483
532
|
exp.RegexpExtract,
|
|
484
533
|
exp.RegexpReplace,
|
|
485
534
|
exp.Repeat,
|
|
535
|
+
exp.Replace,
|
|
536
|
+
exp.RespectNulls,
|
|
537
|
+
exp.Reverse,
|
|
538
|
+
exp.Right,
|
|
539
|
+
exp.SafeNegate,
|
|
540
|
+
exp.Sign,
|
|
486
541
|
exp.Substring,
|
|
542
|
+
exp.TimestampTrunc,
|
|
543
|
+
exp.Translate,
|
|
544
|
+
exp.Trim,
|
|
545
|
+
exp.Upper,
|
|
487
546
|
)
|
|
488
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),
|
|
489
555
|
exp.ApproxTopSum: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
490
556
|
exp.ApproxTopK: lambda self, e: _annotate_by_args_approx_top(self, e),
|
|
491
557
|
exp.ApproxQuantiles: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
492
|
-
exp.ArgMax: lambda self, e: self._annotate_by_args(e, "this"),
|
|
493
|
-
exp.ArgMin: lambda self, e: self._annotate_by_args(e, "this"),
|
|
494
558
|
exp.Array: _annotate_array,
|
|
495
559
|
exp.ArrayConcat: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
|
496
560
|
exp.Ascii: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
@@ -500,6 +564,7 @@ class BigQuery(Dialect):
|
|
|
500
564
|
exp.BitwiseCountAgg: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
501
565
|
exp.ByteLength: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
502
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),
|
|
503
568
|
exp.CodePointsToBytes: lambda self, e: self._annotate_with_type(
|
|
504
569
|
e, exp.DataType.Type.BINARY
|
|
505
570
|
),
|
|
@@ -509,59 +574,99 @@ class BigQuery(Dialect):
|
|
|
509
574
|
exp.Concat: _annotate_concat,
|
|
510
575
|
exp.Contains: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
511
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),
|
|
512
580
|
exp.CovarPop: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
513
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),
|
|
584
|
+
exp.CumeDist: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
514
585
|
exp.DateFromUnixDate: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATE),
|
|
515
|
-
exp.
|
|
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
|
+
),
|
|
516
590
|
exp.FarmFingerprint: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
517
591
|
exp.Unhex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
518
592
|
exp.Float64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
593
|
+
exp.Format: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
519
594
|
exp.GenerateTimestampArray: lambda self, e: self._annotate_with_type(
|
|
520
595
|
e, exp.DataType.build("ARRAY<TIMESTAMP>", dialect="bigquery")
|
|
521
596
|
),
|
|
522
597
|
exp.Grouping: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
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),
|
|
523
600
|
exp.JSONArray: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
601
|
+
exp.JSONArrayAppend: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
602
|
+
exp.JSONArrayInsert: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
524
603
|
exp.JSONBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
525
604
|
exp.JSONExtractScalar: lambda self, e: self._annotate_with_type(
|
|
526
605
|
e, exp.DataType.Type.VARCHAR
|
|
527
606
|
),
|
|
528
|
-
exp.
|
|
529
|
-
|
|
607
|
+
exp.JSONExtractArray: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
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
|
+
),
|
|
611
|
+
exp.JSONKeysAtDepth: lambda self, e: self._annotate_with_type(
|
|
612
|
+
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
530
613
|
),
|
|
614
|
+
exp.JSONObject: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
615
|
+
exp.JSONRemove: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
616
|
+
exp.JSONSet: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
617
|
+
exp.JSONStripNulls: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.JSON),
|
|
531
618
|
exp.JSONType: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
619
|
+
exp.JSONValueArray: lambda self, e: self._annotate_with_type(
|
|
620
|
+
e, exp.DataType.build("ARRAY<VARCHAR>", dialect="bigquery")
|
|
621
|
+
),
|
|
532
622
|
exp.Lag: lambda self, e: self._annotate_by_args(e, "this", "default"),
|
|
533
623
|
exp.LowerHex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
624
|
+
exp.LaxBool: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BOOLEAN),
|
|
625
|
+
exp.LaxFloat64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
626
|
+
exp.LaxInt64: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
627
|
+
exp.LaxString: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
534
628
|
exp.MD5Digest: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
535
629
|
exp.Normalize: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
630
|
+
exp.Ntile: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
536
631
|
exp.ParseTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
537
632
|
exp.ParseDatetime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DATETIME),
|
|
538
633
|
exp.ParseBignumeric: lambda self, e: self._annotate_with_type(
|
|
539
634
|
e, exp.DataType.Type.BIGDECIMAL
|
|
540
635
|
),
|
|
541
636
|
exp.ParseNumeric: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DECIMAL),
|
|
637
|
+
exp.PercentileCont: lambda self, e: _annotate_by_args_with_coerce(self, e),
|
|
638
|
+
exp.PercentRank: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.DOUBLE),
|
|
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),
|
|
542
641
|
exp.RegexpExtractAll: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
543
|
-
exp.
|
|
544
|
-
exp.
|
|
642
|
+
exp.RegexpInstr: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BIGINT),
|
|
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),
|
|
545
645
|
exp.SafeConvertBytesToString: lambda self, e: self._annotate_with_type(
|
|
546
646
|
e, exp.DataType.Type.VARCHAR
|
|
547
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),
|
|
548
653
|
exp.Soundex: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.VARCHAR),
|
|
549
654
|
exp.SHA: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
550
655
|
exp.SHA2: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.BINARY),
|
|
551
|
-
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),
|
|
552
658
|
exp.Split: lambda self, e: self._annotate_by_args(e, "this", array=True),
|
|
553
659
|
exp.TimestampFromParts: lambda self, e: self._annotate_with_type(
|
|
554
660
|
e, exp.DataType.Type.DATETIME
|
|
555
661
|
),
|
|
556
|
-
exp.TimestampTrunc: lambda self, e: self._annotate_by_args(e, "this"),
|
|
557
662
|
exp.TimeFromParts: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
558
663
|
exp.TimeTrunc: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
559
664
|
exp.ToCodePoints: lambda self, e: self._annotate_with_type(
|
|
560
665
|
e, exp.DataType.build("ARRAY<BIGINT>", dialect="bigquery")
|
|
561
666
|
),
|
|
562
667
|
exp.TsOrDsToTime: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.TIME),
|
|
563
|
-
exp.Translate: lambda self, e: self._annotate_by_args(e, "this"),
|
|
564
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),
|
|
565
670
|
}
|
|
566
671
|
|
|
567
672
|
def normalize_identifier(self, expression: E) -> E:
|
|
@@ -682,8 +787,11 @@ class BigQuery(Dialect):
|
|
|
682
787
|
"GENERATE_ARRAY": exp.GenerateSeries.from_arg_list,
|
|
683
788
|
"JSON_EXTRACT_SCALAR": _build_extract_json_with_default_path(exp.JSONExtractScalar),
|
|
684
789
|
"JSON_EXTRACT_ARRAY": _build_extract_json_with_default_path(exp.JSONExtractArray),
|
|
790
|
+
"JSON_EXTRACT_STRING_ARRAY": _build_extract_json_with_default_path(exp.JSONValueArray),
|
|
791
|
+
"JSON_KEYS": exp.JSONKeysAtDepth.from_arg_list,
|
|
685
792
|
"JSON_QUERY": parser.build_extract_json_with_path(exp.JSONExtract),
|
|
686
793
|
"JSON_QUERY_ARRAY": _build_extract_json_with_default_path(exp.JSONExtractArray),
|
|
794
|
+
"JSON_STRIP_NULLS": _build_json_strip_nulls,
|
|
687
795
|
"JSON_VALUE": _build_extract_json_with_default_path(exp.JSONExtractScalar),
|
|
688
796
|
"JSON_VALUE_ARRAY": _build_extract_json_with_default_path(exp.JSONValueArray),
|
|
689
797
|
"LENGTH": lambda args: exp.Length(this=seq_get(args, 0), binary=True),
|
|
@@ -730,6 +838,9 @@ class BigQuery(Dialect):
|
|
|
730
838
|
this=seq_get(args, 0), scale=exp.UnixToTime.MILLIS
|
|
731
839
|
),
|
|
732
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
|
+
),
|
|
733
844
|
"TO_JSON_STRING": exp.JSONFormat.from_arg_list,
|
|
734
845
|
"FORMAT_DATETIME": _build_format_time(exp.TsOrDsToDatetime),
|
|
735
846
|
"FORMAT_TIMESTAMP": _build_format_time(exp.TsOrDsToTimestamp),
|
|
@@ -798,9 +909,13 @@ class BigQuery(Dialect):
|
|
|
798
909
|
"SAFE_ORDINAL": (1, True),
|
|
799
910
|
}
|
|
800
911
|
|
|
801
|
-
def _parse_for_in(self) -> exp.ForIn:
|
|
912
|
+
def _parse_for_in(self) -> t.Union[exp.ForIn, exp.Command]:
|
|
913
|
+
index = self._index
|
|
802
914
|
this = self._parse_range()
|
|
803
915
|
self._match_text_seq("DO")
|
|
916
|
+
if self._match(TokenType.COMMAND):
|
|
917
|
+
self._retreat(index)
|
|
918
|
+
return self._parse_as_command(self._prev)
|
|
804
919
|
return self.expression(exp.ForIn, this=this, expression=self._parse_statement())
|
|
805
920
|
|
|
806
921
|
def _parse_table_part(self, schema: bool = False) -> t.Optional[exp.Expression]:
|
|
@@ -1196,7 +1311,13 @@ class BigQuery(Dialect):
|
|
|
1196
1311
|
exp.JSONExtract: _json_extract_sql,
|
|
1197
1312
|
exp.JSONExtractArray: _json_extract_sql,
|
|
1198
1313
|
exp.JSONExtractScalar: _json_extract_sql,
|
|
1199
|
-
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
|
+
),
|
|
1319
|
+
exp.JSONKeysAtDepth: rename_func("JSON_KEYS"),
|
|
1320
|
+
exp.JSONValueArray: rename_func("JSON_VALUE_ARRAY"),
|
|
1200
1321
|
exp.Levenshtein: _levenshtein_sql,
|
|
1201
1322
|
exp.Max: max_or_greatest,
|
|
1202
1323
|
exp.MD5: lambda self, e: self.func("TO_HEX", self.func("MD5", e.this)),
|
|
@@ -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
|
),
|