sqlglot 27.4.1__tar.gz → 27.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlglot-27.4.1 → sqlglot-27.6.1}/CHANGELOG.md +47 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/LICENSE +1 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/PKG-INFO +1 -24
- {sqlglot-27.4.1 → sqlglot-27.6.1}/pyproject.toml +4 -5
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/__init__.py +1 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/_version.py +16 -3
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/bigquery.py +3 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/duckdb.py +1 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/exasol.py +103 -4
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/materialize.py +1 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/oracle.py +0 -4
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/postgres.py +0 -2
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/redshift.py +1 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/risingwave.py +1 -0
- sqlglot-27.6.1/sqlglot/dialects/singlestore.py +1168 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/snowflake.py +2 -8
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/expressions.py +32 -11
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/generator.py +51 -10
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/eliminate_joins.py +3 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/qualify_columns.py +40 -25
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/scope.py +6 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/parser.py +30 -9
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/tokens.py +5 -2
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/transforms.py +1 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.egg-info/PKG-INFO +1 -24
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_dialect.py +69 -12
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_exasol.py +86 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_mysql.py +4 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_oracle.py +13 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_postgres.py +6 -0
- sqlglot-27.6.1/tests/dialects/test_singlestore.py +75 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_snowflake.py +31 -6
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/identity.sql +2 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/eliminate_ctes.sql +28 -1
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/eliminate_joins.sql +19 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/qualify_columns.sql +19 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_optimizer.py +14 -0
- sqlglot-27.4.1/sqlglot/dialects/singlestore.py +0 -5
- sqlglot-27.4.1/tests/dialects/test_singlestore.py +0 -20
- {sqlglot-27.4.1 → sqlglot-27.6.1}/.gitignore +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/.gitpod.yml +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/.pre-commit-config.yaml +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/CONTRIBUTING.md +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/MANIFEST.in +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/Makefile +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/README.md +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/setup.cfg +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/setup.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/__main__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/_typing.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/__init__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/athena.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/clickhouse.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/databricks.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/dialect.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/doris.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/dremio.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/drill.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/druid.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/dune.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/fabric.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/hive.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/mysql.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/presto.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/prql.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/spark.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/spark2.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/sqlite.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/starrocks.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/tableau.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/teradata.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/trino.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/dialects/tsql.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/diff.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/errors.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/executor/__init__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/executor/context.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/executor/env.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/executor/python.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/executor/table.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/helper.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/jsonpath.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/lineage.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/__init__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/annotate_types.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/canonicalize.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/eliminate_ctes.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/eliminate_subqueries.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/isolate_table_selects.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/merge_subqueries.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/normalize.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/normalize_identifiers.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/optimize_joins.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/optimizer.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/pushdown_predicates.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/pushdown_projections.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/qualify.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/qualify_tables.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/simplify.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/optimizer/unnest_subqueries.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/planner.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/py.typed +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/schema.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/serde.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/time.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot/trie.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.egg-info/SOURCES.txt +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.egg-info/dependency_links.txt +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.egg-info/requires.txt +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.egg-info/top_level.txt +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglot.png +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/Cargo.lock +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/Cargo.toml +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/benches/dialect_settings.json +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/benches/long.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/benches/token_type_settings.json +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/benches/tokenizer_dialect_settings.json +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/benches/tokenizer_settings.json +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/pyproject.toml +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/src/lib.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/src/settings.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/src/token.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/src/tokenizer.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/sqlglotrs/src/trie.rs +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/__init__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/__init__.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_athena.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_bigquery.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_clickhouse.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_databricks.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_doris.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_dremio.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_drill.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_druid.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_duckdb.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_dune.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_fabric.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_hive.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_materialize.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_pipe_syntax.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_presto.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_prql.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_redshift.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_risingwave.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_spark.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_sqlite.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_starrocks.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_tableau.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_teradata.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_trino.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/dialects/test_tsql.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/jsonpath/LICENSE +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/jsonpath/cts.json +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/annotate_functions.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/annotate_types.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/canonicalize.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/eliminate_subqueries.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/isolate_table_selects.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/merge_subqueries.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/normalize.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/normalize_identifiers.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/optimize_joins.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/optimizer.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/pushdown_cte_alias_columns.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/pushdown_predicates.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/pushdown_projections.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/qualify_columns__invalid.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/qualify_columns__with_invisible.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/qualify_columns_ddl.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/qualify_tables.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/quote_identifiers.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/simplify.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/call_center.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/catalog_page.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/catalog_returns.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/catalog_sales.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/customer.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/customer_address.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/customer_demographics.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/date_dim.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/household_demographics.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/income_band.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/inventory.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/item.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/promotion.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/reason.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/ship_mode.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/store.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/store_returns.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/store_sales.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/time_dim.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/tpc-ds.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/warehouse.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/web_page.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/web_returns.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/web_sales.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-ds/web_site.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/customer.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/lineitem.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/nation.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/orders.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/part.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/partsupp.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/region.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/supplier.csv.gz +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/tpc-h/tpc-h.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/optimizer/unnest_subqueries.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/partial.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/fixtures/pretty.sql +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/gen_fixtures.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/helpers.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_build.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_dialect_imports.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_diff.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_docs.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_executor.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_expressions.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_generator.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_helper.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_jsonpath.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_lineage.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_parser.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_schema.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_serde.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_time.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_tokens.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_transforms.py +0 -0
- {sqlglot-27.4.1 → sqlglot-27.6.1}/tests/test_transpile.py +0 -0
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v27.5.1] - 2025-07-30
|
|
5
|
+
### :bug: Bug Fixes
|
|
6
|
+
- [`caf71d6`](https://github.com/tobymao/sqlglot/commit/caf71d687c0048d2346fddaee58b519e4f2e7945) - `between` builder should not set `symmetric` by default *(commit by [@georgesittas](https://github.com/georgesittas))*
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [v27.5.0] - 2025-07-30
|
|
10
|
+
### :boom: BREAKING CHANGES
|
|
11
|
+
- due to [`002286e`](https://github.com/tobymao/sqlglot/commit/002286ee05a608e303a2238a9a74ab963709b5da) - remove AM/PM entries from postgres, oracle `TIME_MAPPING` *(PR [#5491](https://github.com/tobymao/sqlglot/pull/5491) by [@georgesittas](https://github.com/georgesittas))*:
|
|
12
|
+
|
|
13
|
+
remove AM/PM entries from postgres, oracle `TIME_MAPPING` (#5491)
|
|
14
|
+
|
|
15
|
+
- due to [`ad78db6`](https://github.com/tobymao/sqlglot/commit/ad78db6c9002a5bf9188d66f0080dfefd070f77b) - Refactor `LIKE ANY` and support `ALL | SOME` quantifiers *(PR [#5493](https://github.com/tobymao/sqlglot/pull/5493) by [@VaggelisD](https://github.com/VaggelisD))*:
|
|
16
|
+
|
|
17
|
+
Refactor `LIKE ANY` and support `ALL | SOME` quantifiers (#5493)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### :sparkles: New Features
|
|
21
|
+
- [`8cdd9e8`](https://github.com/tobymao/sqlglot/commit/8cdd9e8715b4cf67c200c723940743ed69bbfd80) - **mysql**: Parse UNIQUE INDEX constraint similar to UNIQUE KEY *(PR [#5489](https://github.com/tobymao/sqlglot/pull/5489) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
22
|
+
- :arrow_lower_right: *addresses issue [#5479](https://github.com/tobymao/sqlglot/issues/5479) opened by [@nathanchapman](https://github.com/nathanchapman)*
|
|
23
|
+
- [`787d167`](https://github.com/tobymao/sqlglot/commit/787d167d694b557d6e43ed391f59847a888fa572) - **exasol**: add support for REGEXP_SUBSTR in exasol dialect *(PR [#5487](https://github.com/tobymao/sqlglot/pull/5487) by [@nnamdi16](https://github.com/nnamdi16))*
|
|
24
|
+
- [`0963f60`](https://github.com/tobymao/sqlglot/commit/0963f60987c267c64f2fcfbde469b8b28911a14b) - **singlestore**: Fixed time formatting *(PR [#5476](https://github.com/tobymao/sqlglot/pull/5476) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
25
|
+
- [`488d2e4`](https://github.com/tobymao/sqlglot/commit/488d2e4bf9d4eb148356d1fd6c2360bbf77f283c) - **singlestore**: Added RESERVED_KEYWORDS *(PR [#5497](https://github.com/tobymao/sqlglot/pull/5497) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
26
|
+
- [`fad9992`](https://github.com/tobymao/sqlglot/commit/fad9992a00478a964552f72802b95ca3918c4377) - **exasol**: Add support for TRUNC, TRUNCATE and DATE_TRUNC function… *(PR [#5490](https://github.com/tobymao/sqlglot/pull/5490) by [@nnamdi16](https://github.com/nnamdi16))*
|
|
27
|
+
- [`ad78db6`](https://github.com/tobymao/sqlglot/commit/ad78db6c9002a5bf9188d66f0080dfefd070f77b) - Refactor `LIKE ANY` and support `ALL | SOME` quantifiers *(PR [#5493](https://github.com/tobymao/sqlglot/pull/5493) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
28
|
+
- :arrow_lower_right: *addresses issue [#5484](https://github.com/tobymao/sqlglot/issues/5484) opened by [@mazum21](https://github.com/mazum21)*
|
|
29
|
+
- [`a7a6f16`](https://github.com/tobymao/sqlglot/commit/a7a6f167d30ac19383ad15931c26751c66a61976) - **singlestore**: Added Tokenizer *(PR [#5492](https://github.com/tobymao/sqlglot/pull/5492) by [@AdalbertMemSQL](https://github.com/AdalbertMemSQL))*
|
|
30
|
+
|
|
31
|
+
### :bug: Bug Fixes
|
|
32
|
+
- [`3982653`](https://github.com/tobymao/sqlglot/commit/3982653e62a42ca1be2bdd8722119e27bd1ba680) - Do not consume BUCKET/TRUNCATE as partitioning keywords *(PR [#5488](https://github.com/tobymao/sqlglot/pull/5488) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
33
|
+
- :arrow_lower_right: *fixes issue [#5485](https://github.com/tobymao/sqlglot/issues/5485) opened by [@chenkovsky](https://github.com/chenkovsky)*
|
|
34
|
+
- [`002286e`](https://github.com/tobymao/sqlglot/commit/002286ee05a608e303a2238a9a74ab963709b5da) - remove AM/PM entries from postgres, oracle `TIME_MAPPING` *(PR [#5491](https://github.com/tobymao/sqlglot/pull/5491) by [@georgesittas](https://github.com/georgesittas))*
|
|
35
|
+
- [`74f278a`](https://github.com/tobymao/sqlglot/commit/74f278a226058e196270042e2a9664b9acded28a) - **optimizer**: Fix SEMI/ANTI join handling in optimizer rules *(PR [#5498](https://github.com/tobymao/sqlglot/pull/5498) by [@VaggelisD](https://github.com/VaggelisD))*
|
|
36
|
+
- :arrow_lower_right: *fixes issue [#5481](https://github.com/tobymao/sqlglot/issues/5481) opened by [@themattmorris](https://github.com/themattmorris)*
|
|
37
|
+
- [`42633fb`](https://github.com/tobymao/sqlglot/commit/42633fb49b3c04eeea42e061e33ee08e61960cb4) - dont print (A)SYMMETRIC keyword in BETWEEN for postgres subclasses *(PR [#5503](https://github.com/tobymao/sqlglot/pull/5503) by [@georgesittas](https://github.com/georgesittas))*
|
|
38
|
+
|
|
39
|
+
### :wrench: Chores
|
|
40
|
+
- [`18b7d0f`](https://github.com/tobymao/sqlglot/commit/18b7d0fe19708d88b224770d844a8f6a74fe2aa7) - fix deprecated 'license' specification format *(PR [#5494](https://github.com/tobymao/sqlglot/pull/5494) by [@loonies](https://github.com/loonies))*
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## [v27.4.1] - 2025-07-27
|
|
44
|
+
### :bug: Bug Fixes
|
|
45
|
+
- [`ba2b3e2`](https://github.com/tobymao/sqlglot/commit/ba2b3e21ca5454402808b68697ea4eb62963d341) - **bigquery**: make exp.Array type inference more robust *(PR [#5483](https://github.com/tobymao/sqlglot/pull/5483) by [@georgesittas](https://github.com/georgesittas))*
|
|
46
|
+
|
|
47
|
+
|
|
4
48
|
## [v27.4.0] - 2025-07-25
|
|
5
49
|
### :boom: BREAKING CHANGES
|
|
6
50
|
- due to [`4f348bd`](https://github.com/tobymao/sqlglot/commit/4f348bddda21b18841fd2d728fe486e95cdaa549) - store Query schemas in meta dict instead of type attr *(PR [#5480](https://github.com/tobymao/sqlglot/pull/5480) by [@georgesittas](https://github.com/georgesittas))*:
|
|
@@ -6332,3 +6376,6 @@ Changelog
|
|
|
6332
6376
|
[v27.3.0]: https://github.com/tobymao/sqlglot/compare/v27.0.1...v27.3.0
|
|
6333
6377
|
[v27.3.1]: https://github.com/tobymao/sqlglot/compare/v27.3.0...v27.3.1
|
|
6334
6378
|
[v27.4.0]: https://github.com/tobymao/sqlglot/compare/v27.3.1...v27.4.0
|
|
6379
|
+
[v27.4.1]: https://github.com/tobymao/sqlglot/compare/v27.4.0...v27.4.1
|
|
6380
|
+
[v27.5.0]: https://github.com/tobymao/sqlglot/compare/v27.4.1...v27.5.0
|
|
6381
|
+
[v27.5.1]: https://github.com/tobymao/sqlglot/compare/v27.5.0...v27.5.1
|
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlglot
|
|
3
|
-
Version: 27.
|
|
3
|
+
Version: 27.6.1
|
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
|
6
|
-
License: MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2023 Toby Mao
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
27
|
-
|
|
28
6
|
Project-URL: Homepage, https://sqlglot.com/
|
|
29
7
|
Project-URL: Documentation, https://sqlglot.com/sqlglot.html
|
|
30
8
|
Project-URL: Repository, https://github.com/tobymao/sqlglot
|
|
@@ -32,7 +10,6 @@ Project-URL: Issues, https://github.com/tobymao/sqlglot/issues
|
|
|
32
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
33
11
|
Classifier: Intended Audience :: Developers
|
|
34
12
|
Classifier: Intended Audience :: Science/Research
|
|
35
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
36
13
|
Classifier: Operating System :: OS Independent
|
|
37
14
|
Classifier: Programming Language :: SQL
|
|
38
15
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -4,13 +4,12 @@ dynamic = ["version", "optional-dependencies"]
|
|
|
4
4
|
description = "An easily customizable SQL parser and transpiler"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Toby Mao", email = "toby.mao@gmail.com" }]
|
|
7
|
-
license =
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
8
|
requires-python = ">= 3.9"
|
|
9
|
-
classifiers=[
|
|
9
|
+
classifiers = [
|
|
10
10
|
"Development Status :: 5 - Production/Stable",
|
|
11
11
|
"Intended Audience :: Developers",
|
|
12
12
|
"Intended Audience :: Science/Research",
|
|
13
|
-
"License :: OSI Approved :: MIT License",
|
|
14
13
|
"Operating System :: OS Independent",
|
|
15
14
|
"Programming Language :: SQL",
|
|
16
15
|
"Programming Language :: Python :: 3 :: Only",
|
|
@@ -35,7 +34,7 @@ fallback_version = "0.0.0"
|
|
|
35
34
|
local_scheme = "no-local-version"
|
|
36
35
|
|
|
37
36
|
[tool.setuptools.packages.find]
|
|
38
|
-
include=["sqlglot", "sqlglot.*"]
|
|
37
|
+
include = ["sqlglot", "sqlglot.*"]
|
|
39
38
|
|
|
40
39
|
[tool.setuptools.package-data]
|
|
41
|
-
"*" = ["py.typed"]
|
|
40
|
+
"*" = ["py.typed"]
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '27.
|
|
21
|
-
__version_tuple__ = version_tuple = (27,
|
|
31
|
+
__version__ = version = '27.6.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (27, 6, 1)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'ga3623b406'
|
|
@@ -434,7 +434,9 @@ class BigQuery(Dialect):
|
|
|
434
434
|
|
|
435
435
|
# The _PARTITIONTIME and _PARTITIONDATE pseudo-columns are not returned by a SELECT * statement
|
|
436
436
|
# https://cloud.google.com/bigquery/docs/querying-partitioned-tables#query_an_ingestion-time_partitioned_table
|
|
437
|
-
|
|
437
|
+
# https://cloud.google.com/bigquery/docs/querying-wildcard-tables#scanning_a_range_of_tables_using_table_suffix
|
|
438
|
+
# https://cloud.google.com/bigquery/docs/query-cloud-storage-data#query_the_file_name_pseudo-column
|
|
439
|
+
PSEUDOCOLUMNS = {"_PARTITIONTIME", "_PARTITIONDATE", "_TABLE_SUFFIX", "_FILE_NAME"}
|
|
438
440
|
|
|
439
441
|
# All set operations require either a DISTINCT or ALL specifier
|
|
440
442
|
SET_OP_DISTINCT_BY_DEFAULT = dict.fromkeys((exp.Except, exp.Intersect, exp.Union), None)
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import typing as t
|
|
4
|
+
|
|
2
5
|
from sqlglot import exp, generator, parser, tokens
|
|
3
6
|
from sqlglot.dialects.dialect import (
|
|
4
7
|
Dialect,
|
|
5
|
-
rename_func,
|
|
6
8
|
binary_from_function,
|
|
7
9
|
build_formatted_time,
|
|
8
|
-
|
|
10
|
+
rename_func,
|
|
9
11
|
strposition_sql,
|
|
12
|
+
timestrtotime_sql,
|
|
13
|
+
unit_to_str,
|
|
14
|
+
timestamptrunc_sql,
|
|
15
|
+
build_date_delta,
|
|
10
16
|
)
|
|
11
|
-
from sqlglot.helper import seq_get
|
|
12
17
|
from sqlglot.generator import unsupported_args
|
|
18
|
+
from sqlglot.helper import seq_get
|
|
13
19
|
from sqlglot.tokens import TokenType
|
|
14
20
|
|
|
21
|
+
if t.TYPE_CHECKING:
|
|
22
|
+
from sqlglot.dialects.dialect import DialectType
|
|
23
|
+
|
|
15
24
|
|
|
16
25
|
def _sha2_sql(self: Exasol.Generator, expression: exp.SHA2) -> str:
|
|
17
26
|
length = expression.text("length")
|
|
@@ -19,6 +28,37 @@ def _sha2_sql(self: Exasol.Generator, expression: exp.SHA2) -> str:
|
|
|
19
28
|
return self.func(func_name, expression.this)
|
|
20
29
|
|
|
21
30
|
|
|
31
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/trunc%5Bate%5D%20(datetime).htm
|
|
32
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/trunc%5Bate%5D%20(number).htm
|
|
33
|
+
def _build_trunc(args: t.List[exp.Expression], dialect: DialectType) -> exp.Expression:
|
|
34
|
+
first, second = seq_get(args, 0), seq_get(args, 1)
|
|
35
|
+
|
|
36
|
+
if not first or not second:
|
|
37
|
+
return exp.Anonymous(this="TRUNC", expressions=args)
|
|
38
|
+
|
|
39
|
+
if not first.type:
|
|
40
|
+
from sqlglot.optimizer.annotate_types import annotate_types
|
|
41
|
+
|
|
42
|
+
first = annotate_types(first, dialect=dialect)
|
|
43
|
+
|
|
44
|
+
if first.is_type(exp.DataType.Type.DATE, exp.DataType.Type.TIMESTAMP) and second.is_string:
|
|
45
|
+
return exp.DateTrunc(this=first, unit=second)
|
|
46
|
+
|
|
47
|
+
return exp.Anonymous(this="TRUNC", expressions=args)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/zeroifnull.htm
|
|
51
|
+
def _build_zeroifnull(args: t.List) -> exp.If:
|
|
52
|
+
cond = exp.Is(this=seq_get(args, 0), expression=exp.Null())
|
|
53
|
+
return exp.If(this=cond, true=exp.Literal.number(0), false=seq_get(args, 0))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/nullifzero.htm
|
|
57
|
+
def _build_nullifzero(args: t.List) -> exp.If:
|
|
58
|
+
cond = exp.EQ(this=seq_get(args, 0), expression=exp.Literal.number(0))
|
|
59
|
+
return exp.If(this=cond, true=exp.Null(), false=seq_get(args, 0))
|
|
60
|
+
|
|
61
|
+
|
|
22
62
|
class Exasol(Dialect):
|
|
23
63
|
TIME_MAPPING = {
|
|
24
64
|
"yyyy": "%Y",
|
|
@@ -52,23 +92,45 @@ class Exasol(Dialect):
|
|
|
52
92
|
KEYWORDS = {
|
|
53
93
|
**tokens.Tokenizer.KEYWORDS,
|
|
54
94
|
"USER": TokenType.CURRENT_USER,
|
|
95
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/if.htm
|
|
96
|
+
"ENDIF": TokenType.END,
|
|
97
|
+
"LONG VARCHAR": TokenType.TEXT,
|
|
55
98
|
}
|
|
56
99
|
|
|
57
100
|
class Parser(parser.Parser):
|
|
58
101
|
FUNCTIONS = {
|
|
59
102
|
**parser.Parser.FUNCTIONS,
|
|
103
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_days.htm
|
|
104
|
+
"ADD_DAYS": build_date_delta(exp.DateAdd, default_unit="DAY"),
|
|
105
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_years.htm
|
|
106
|
+
"ADD_YEARS": build_date_delta(exp.DateAdd, default_unit="YEAR"),
|
|
107
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_months.htm
|
|
108
|
+
"ADD_MONTHS": build_date_delta(exp.DateAdd, default_unit="MONTH"),
|
|
109
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_weeks.htm
|
|
110
|
+
"ADD_WEEKS": build_date_delta(exp.DateAdd, default_unit="WEEK"),
|
|
111
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_hour.htm
|
|
112
|
+
"ADD_HOURS": build_date_delta(exp.DateAdd, default_unit="HOUR"),
|
|
113
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_minutes.htm
|
|
114
|
+
"ADD_MINUTES": build_date_delta(exp.DateAdd, default_unit="MINUTE"),
|
|
115
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/add_seconds.htm
|
|
116
|
+
"ADD_SECONDS": build_date_delta(exp.DateAdd, default_unit="SECOND"),
|
|
60
117
|
"BIT_AND": binary_from_function(exp.BitwiseAnd),
|
|
61
118
|
"BIT_OR": binary_from_function(exp.BitwiseOr),
|
|
62
119
|
"BIT_XOR": binary_from_function(exp.BitwiseXor),
|
|
63
120
|
"BIT_NOT": lambda args: exp.BitwiseNot(this=seq_get(args, 0)),
|
|
64
121
|
"BIT_LSHIFT": binary_from_function(exp.BitwiseLeftShift),
|
|
65
122
|
"BIT_RSHIFT": binary_from_function(exp.BitwiseRightShift),
|
|
123
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/date_trunc.htm#DATE_TRUNC
|
|
124
|
+
"DATE_TRUNC": lambda args: exp.TimestampTrunc(
|
|
125
|
+
this=seq_get(args, 1), unit=seq_get(args, 0)
|
|
126
|
+
),
|
|
66
127
|
"EVERY": lambda args: exp.All(this=seq_get(args, 0)),
|
|
67
128
|
"EDIT_DISTANCE": exp.Levenshtein.from_arg_list,
|
|
68
129
|
"HASH_SHA": exp.SHA.from_arg_list,
|
|
69
130
|
"HASH_SHA1": exp.SHA.from_arg_list,
|
|
70
131
|
"HASH_MD5": exp.MD5.from_arg_list,
|
|
71
132
|
"HASHTYPE_MD5": exp.MD5Digest.from_arg_list,
|
|
133
|
+
"REGEXP_SUBSTR": exp.RegexpExtract.from_arg_list,
|
|
72
134
|
"REGEXP_REPLACE": lambda args: exp.RegexpReplace(
|
|
73
135
|
this=seq_get(args, 0),
|
|
74
136
|
expression=seq_get(args, 1),
|
|
@@ -82,6 +144,8 @@ class Exasol(Dialect):
|
|
|
82
144
|
"HASH_SHA512": lambda args: exp.SHA2(
|
|
83
145
|
this=seq_get(args, 0), length=exp.Literal.number(512)
|
|
84
146
|
),
|
|
147
|
+
"TRUNC": _build_trunc,
|
|
148
|
+
"TRUNCATE": _build_trunc,
|
|
85
149
|
"VAR_POP": exp.VariancePop.from_arg_list,
|
|
86
150
|
"APPROXIMATE_COUNT_DISTINCT": exp.ApproxDistinct.from_arg_list,
|
|
87
151
|
"TO_CHAR": build_formatted_time(exp.ToChar, "exasol"),
|
|
@@ -93,6 +157,8 @@ class Exasol(Dialect):
|
|
|
93
157
|
timestamp=seq_get(args, 0),
|
|
94
158
|
options=seq_get(args, 3),
|
|
95
159
|
),
|
|
160
|
+
"NULLIFZERO": _build_nullifzero,
|
|
161
|
+
"ZEROIFNULL": _build_zeroifnull,
|
|
96
162
|
}
|
|
97
163
|
CONSTRAINT_PARSERS = {
|
|
98
164
|
**parser.Parser.CONSTRAINT_PARSERS,
|
|
@@ -112,7 +178,8 @@ class Exasol(Dialect):
|
|
|
112
178
|
exp.DataType.Type.MEDIUMTEXT: "VARCHAR",
|
|
113
179
|
exp.DataType.Type.TINYBLOB: "VARCHAR",
|
|
114
180
|
exp.DataType.Type.TINYTEXT: "VARCHAR",
|
|
115
|
-
|
|
181
|
+
# https://docs.exasol.com/db/latest/sql_references/data_types/datatypealiases.htm
|
|
182
|
+
exp.DataType.Type.TEXT: "LONG VARCHAR",
|
|
116
183
|
exp.DataType.Type.VARBINARY: "VARCHAR",
|
|
117
184
|
}
|
|
118
185
|
|
|
@@ -129,6 +196,16 @@ class Exasol(Dialect):
|
|
|
129
196
|
exp.DataType.Type.DATETIME: "TIMESTAMP",
|
|
130
197
|
}
|
|
131
198
|
|
|
199
|
+
DATE_ADD_FUNCTION_BY_UNIT = {
|
|
200
|
+
"DAY": "ADD_DAYS",
|
|
201
|
+
"WEEK": "ADD_WEEKS",
|
|
202
|
+
"MONTH": "ADD_MONTHS",
|
|
203
|
+
"YEAR": "ADD_YEARS",
|
|
204
|
+
"HOUR": "ADD_HOURS",
|
|
205
|
+
"MINUTE": "ADD_MINUTES",
|
|
206
|
+
"SECOND": "ADD_SECONDS",
|
|
207
|
+
}
|
|
208
|
+
|
|
132
209
|
def datatype_sql(self, expression: exp.DataType) -> str:
|
|
133
210
|
# Exasol supports a fixed default precision of 3 for TIMESTAMP WITH LOCAL TIME ZONE
|
|
134
211
|
# and does not allow specifying a different custom precision
|
|
@@ -155,12 +232,18 @@ class Exasol(Dialect):
|
|
|
155
232
|
exp.BitwiseXor: rename_func("BIT_XOR"),
|
|
156
233
|
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/every.htm
|
|
157
234
|
exp.All: rename_func("EVERY"),
|
|
235
|
+
exp.DateTrunc: lambda self, e: self.func("TRUNC", e.this, unit_to_str(e)),
|
|
236
|
+
exp.DatetimeTrunc: timestamptrunc_sql(),
|
|
158
237
|
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/edit_distance.htm#EDIT_DISTANCE
|
|
159
238
|
exp.Levenshtein: unsupported_args("ins_cost", "del_cost", "sub_cost", "max_dist")(
|
|
160
239
|
rename_func("EDIT_DISTANCE")
|
|
161
240
|
),
|
|
162
241
|
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/mod.htm
|
|
163
242
|
exp.Mod: rename_func("MOD"),
|
|
243
|
+
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/regexp_substr.htm
|
|
244
|
+
exp.RegexpExtract: unsupported_args("parameters", "group")(
|
|
245
|
+
rename_func("REGEXP_SUBSTR")
|
|
246
|
+
),
|
|
164
247
|
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/regexp_replace.htm
|
|
165
248
|
exp.RegexpReplace: unsupported_args("modifiers")(rename_func("REGEXP_REPLACE")),
|
|
166
249
|
# https://docs.exasol.com/db/latest/sql_references/functions/alphabeticallistfunctions/var_pop.htm
|
|
@@ -175,6 +258,7 @@ class Exasol(Dialect):
|
|
|
175
258
|
exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)),
|
|
176
259
|
exp.TimeToStr: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)),
|
|
177
260
|
exp.TimeStrToTime: timestrtotime_sql,
|
|
261
|
+
exp.TimestampTrunc: timestamptrunc_sql(),
|
|
178
262
|
exp.StrToTime: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)),
|
|
179
263
|
exp.CurrentUser: lambda *_: "CURRENT_USER",
|
|
180
264
|
exp.AtTimeZone: lambda self, e: self.func(
|
|
@@ -208,3 +292,18 @@ class Exasol(Dialect):
|
|
|
208
292
|
options = expression.args.get("options")
|
|
209
293
|
|
|
210
294
|
return self.func("CONVERT_TZ", datetime, from_tz, to_tz, options)
|
|
295
|
+
|
|
296
|
+
def if_sql(self, expression: exp.If) -> str:
|
|
297
|
+
this = self.sql(expression, "this")
|
|
298
|
+
true = self.sql(expression, "true")
|
|
299
|
+
false = self.sql(expression, "false")
|
|
300
|
+
return f"IF {this} THEN {true} ELSE {false} ENDIF"
|
|
301
|
+
|
|
302
|
+
def dateadd_sql(self, expression: exp.DateAdd) -> str:
|
|
303
|
+
unit = expression.text("unit").upper() or "DAY"
|
|
304
|
+
func_name = self.DATE_ADD_FUNCTION_BY_UNIT.get(unit)
|
|
305
|
+
if not func_name:
|
|
306
|
+
self.unsupported(f"'{unit}' is not supported in Exasol.")
|
|
307
|
+
return self.function_fallback_sql(expression)
|
|
308
|
+
|
|
309
|
+
return self.func(func_name, expression.this, expression.expression)
|
|
@@ -52,10 +52,6 @@ class Oracle(Dialect):
|
|
|
52
52
|
# https://docs.oracle.com/database/121/SQLRF/sql_elements004.htm#SQLRF00212
|
|
53
53
|
# https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
|
|
54
54
|
TIME_MAPPING = {
|
|
55
|
-
"AM": "%p", # Meridian indicator with or without periods
|
|
56
|
-
"A.M.": "%p", # Meridian indicator with or without periods
|
|
57
|
-
"PM": "%p", # Meridian indicator with or without periods
|
|
58
|
-
"P.M.": "%p", # Meridian indicator with or without periods
|
|
59
55
|
"D": "%u", # Day of week (1-7)
|
|
60
56
|
"DAY": "%A", # name of day
|
|
61
57
|
"DD": "%d", # day of month (1-31)
|
|
@@ -161,6 +161,7 @@ class Redshift(Postgres):
|
|
|
161
161
|
SUPPORTS_MEDIAN = True
|
|
162
162
|
ALTER_SET_TYPE = "TYPE"
|
|
163
163
|
SUPPORTS_DECODE_CASE = True
|
|
164
|
+
SUPPORTS_BETWEEN_FLAGS = False
|
|
164
165
|
|
|
165
166
|
# Redshift doesn't have `WITH` as part of their with_properties so we remove it
|
|
166
167
|
WITH_PROPERTIES_PREFIX = " "
|