[SPARK-59785][CONNECT][TESTS] Fix SparkConnectResultSetSuite failure when ANSI mode is off #59046
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 236 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #59046"
general
weight: 0.35
SEPURI-SAI-KRISHNA
What changes were proposed in this pull request?
This PR makes the test
next throws SQLException when the query fails during result streaminginSparkConnectResultSetSuiteenablespark.sql.ansi.enabledexplicitly for its JDBC session before running the query, instead of relying on the default ANSI setting.This follows the existing pattern in
SparkConnectJdbcDataTypeSuite, which enables session configs withstatement.execute("SET ...").Why are the changes needed?
The test was added in SPARK-57933. It runs
SELECT 10 / (5 - id) FROM range(10)and expects aDIVIDE_BY_ZEROerror (SQLSTATE 22012), which is only raised under ANSI mode. The Non-ANSI scheduled builds (master, branch-4.x and branch-4.3) setSPARK_ANSI_SQL_MODE=false, so the division returns NULL and the test fails every time:Each JDBC connection creates its own Spark Connect session (
SparkConnectConnection), andwithStatementopens a new connection, so the setting does not leak to other tests.Does this PR introduce _any_ user-facing change?
No. Test-only change.
How was this patch tested?
SPARK_ANSI_SQL_MODE=false build/sbt 'connect-client-jdbc/testOnly *SparkConnectResultSetSuite'fails with the same error as CI.SPARK_ANSI_SQL_MODE=falseandSPARK_ANSI_SQL_MODE=true(6 tests each).build/sbt 'connect-client-jdbc/test'with bothSPARK_ANSI_SQL_MODE=falseandSPARK_ANSI_SQL_MODE=true: all 65 tests passed each time.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)