Skip to content

chore: port Greenplum dialect (#4661)#2673

Merged
benfdking merged 1 commit into
mainfrom
port/sqlfluff-4661
Jun 6, 2026
Merged

chore: port Greenplum dialect (#4661)#2673
benfdking merged 1 commit into
mainfrom
port/sqlfluff-4661

Conversation

@mikills
Copy link
Copy Markdown
Collaborator

@mikills mikills commented Jun 6, 2026

Summary

  • SQLFluff #4661 added the Greenplum dialect (a massively parallel Postgres). Ported it to sqruff: new DialectKind::Greenplum, greenplum.rs (derived from postgres) with the DISTRIBUTED BY (...) | RANDOMLY | REPLICATED clause on CREATE TABLE and DISTRIBUTED/RANDOMLY/REPLICATED reserved keywords, wired into the dialect registry, feature list, and test harness.
  • Greenplum storage option values accept literals, bare identifiers, reserved-word identifiers, and quoted identifiers (e.g. compresstype = zstd, orientation = column, compresstype = "zstd").
  • Added the greenplum/create_table fixture (.sql + .yml); the dialect test parses it with no unparsable segments. Parser-only change.
  • Follow-up (not in this PR, and not supported by SQLFluff #4661 either): CREATE TABLE ... AS SELECT ... DISTRIBUTED ... (CTAS) — the trailing DISTRIBUTED clause needs deeper select parse-mode work.

Ported from SQLFluff 32095f823ee6a8b597b3dc8cb688d55449f85b64
sqlfluff/sqlfluff#4661
sqlfluff/sqlfluff@32095f8

Stacked on #2671 (#4653) → #2670 (#4654); base reverts to `main` as those merge.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

Benchmark for ceb07a5

Click to view benchmark
Test Base PR %
DepthMap::from_parent 59.4±1.08µs 59.0±0.71µs -0.67%
fix_complex_query 12.3±0.23ms 12.2±0.05ms -0.81%
fix_superlong 185.9±4.91ms 185.9±6.98ms 0.00%
parse_complex_query 4.1±0.10µs 4.2±0.06µs +2.44%
parse_expression_recursion 6.8±0.06µs 6.9±0.06µs +1.47%
parse_simple_query 1044.7±15.79ns 1073.0±18.75ns +2.71%

@benfdking benfdking force-pushed the port/sqlfluff-4653 branch from 062cb99 to 7dcaa6b Compare June 6, 2026 22:33
Base automatically changed from port/sqlfluff-4653 to main June 6, 2026 22:42
@benfdking benfdking force-pushed the port/sqlfluff-4661 branch from e92dc58 to 750ccbf Compare June 6, 2026 22:43
  - SQLFluff #4661 added the Greenplum dialect (a massively parallel Postgres). Ported it to sqruff: new `DialectKind::Greenplum`, `greenplum.rs` (derived from postgres) with the `DISTRIBUTED BY (...) | RANDOMLY | REPLICATED` clause on `CREATE TABLE` and `DISTRIBUTED`/`RANDOMLY`/`REPLICATED` reserved keywords, wired into the dialect registry, feature list, and test harness.
  - Greenplum storage option values accept literals, bare identifiers, reserved-word identifiers, and quoted identifiers (e.g. `compresstype = zstd`, `orientation = column`, `compresstype = "zstd"`).
  - Added the `greenplum/create_table` fixture (.sql + .yml); the dialect test parses it with no unparsable segments. Parser-only change.
  - Follow-up (not in this PR, and not supported by SQLFluff #4661 either): `CREATE TABLE ... AS SELECT ... DISTRIBUTED ...` (CTAS) — the trailing DISTRIBUTED clause needs deeper select parse-mode work.

  Ported from SQLFluff 32095f823ee6a8b597b3dc8cb688d55449f85b64
  sqlfluff/sqlfluff#4661
  sqlfluff/sqlfluff@32095f8
@benfdking benfdking force-pushed the port/sqlfluff-4661 branch from 750ccbf to cef49dd Compare June 6, 2026 22:55
@benfdking benfdking merged commit db0b4f0 into main Jun 6, 2026
24 of 27 checks passed
@benfdking benfdking deleted the port/sqlfluff-4661 branch June 6, 2026 22:56
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

Benchmark for 7848ef5

Click to view benchmark
Test Base PR %
DepthMap::from_parent 61.0±0.63µs 60.7±1.53µs -0.49%
fix_complex_query 12.8±0.05ms 12.8±0.14ms 0.00%
fix_superlong 205.6±4.13ms 202.5±10.16ms -1.51%
parse_complex_query 4.2±0.08µs 4.2±0.03µs 0.00%
parse_expression_recursion 7.5±0.16µs 7.5±0.15µs 0.00%
parse_simple_query 1041.9±6.31ns 1070.1±23.47ns +2.71%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants