Skip to content

Make dialect-specific clause words non-reserved - #2793

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
guizmaii:non-reserved-dialect-keywords
Oct 13, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
guizmaii:non-reserved-dialect-keywords

Conversation

@guizmaii

Copy link
Copy Markdown
Contributor

Follow-up to the discussion in #2787: the smaller fix, without per-dialect keyword lists.

CSV, FBV, FILE, SCRIPT, VERIFY (Exasol IMPORT/EXPORT), PREWHERE, SETTINGS (ClickHouse) and RETURNS (CREATE FUNCTION) were reserved for every dialect, so this failed everywhere although they are ordinary names in PostgreSQL or DuckDB:

SELECT csv, file, script, settings, prewhere, returns, fbv, verify FROM t
  • Moved the 8 words to NonReservedWord().
  • PREWHERE and SETTINGS never start an implicit alias, so FROM t PREWHERE … / FROM t SETTINGS … still parse as clauses (AS settings still works).
  • Removed the now redundant SETTINGS special case in TypeDdlName() and FILE in the reserved-as-identifier lists.
  • checkGrammarAmbiguity: no new choice conflicts. ./gradlew check: 10,132 tests, 0 failures; Exasol IMPORT/EXPORT and ClickHouse tests unchanged.
  • Performance: parsing the 262 .sql test resources, best of 30 rounds, ~34 ms on both master and this branch.

Refs #2786

CSV, FBV, FILE, SCRIPT and VERIFY (Exasol IMPORT/EXPORT), PREWHERE and
SETTINGS (ClickHouse) and RETURNS (CREATE FUNCTION) were reserved for
every dialect, so `SELECT settings, file FROM t` failed in PostgreSQL or
DuckDB, where they are ordinary names.

They are now non-reserved. PREWHERE and SETTINGS never start an implicit
alias, so the ClickHouse clauses still follow a table name.
TypeDdlName's SETTINGS special case and FILE's entry in the
reserved-as-identifier list are no longer needed.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:19

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@manticore-projects

Copy link
Copy Markdown
Contributor

Nice, ready to merge when tests confirmed.

@guizmaii

Copy link
Copy Markdown
Contributor Author

@manticore-projects CI passes

@manticore-projects
manticore-projects merged commit a90873f into JSQLParser:master Oct 13, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you much!

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.

3 participants