97nitt opened a new pull request, #2326:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2326

   ## Summary
   
   Parse the `WITH CONNECTION <name>` clause on BigQuery `CREATE EXTERNAL TABLE`
   statements. Per the [BigQuery DDL reference][docs], external tables (and
   external Iceberg tables in particular) carry a connection identifier between
   the column list and the `OPTIONS(...)` clause:
   
   ```sql
   CREATE OR REPLACE EXTERNAL TABLE `proj.ds.tbl`
   WITH CONNECTION `projects/proj/locations/us/connections/c`
   OPTIONS(format = "ICEBERG", uris = ["gs://b/m.json"]);
   ```
   
   Today the parser rejects this shape because nothing consumes `WITH 
CONNECTION`,
   and `OPTIONS(...)` on external tables only worked via the Hive
   `TBLPROPERTIES` fallback path.
   
   [docs]: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_external_table_statement
   
   ## Changes
   
   - `CreateTable` / `CreateTableBuilder`: new `with_connection: 
Option<ObjectName>`
     field, populated by the parser and rendered by `Display` between
     `CLUSTER BY` and `OPTIONS(...)`.
   - `parse_create_external_table`: consume an optional `WITH CONNECTION 
<name>`,
     then prefer `OPTIONS(...)` over `TBLPROPERTIES(...)` (mutually exclusive in
     practice; preserves the existing Hive path when neither is present).
   - Tests: new BigQuery cases covering `WITH CONNECTION` with `OPTIONS`,
     `WITH CONNECTION` alone (Display normalizes by adding an empty column 
list),
     the `(columns) WITH CONNECTION OPTIONS(...)` round-trip, and a baseline
     that asserts `with_connection` stays `None` when the keyword pair is 
absent.
   - `tests/sqlparser_duckdb.rs`, `tests/sqlparser_mssql.rs`,
     `tests/sqlparser_postgres.rs`: updated existing struct-literal expectations
     for the new field.
   
   ## Test plan
   
   - [x] `cargo test`
   - [x] `cargo fmt --check`
   - [x] `cargo clippy --all-targets --all-features -- -D warnings`


-- 
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