Skip to content

fix(parser): parse DuckDB CREATE TYPE aliases - #2955

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
hutiefang76:frank/fix-jsql2804-type-alias-20261123
Nov 23, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
hutiefang76:frank/fix-jsql2804-type-alias-20261123

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Summary

Parse DuckDB's CREATE TYPE name AS data_type form with the existing column type grammar. The CreateType AST holds a ColDataType through the new AliasTypeDefinition. This covers scalar, parameterized, array, and struct aliases. The existing PostgreSQL forms keep their current behavior, and the explicit PostgreSQL dialect rejects the DuckDB alias form.

Refs #2804.

Verification

  • DuckDB 1.5.6 ran all four alias definitions end to end. Each alias was used in a cast and a table column. DuckDB also accepted all four statements deparsed by the patch.
  • The unchanged parser rejected the four definitions. The patched Gradle suite ran 16,726 tests with 25 skipped. The six new tests passed, and JavaCC reported zero grammar choice conflicts.
  • The project JMH benchmark (parseSQLStatements, three forks, five measured iterations per fork) measured 14.19 ± 0.47 ms/op for the base and 13.99 ± 0.38 ms/op for the patch. The reported confidence intervals overlap.
  • mvn -B -ntp verify completed with 16,708 tests run and 25 skipped.

DeepSeek assisted with an initial patch and first-pass review. Codex corrected the dialect gate and rendering, then ran the native checks, test suites, and benchmark.

@manticore-projects
manticore-projects merged commit e2d2f2c into JSQLParser:master Nov 23, 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.

2 participants