You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend the shared `CREATE VECTOR INDEX` parsing to the trailers used by the
other dialects, and add per-dialect tests:
- `STORING(...)` covering-column clause (BigQuery); new `storing` field on
`CreateIndex`, rendered after `INCLUDE`.
- Accept a `WITH (...)` options clause on a vector index in every dialect
(SQL Server `WITH (METRIC = ..., TYPE = ..., MAXDOP = ...)`), not only the
dialects that enable it for a plain `CREATE INDEX`.
Tests:
- `tests/sqlparser_common.rs` — the generic core plus the shared trailers
(`INCLUDE`, `STORING`, `WITH`, `USING`, expression targets) across all dialects.
- `tests/sqlparser_bigquery.rs` — `OPTIONS(...)` with index_type / distance_type
/ JSON tuning keys, and `STORING(...)`.
- `tests/sqlparser_mssql.rs` — bracket-quoted names with `WITH (...)`.
- `tests/sqlparser_mysql.rs` — TiDB's distance-function target with `USING`.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
"CREATE SNAPSHOT TABLE IF NOT EXISTS dataset_id.table1 CLONE dataset_id.table2 FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR) OPTIONS(expiration_timestamp = TIMESTAMP '2025-01-01 00:00:00 UTC')",
2951
2951
);
2952
2952
}
2953
+
2954
+
#[test]
2955
+
fnparse_bigquery_create_vector_index(){
2956
+
// BigQuery's form: an `OPTIONS(...)` clause with its index_type / distance_type
2957
+
// / JSON tuning keys, and a `STORING(...)` covering-column list.
2958
+
bigquery().verified_stmt(
2959
+
"CREATE VECTOR INDEX my_index ON my_dataset.my_table(embedding) OPTIONS(index_type = 'IVF', distance_type = 'COSINE', ivf_options = '{\"num_lists\": 2500}')",
2960
+
);
2961
+
bigquery().verified_stmt(
2962
+
"CREATE OR REPLACE VECTOR INDEX my_index ON my_dataset.my_table(embedding) STORING(type, creation_time) OPTIONS(index_type = 'TREE_AH', distance_type = 'EUCLIDEAN')",
0 commit comments