From 3013a201896910bd67ff94e84f74ef126a9633fa Mon Sep 17 00:00:00 2001 From: jhkl Date: Thu, 12 Mar 2026 21:27:54 +0100 Subject: [PATCH] Align Dremio support docs with versioned ref coverage --- docs/dremio-support-matrix.md | 8 +++++--- docs/dremio.md | 1 + fixtures/dremio/reference-commands/15_create_table_as.sql | 1 + fixtures/dremio/reference-commands/17_create_view.sql | 1 + fixtures/dremio/reference-commands/26_insert.sql | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/dremio-support-matrix.md b/docs/dremio-support-matrix.md index 436f2e8..2a906fe 100644 --- a/docs/dremio-support-matrix.md +++ b/docs/dremio-support-matrix.md @@ -41,9 +41,9 @@ Reference export timestamp: 2026-02-28T14:20:54.462923+00:00 | 12 | CREATE FOLDER | NATIVE | `fixtures/dremio/reference-commands/12_create_folder.sql` | `CreateFolder` command path | | 13 | CREATE PIPE Enterprise | NATIVE | `fixtures/dremio/reference-commands/13_create_pipe.sql` | `Pipe` command path | | 14 | CREATE TABLE | AST | `fixtures/dremio/reference-commands/14_create_table.sql` | SQL AST path | -| 15 | CREATE TABLE AS | AST | `fixtures/dremio/reference-commands/15_create_table_as.sql` | SQL AST path | +| 15 | CREATE TABLE AS | AST | `fixtures/dremio/reference-commands/15_create_table_as.sql` | SQL AST path + versioned source ref variant | | 16 | CREATE TAG | NATIVE | `fixtures/dremio/reference-commands/16_create_tag.sql` | `BranchTag` command path | -| 17 | CREATE VIEW | AST | `fixtures/dremio/reference-commands/17_create_view.sql` | SQL AST path | +| 17 | CREATE VIEW | AST | `fixtures/dremio/reference-commands/17_create_view.sql` | SQL AST path + versioned source ref variant | | 18 | DELETE | AST | `fixtures/dremio/reference-commands/18_delete.sql` | SQL AST path | | 19 | DESCRIBE PIPE Enterprise | NATIVE | `fixtures/dremio/reference-commands/19_describe_pipe.sql` | `Pipe` command path | | 20 | DROP | AST | `fixtures/dremio/reference-commands/20_drop.sql` | SQL AST path | @@ -52,7 +52,7 @@ Reference export timestamp: 2026-02-28T14:20:54.462923+00:00 | 23 | DROP TAG | NATIVE | `fixtures/dremio/reference-commands/23_drop_tag.sql` | `BranchTag` command path | | 24 | DROP VIEW | AST | `fixtures/dremio/reference-commands/24_drop_view.sql` | SQL AST path | | 25 | GRANT/REVOKE Enterprise | NATIVE | `fixtures/dremio/reference-commands/25_grant_revoke.sql` | Generic Dremio command path | -| 26 | INSERT | AST | `fixtures/dremio/reference-commands/26_insert.sql` | SQL AST + insert formatting path | +| 26 | INSERT | AST | `fixtures/dremio/reference-commands/26_insert.sql` | SQL AST + insert formatting path + versioned source ref variant | | 27 | MERGE | AST | `fixtures/dremio/reference-commands/27_merge.sql` | SQL AST path | | 28 | MERGE BRANCH | NATIVE | `fixtures/dremio/reference-commands/28_merge_branch.sql` | `BranchTag` command path | | 29 | OPTIMIZE TABLE | NATIVE | `fixtures/dremio/reference-commands/29_optimize_table.sql` | `TableMaintenance` command path | @@ -96,8 +96,10 @@ Reference export timestamp: 2026-02-28T14:20:54.462923+00:00 ## Evaluation Notes - Canonical command corpus: `fixtures/dremio/reference-commands/` with 57 fixture files. +- Versioned source refs are covered in canonical `CREATE TABLE AS`, `CREATE VIEW`, and `INSERT` fixtures. - Parser guard: strict-mode test covers all 57 fixture files. - Formatter guard: idempotence + keyword-case matrix (upper/lower) covers all 57 fixture files. +- Statement-level semantic-preservation tests assert version-clause retention for CTAS/CREATE VIEW/INSERT in parser + formatter paths. - `sqlparser` has been upgraded to `0.61.0` and all parser/formatter tests pass with the upgraded AST APIs. ## Backlog (Priority Order) diff --git a/docs/dremio.md b/docs/dremio.md index 9a6c7a0..3a0404f 100644 --- a/docs/dremio.md +++ b/docs/dremio.md @@ -17,6 +17,7 @@ Use `--dialect dremio` for Dremio SQL inputs and fixtures under `fixtures/dremio - Dremio-specific recognized keywords are case-formatted according to `keyword_case` - Version clauses are formatted as separate lines after the base `FROM` relation when present +- Version clauses are preserved in top-level `SELECT` and in `SELECT` bodies for `CREATE TABLE AS`, `CREATE VIEW ... AS`, and `INSERT ... SELECT` - Quoted path segments are preserved (for example, source names with dots or dashes) - `TABLE(EXTERNAL_QUERY(...))` and similar table functions use nested formatting so inner queries remain readable diff --git a/fixtures/dremio/reference-commands/15_create_table_as.sql b/fixtures/dremio/reference-commands/15_create_table_as.sql index 9a2fa42..a805a3c 100644 --- a/fixtures/dremio/reference-commands/15_create_table_as.sql +++ b/fixtures/dremio/reference-commands/15_create_table_as.sql @@ -1,2 +1,3 @@ CREATE TABLE my_space.ctas_table AS SELECT * FROM my_space.my_table; CREATE TABLE my_space.ctas_partitioned PARTITION BY (MONTH(created_at)) AS SELECT id, created_at FROM my_space.my_table; +CREATE TABLE my_space.ctas_from_tag AS SELECT * FROM my_space.my_table AT TAG release_candidate; diff --git a/fixtures/dremio/reference-commands/17_create_view.sql b/fixtures/dremio/reference-commands/17_create_view.sql index 39fbf29..c16016c 100644 --- a/fixtures/dremio/reference-commands/17_create_view.sql +++ b/fixtures/dremio/reference-commands/17_create_view.sql @@ -1,2 +1,3 @@ CREATE OR REPLACE VIEW my_space.my_view AS SELECT id FROM my_space.my_table; CREATE VIEW my_space.my_view2 AS SELECT id, SUM(amount) AS total_amount FROM my_space.my_table GROUP BY id; +CREATE VIEW my_space.my_view_from_branch AS SELECT id FROM my_space.my_table AT BRANCH release AS OF TIMESTAMP '2025-01-01 00:00:00'; diff --git a/fixtures/dremio/reference-commands/26_insert.sql b/fixtures/dremio/reference-commands/26_insert.sql index 525617f..67d2899 100644 --- a/fixtures/dremio/reference-commands/26_insert.sql +++ b/fixtures/dremio/reference-commands/26_insert.sql @@ -1,2 +1,3 @@ INSERT INTO my_space.my_table (id, amount) VALUES (1, 10.5), (2, 20.0); INSERT INTO my_space.my_table SELECT id, amount FROM my_space.source_table; +INSERT INTO my_space.my_table SELECT id, amount FROM my_space.source_table AT COMMIT 'a1b2c3d4';