Skip to content

fix(parser): parse DuckDB DROP MACRO statements - #2954

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

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

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Summary

JSqlParser accepts DuckDB's CREATE MACRO but rejects both statements that DuckDB uses to delete macros. This change parses DROP MACRO and DROP MACRO TABLE through the existing Drop node and preserves the MACRO TABLE type when deparsing. The round-trip tests cover IF EXISTS, quoted names, and schema-qualified names.

Refs #2804.

Verification

  • DuckDB 1.5.6 executed six create, invoke, and drop sequences for scalar and table macros.
  • The five new parser tests failed on the unchanged grammar and passed with the fix. ./gradlew --offline --no-daemon check passed with 16,725 executed tests and 25 skipped, with no JavaCC choice conflicts.
  • The project JMH benchmark (parseSQLStatements, three forks, five measured iterations per fork) measured 14.06 ± 0.40 ms/op for the base and 14.28 ± 0.61 ms/op for the patch. The reported confidence intervals overlap.
  • mvn -B -ntp verify passed with 16,707 executed tests and 25 skipped.

DeepSeek assisted with the grammar patch and first-pass review. Codex verified the native behavior, adjusted the table-macro handling, and ran the tests and benchmark.

@manticore-projects
manticore-projects merged commit 2cf8bfe into JSQLParser:master Nov 23, 2026
10 checks passed
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