Skip to content

fix: match JOIN ON parser error with location suffix in whitelist - #15

Open
createcentury wants to merge 1 commit into
datafusion-contrib:mainfrom
createcentury:fix/whitelist-natural-join-on
Open

createcentury wants to merge 1 commit into
datafusion-contrib:mainfrom
createcentury:fix/whitelist-natural-join-on

Conversation

@createcentury

Copy link
Copy Markdown

Summary

Follow-up to #14. While testing that PR, the fuzzer reported one non-whitelisted error on both main and the PR branch. The error is expected: the fuzzer occasionally adds an ON clause to NATURAL JOIN / CROSS JOIN on purpose.

The cause is that the DataFusion 54 parser error now includes the location:

# whitelisted (old format)
SQL error: ParserError("Expected: end of statement, found: ON")

# actual error (new format), not matched by the existing `Contains` pattern
Query planning failed: SQL error: ParserError("Expected: end of statement, found: ON at Line: 3, Column: 17")

Changes

  • src/cli/error_whitelist.rs: replace the Contains pattern with a RegexMatch that makes the location suffix optional, so it matches both forms:
    r#"SQL error: ParserError\("Expected: end of statement, found: ON( at Line: \d+, Column: \d+)?"\)"#
  • Add two unit tests:
    • the error is whitelisted with and without the location suffix
    • unrelated errors such as found: ONLY at ... are still not whitelisted

Testing

main this PR
Non-whitelisted errors 1 0
Whitelisted found: ON at Line ... errors 0 1
Oracle failures (all existing "mixed outcomes") 110 110

Newer sqlparser versions append the error location, e.g.
`found: ON at Line: 3, Column: 17`, so the existing `Contains` pattern
no longer matched and expected errors from `NATURAL JOIN ... ON` were
reported as non-whitelisted. Switch to a regex that accepts both forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant