Skip to content

feat(pgq): add SQL/PGQ keywords - #2394

Open
zhjwpku wants to merge 1 commit into
apache:mainfrom
zhjwpku:pgq-keywords
Open

feat(pgq): add SQL/PGQ keywords#2394
zhjwpku wants to merge 1 commit into
apache:mainfrom
zhjwpku:pgq-keywords

Conversation

@zhjwpku

@zhjwpku zhjwpku commented Jul 2, 2026

Copy link
Copy Markdown

closes #2393

  • Add SQL/PGQ keywords from ISO/IEC 9075-16:2023(E) to src/keywords.rs
  • Add tokenizer coverage to ensure these words are recognized as keywords

closes apache#2393

- Add SQL/PGQ keywords from ISO/IEC 9075-16:2023(E) to `src/keywords.rs`
- Add tokenizer coverage to ensure these words are recognized as keywords
@zhjwpku

zhjwpku commented Jul 4, 2026

Copy link
Copy Markdown
Author

@alamb Hi Andrew, could you please take a look at this? I plan to support the AST and query parser in separate follow-up PRs.

@LucaCappelletti94 LucaCappelletti94 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not a maintainer, just a fellow contributor. Here are some opinions:

I believe that the syntax used in GRAPH_TABLE definitions is completely different from all other SQL operations.

While I agree that the standard now supports some graph queries, this is fairly new (postgres 19 will introduce some support), so it is not as easy to determine what is correct and what is not in the commonly used engines.

I suggest you only introduce specifically keywords to handle the SQL part of graph queries and avoid the PGQ specific ones, so if I am not mistaken the keep set would be:

DESTINATION
EDGE
GRAPH
GRAPH_TABLE
LABEL
NODE
PROPERTIES
PROPERTY
RELATIONSHIP
VERTEX

and the PGQ syntax may be kept as an unparsed string, which downhill user can choose to parse, like we do for the CSV/TSV object after a COPY statement.

Comment thread src/tokenizer.rs
compare(expected, tokens);
}

#[test]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test is tautological, there is no reason to add such a thing.

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.

Add SQL/PGQ keywords

2 participants