moshap-firebolt opened a new pull request, #2437:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2437

   BigQuery can create a vector index for approximate nearest-neighbor search 
over
   an embedding column:
   
   ```sql
   CREATE [OR REPLACE] VECTOR INDEX [IF NOT EXISTS] <name>
   ON <table>(<column>)
   OPTIONS(index_type = 'IVF', distance_type = 'COSINE', ...)
   ```
   
   `VECTOR` is not a keyword, so `parse_create` previously failed with
   `Expected: an object type after CREATE, found: VECTOR`.
   
   ### Changes
   - Add `vector`, `or_replace` and `options` fields to `CreateIndex`. `VECTOR` 
is
     a modifier on `CREATE INDEX` (like `EXTERNAL` on `CREATE TABLE`), so it 
reuses
     the existing node rather than a new statement variant. `Display` renders
     `CREATE [OR REPLACE ]VECTOR INDEX ...` plus a trailing `OPTIONS(...)`.
   - Parse the form in `parse_create` via a small `parse_create_vector_index`
     helper; the `OPTIONS(...)` clause reuses `parse_options` / `SqlOption`, so 
it
     parses and renders the same way as `CREATE TABLE` / `CREATE VIEW` OPTIONS.
   - Plain `CREATE INDEX` is unchanged (all three fields default to 
false/empty).
   - New test `parse_bigquery_create_vector_index` in 
`tests/sqlparser_bigquery.rs`
     verifies the round-trip and covers `OR REPLACE`, `IF NOT EXISTS`, 
multi-part
     names and the OPTIONS-less form.
   
   Docs: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_vector_index_statement


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to