Skip to content

feat: support Trino map data types (7008) - #4248

Open
benfdking wants to merge 1 commit into
port/sqlfluff-6995from
port/sqlfluff-7008
Open

benfdking wants to merge 1 commit into
port/sqlfluff-6995from
port/sqlfluff-7008

Conversation

@benfdking

Copy link
Copy Markdown
Collaborator

Stacked on sqruff #4247. Merge #4247 first.
#4247

Summary

  • Support Trino MAP types with round or angle brackets, primitive keys, and nested value types.
  • Separate primitive types from structural types and port upstream SQL and parse-tree fixtures, preserving existing ROW/accessor tree conventions.

Ported from SQLFluff d9a860d91a59f848f7f277d7d6fc4729319b7b93
sqlfluff/sqlfluff#7008
sqlfluff/sqlfluff@d9a860d

Validation

  • cargo fmt --all -- --check
  • cargo build
  • cargo test
  • bazel test //... --test_timeout=600,300,900,3600 --local_test_jobs=1 --lockfile_mode=off

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T12:46:08.856272Z 35c9367 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@benfdking
benfdking added this pull request to stack #4155 September 15, 2026 12:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35c9367e38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

NodeMatcher::new(SyntaxKind::MapTypeSchema, |_| {
one_of(vec![
Bracketed::new(vec![
Ref::new("PrimitiveTypeSegment").to_matchable(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept structural map key types

When a valid comparable structural type is used as a key, such as MAP(ROW(x BIGINT), VARCHAR), both schema alternatives reject it because the key is restricted to PrimitiveTypeSegment. Trino permits comparable ROW and ARRAY types as map keys, so these valid declarations become unparsable; use a datatype grammar for the key and leave comparability validation to Trino.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark for 884ed3c

Click to view benchmark
Test Base PR %
DepthMap::from_parent 94.1±1.34µs 93.7±0.61µs -0.43%
fix_complex_query 21.2±0.51ms 22.5±1.06ms +6.13%
fix_superlong 94.2±8.79ms 99.4±6.93ms +5.52%
parse_complex_query 3.2±0.03µs 3.4±0.10µs +6.25%
parse_expression_recursion 5.7±0.03µs 5.8±0.11µs +1.75%
parse_simple_query 828.8±24.37ns 831.6±9.82ns +0.34%

## Summary
- Support round and angle bracket MAP schemas with primitive keys and nested values.
- Port structural-type SQL and refresh Trino parse fixtures.

Ported from SQLFluff d9a860d91a59f848f7f277d7d6fc4729319b7b93
sqlfluff/sqlfluff#7008
sqlfluff/sqlfluff@d9a860d
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.

1 participant