Skip to content

[Fix-18302][Common] Fix SQL license header parsing#18301

Merged
SbloodyS merged 1 commit into
apache:devfrom
hiSandog:fix/sql-license-parser-20260528
May 28, 2026
Merged

[Fix-18302][Common] Fix SQL license header parsing#18301
SbloodyS merged 1 commit into
apache:devfrom
hiSandog:fix/sql-license-parser-20260528

Conversation

@hiSandog
Copy link
Copy Markdown
Contributor

@hiSandog hiSandog commented May 28, 2026

Purpose of the pull request

Close #18302.

ClasspathSqlScriptParser skips the initial block license header before parsing SQL resources. The closing marker check used the raw line, so a standard indented closing marker like */ was not recognized and the parser could skip the rest of the file.

Brief change log

  • Trim the line before detecting the closing */ marker while skipping the license header.
  • Add a focused test SQL resource with an indented license header closing marker.
  • Cover the parser behavior in ClasspathSqlScriptParserTest.

Verify this pull request

  • git diff --cached --check
  • Could not run ./mvnw -pl dolphinscheduler-common -Dtest=ClasspathSqlScriptParserTest test because this machine has no Java Runtime available (java -version reports: Unable to locate a Java Runtime).

@hiSandog hiSandog requested a review from SbloodyS as a code owner May 28, 2026 02:21
@ruanwenjun ruanwenjun added this to the 3.4.2 milestone May 28, 2026
Copy link
Copy Markdown
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

LGTM, please create a issue.

@ruanwenjun ruanwenjun added the bug Something isn't working label May 28, 2026
@hiSandog hiSandog changed the title [Fix] Fix SQL license header parsing [Fix-18302][Common] Fix SQL license header parsing May 28, 2026
@hiSandog
Copy link
Copy Markdown
Contributor Author

Created #18302 and linked it from the PR title/body with Close #18302.

@ruanwenjun ruanwenjun force-pushed the fix/sql-license-parser-20260528 branch from 3c4fe08 to 13f8c8f Compare May 28, 2026 06:33
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

+1

@SbloodyS SbloodyS merged commit eed37a9 into apache:dev May 28, 2026
124 of 127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Common] ClasspathSqlScriptParser skips SQL after indented license header

3 participants