Skip to content

[SPARK-56614][SQL][CONNECT][TESTS][FOLLOWUP] Pin strictDataFrameColumnResolution=true for lazy column validation test#55604

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:SPARK-strict-df-col-resolution-test-pin
Closed

[SPARK-56614][SQL][CONNECT][TESTS][FOLLOWUP] Pin strictDataFrameColumnResolution=true for lazy column validation test#55604
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:SPARK-strict-df-col-resolution-test-pin

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Pin spark.sql.analyzer.strictDataFrameColumnResolution=true around the body of the lazy column validation test in DataFrameSuite. The config is set via spark.conf.set/unset rather than withSQLConf because the lazy SQLConf entry trips withSQLConf's isModifiable check on the Connect server.

Why are the changes needed?

The test asserts that df4.schema throws AnalysisException for df1("x") when df1 does not contain x. This holds only under strict plan-id-based resolution; if the name-based fallback path is enabled, df1("x") resolves to df2.x from the join output and df4.schema succeeds. Today this works because STRICT_DATAFRAME_COLUMN_RESOLUTION defaults to true, but the test should not silently rely on that default; pinning it makes the assumption explicit and keeps the test robust against future default changes or environments where the default is overridden.

Does this PR introduce any user-facing change?

No. Test-only change.

How was this patch tested?

Existing DataFrameSuite."lazy column validation".

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

Generated-by: Claude Code (Anthropic), claude-opus-4-7

…nResolution=true for lazy column validation test

### What changes were proposed in this pull request?
Pin `spark.sql.analyzer.strictDataFrameColumnResolution=true` around the body of the `lazy column validation` test in `DataFrameSuite`. The config is set via `spark.conf.set/unset` rather than `withSQLConf` because the lazy SQLConf entry trips `withSQLConf`'s `isModifiable` check on the Connect server.

### Why are the changes needed?
The test asserts that `df4.schema` throws `AnalysisException` for `df1("x")` when `df1` does not contain `x`. This holds only under strict plan-id-based resolution; if the name-based fallback path is enabled, `df1("x")` resolves to `df2.x` from the join output and `df4.schema` succeeds. Today this works because `STRICT_DATAFRAME_COLUMN_RESOLUTION` defaults to `true`, but the test should not silently rely on that default; pinning it makes the assumption explicit and keeps the test robust against future default changes or environments where the default is overridden.

### Does this PR introduce _any_ user-facing change?
No. Test-only change.

### How was this patch tested?
Existing `DataFrameSuite."lazy column validation"`.

### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Anthropic), claude-opus-4-7
@zhengruifeng zhengruifeng marked this pull request as ready for review April 29, 2026 09:19
@zhengruifeng
Copy link
Copy Markdown
Contributor Author

merged to master

@zhengruifeng zhengruifeng deleted the SPARK-strict-df-col-resolution-test-pin branch April 29, 2026 10:20
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