Skip to content

[SPARK-59632][SQL] Unwrap reflected SQL Server parser exceptions - #58898

Open
alekjarmov wants to merge 1 commit into
apache:masterfrom
alekjarmov:alekjarmov/oss-runtime-pr-255979
Open

alekjarmov wants to merge 1 commit into
apache:masterfrom
alekjarmov:alekjarmov/oss-runtime-pr-255979

Conversation

@alekjarmov

@alekjarmov alekjarmov commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The SQL Server connection provider invokes the JDBC driver's URL parser through reflection. This change unwraps InvocationTargetException when the reflected parser throws and propagates the original exception.

Why are the changes needed?

Reflection wraps parser failures in InvocationTargetException, hiding the original structured JDBC exception details from callers. Propagating the cause preserves those details.

Does this PR introduce any user-facing change?

Yes. Failures from the SQL Server JDBC driver's reflected URL parser now surface as their original exceptions instead of InvocationTargetException wrappers.

How was this patch tested?

Added a test to MSSQLConnectionProviderSuite that verifies the exact original SQLException is propagated.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Cursor GPT-5.6 Sol

@alekjarmov alekjarmov changed the title [WIP][JDBC] Unwrap reflected SQL Server parser exceptions [WIP][SQL] Unwrap reflected SQL Server parser exceptions Sep 18, 2026
@alekjarmov alekjarmov changed the title [WIP][SQL] Unwrap reflected SQL Server parser exceptions [SPARK-59632][SQL] Unwrap reflected SQL Server parser exceptions Sep 18, 2026
@alekjarmov
alekjarmov marked this pull request as ready for review September 18, 2026 10:31

@cloud-fan cloud-fan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review summary

I found no code-review issues in the pinned change. The exception translation is confined to the existing reflected parser invocation and preserves successful parsing, missing-method fallback behavior, and unrelated reflection failures. The focused regression test rejects the previous InvocationTargetException behavior and verifies reference identity with the original SQLException.

Findings

0 total: 0 P0, 0 P1, 0 P2, 0 P3.

No findings.

@cloud-fan

Copy link
Copy Markdown
Contributor

let's make the CI green

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