René's URL Explorer Experiment


Title: Let a dialect own its reserved keywords, starting with DuckDB by guizmaii · Pull Request #2787 · JSQLParser/JSqlParser · GitHub

Open Graph Title: Let a dialect own its reserved keywords, starting with DuckDB by guizmaii · Pull Request #2787 · JSQLParser/JSqlParser

X Title: Let a dialect own its reserved keywords, starting with DuckDB by guizmaii · Pull Request #2787 · JSQLParser/JSqlParser

Description: Purpose Implements #2786: a dialect owns its reserved keywords, in both directions, starting with DuckDB. Consumer duckDb = parser -> parser.withDialect(Dialect.DUCKDB); CCJSqlParserUtil.parse("SELECT settings, file FROM script s WHERE s.top > 1", duckDb); // accepted, rejected without the dialect CCJSqlParserUtil.parse("SELECT a AS from, t.where FROM t", duckDb); // any keyword after AS or "." CCJSqlParserUtil.parse("SELECT desc FROM t", duckDb); // rejected: DESC is reserved in DuckDB CCJSqlParserUtil.parse("SELECT 1 name", duckDb); // rejected: a bare alias cannot be a keyword Model KeywordPolicy#isName(word, NamePosition): whether a word is an unquoted name at a position: NAME (column, table, CTE, ...), FUNCTION, LABEL (after AS or .), BARE_ALIAS. Dialect#getKeywordPolicy(): null for the default rules (nothing changes without a policy). Dialect.DUCKDB (dollar-quoted string tags, adjacent string literals on a new line) uses DuckDbKeywordPolicy: DuckDB 1.5.5's 489 keywords with their categories, from duckdb_keywords(), and the PostgreSQL rules DuckDB applies to them. Function names only reject reserved keywords: DuckDB's grammar special-cases functions named by other keywords (COALESCE, NULLIF, IF, ...). Grammar RelObjectName() rejects the names the policy rejects at that position (position from the previous token: AS/., or a following (). DialectUnreservedWord() accepts the keywords reserved by default that the policy accepts as names; DialectLabel() accepts any keyword after AS or .. A select item's alias without AS follows the BARE_ALIAS rule; other aliases follow NAME. Constructs led by such words step aside when the word is a name: the XOR operator (grammar and Pratt loop), INCLUDES/EXCLUDES, EXISTS, CONNECT_BY_ROOT, PRIOR, XMLSERIALIZE, window-frame BETWEEN/UNBOUNDED, CONNECT BY [NOCYCLE], with explicit lookaheads: checkGrammarAmbiguity passes. Validation Java 17 Gradle check: 13,489 tests, zero failures/errors; Spotless, Checkstyle, PMD, SpotBugs and checkGrammarAmbiguity pass. All existing tests are unchanged, apart from TaggedDollarStringTest, which now treats every dialect enabling dollar-quoted string tags (PostgreSQL and DuckDB) alike. DuckDbKeywordPolicyTest compares, for each of DuckDB's 489 keywords, 7 name positions (column, qualified column, AS alias, bare alias, table, table alias, CTE) against what DuckDB 1.5.5 itself parses (duckdb-keyword-names.csv, generated with json_serialize_sql()): 3,391 cells agree. 32 cells are exempted, each documented: JSqlParser parses the word as dedicated syntax at that position (MAP {...}, STRUCT(...), TRY_CAST(...), COLUMNS(...), DEFAULT, WITH RECURSIVE, UPDATE ... SET, ...) or SELECT 1 day as a date unit. 505 production DuckDB queries parse with and without Dialect.DUCKDB. Limits MySQL's SELECT modifiers (DISTINCTROW, STRAIGHT_JOIN, SQL_CACHE, ...) cannot be names under a policy: Select()'s LOOKAHEAD(3) into PlainSelect() takes them as modifiers first. Other dialects keep the default rules; their policies can follow the same model.

Open Graph Description: Purpose Implements #2786: a dialect owns its reserved keywords, in both directions, starting with DuckDB. Consumer<CCJSqlParser> duckDb = parser -> parser.withDialect(Dialect.DUCKDB); CCJS...

X Description: Purpose Implements #2786: a dialect owns its reserved keywords, in both directions, starting with DuckDB. Consumer&lt;CCJSqlParser&gt; duckDb = parser -&gt; parser.withDialect(Dialect.D...

Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2787

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f1c85e44-831f-6058-4d2c-717f341c5d27
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA1DA:205334:BA273D:1036FEA:6B048B72
html-safe-nonce21489af7dfc8c4a8cf3e13462b899b51b8cb4ea313be7a302385d0b53d880d7c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMURBOjIwNTMzNDpCQTI3M0Q6MTAzNkZFQTo2QjA0OEI3MiIsInZpc2l0b3JfaWQiOiI1ODE3MTk5Mzk1MDc0MjQ3NTM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac047106c75bc39f0d94f55bc5f5832dbcd3e15cffadcf13e01fdba13f27440ea8
hovercard-subject-tagpull_request:4838313147
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2787/files
twitter:imagehttps://avatars.githubusercontent.com/u/1193670?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1193670?s=400&v=4
og:image:altPurpose Implements #2786: a dialect owns its reserved keywords, in both directions, starting with DuckDB. Consumer<CCJSqlParser> duckDb = parser -> parser.withDialect(Dialect.DUCKDB); CCJS...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git
octolytics-dimension-user_id4643847
octolytics-dimension-user_loginJSQLParser
octolytics-dimension-repository_id1944709
octolytics-dimension-repository_nwoJSQLParser/JSqlParser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1944709
octolytics-dimension-repository_network_root_nwoJSQLParser/JSqlParser
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/JSQLParser/JSqlParser/pull/2787/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2787%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2787%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=JSQLParser%2FJSqlParser
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2787/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2787/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2787/files
JSQLParserhttps://github.com/JSQLParser
JSqlParserhttps://github.com/JSQLParser/JSqlParser
Codehttps://github.com/JSQLParser/JSqlParser
Issues2 (2)https://github.com/JSQLParser/JSqlParser/issues
Pull requests2 (2)https://github.com/JSQLParser/JSqlParser/pulls
Discussionshttps://github.com/JSQLParser/JSqlParser/discussions
Actionshttps://github.com/JSQLParser/JSqlParser/actions
Projectshttps://github.com/JSQLParser/JSqlParser/projects
Wikihttps://github.com/JSQLParser/JSqlParser/wiki
Security and qualityhttps://github.com/JSQLParser/JSqlParser/security
Insightshttps://github.com/JSQLParser/JSqlParser/insights
Sign up for GitHub https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
guizmaiihttps://github.com/guizmaii
JSQLParser:masterhttps://github.com/JSQLParser/JSqlParser/tree/master
guizmaii:dialect-reserved-keywordshttps://github.com/guizmaii/JSqlParser/tree/dialect-reserved-keywords
Conversation 7 https://github.com/JSQLParser/JSqlParser/pull/2787
Commits 1 https://github.com/JSQLParser/JSqlParser/pull/2787/commits
Checks 10 https://github.com/JSQLParser/JSqlParser/pull/2787/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2787/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
Let a dialect own its reserved keywords, starting with DuckDB https://github.com/JSQLParser/JSqlParser/pull/2787/files#top
Show all changes 1 commit https://github.com/JSQLParser/JSqlParser/pull/2787/files
41a5a26 Let a dialect own its reserved keywords, starting with DuckDB guizmaii Oct 13, 2026 https://github.com/JSQLParser/JSqlParser/pull/2787/commits/41a5a265f208bf0aec177c734963290dafc68342
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2787/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
module-info.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-ed4152fc79c851ea436af640f5fc06984df0f45c56e0a74a39ff3fa8cb55fcf4
AbstractJSqlParser.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
DuckDbKeywordPolicy.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-224611329c241238bc927628325614f47e3f1d5fe7c3969d188f620be102ab74
KeywordCategory.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-8450d980b1a4aff085e811d166bd0d752c2cc618200b0cc385db47c13d6f5355
KeywordPolicy.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-5e840c0c2b293c0da5c8d0f7f70d2743a9d7bee6ab72f99ffa737e8a085e07a1
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
TaggedDollarStringTest.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
DuckDbKeywordPolicyTest.java https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-9c823db16892f3a3a61fad9f3c2601d55ff541e86535ac841d919a8176fc760d
duckdb-keyword-names.csv https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-b34c181ffe92bb0371f4a97f7c926cd9997827e0d7dda67fb539e68ba2db41cd
src/main/java/module-info.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-ed4152fc79c851ea436af640f5fc06984df0f45c56e0a74a39ff3fa8cb55fcf4
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/java/module-info.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-ed4152fc79c851ea436af640f5fc06984df0f45c56e0a74a39ff3fa8cb55fcf4
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-ed4152fc79c851ea436af640f5fc06984df0f45c56e0a74a39ff3fa8cb55fcf4
src/main/java/net/sf/jsqlparser/parser/AbstractJSqlParser.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/java/net/sf/jsqlparser/parser/AbstractJSqlParser.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-f3d102ab63392ed2edd072c988dbb6bc63814290d26f6fc184bfe03780ebc8e9
src/main/java/net/sf/jsqlparser/parser/dialect/DuckDbKeywordPolicy.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-224611329c241238bc927628325614f47e3f1d5fe7c3969d188f620be102ab74
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/java/net/sf/jsqlparser/parser/dialect/DuckDbKeywordPolicy.java
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
src/main/java/net/sf/jsqlparser/parser/dialect/KeywordCategory.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-8450d980b1a4aff085e811d166bd0d752c2cc618200b0cc385db47c13d6f5355
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/java/net/sf/jsqlparser/parser/dialect/KeywordCategory.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
src/main/java/net/sf/jsqlparser/parser/dialect/KeywordPolicy.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-5e840c0c2b293c0da5c8d0f7f70d2743a9d7bee6ab72f99ffa737e8a085e07a1
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/java/net/sf/jsqlparser/parser/dialect/KeywordPolicy.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
src/test/java/net/sf/jsqlparser/expression/TaggedDollarStringTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/test/java/net/sf/jsqlparser/expression/TaggedDollarStringTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
https://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-7c4200ce8fa83da3fce50f078da602a643fb6f7f8a749447bde76087c92e70e7
src/test/java/net/sf/jsqlparser/parser/dialect/DuckDbKeywordPolicyTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2787/files#diff-9c823db16892f3a3a61fad9f3c2601d55ff541e86535ac841d919a8176fc760d
View file https://github.com/guizmaii/JSqlParser/blob/41a5a265f208bf0aec177c734963290dafc68342/src/test/java/net/sf/jsqlparser/parser/dialect/DuckDbKeywordPolicyTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2787/{{ revealButtonHref }}
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2787/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.