[SPARK-57717][SQL] Pin BIN_BY_ENABLED explicitly in BIN BY tests#56815
[SPARK-57717][SQL] Pin BIN_BY_ENABLED explicitly in BIN BY tests#56815vranes wants to merge 1 commit into
Conversation
MaxGekk
left a comment
There was a problem hiding this comment.
0 blocking, 0 non-blocking, 1 nit. LGTM — clean test-only change pinning BIN_BY_ENABLED -> false explicitly in the two BIN BY rejection tests instead of relying on the config default, mirroring the suite's existing withSQLConf pinning convention. Behavior is preserved (both still assert UNSUPPORTED_FEATURE.BIN_BY), the super.test escape-then-pin ordering is correct, and the renamed test names accurately describe the pinned-disabled scenario. Removing the assert(!getConf(BIN_BY_ENABLED)) default-value check is the right call — tests shouldn't assert config defaults.
Nits (1)
ResolveBinBySuite.scala: the override comment reads "to escape this wrapper and pins the flag off" — "pins" should be the infinitive "pin" to agree with "escape". See inline.
| // BIN BY is gated off by default; run the resolution tests with it enabled. The dedicated | ||
| // gate test below uses `super.test` to observe the default-off behavior. | ||
| // Run the resolution tests with the operator enabled. The dedicated gate test below uses | ||
| // `super.test` to escape this wrapper and pins the flag off. |
There was a problem hiding this comment.
Nit: "uses super.test to escape this wrapper and pins the flag off" coordinates the infinitive "escape" with the finite "pins". Read it as "…to escape this wrapper and pin the flag off."
What changes were proposed in this pull request?
The two BIN BY tests that assert the operator is rejected now pin
spark.sql.binByRelationOperator.enabledexplicitly (= false) viawithSQLConf, instead of relying on the config's default:BinBySuiteandResolveBinBySuite: the "BIN BY is gated off by default" cases are renamed to "BIN BY is rejected when the operator is disabled" and wrap the query inwithSQLConf(BIN_BY_ENABLED.key -> "false").ResolveBinBySuitealso drops theassert(!SQLConf.get.getConf(BIN_BY_ENABLED))check, which asserted the default value directly.No production code changes; the config default stays
false.Why are the changes needed?
Tests should not depend on a config's default value. A case that runs without pinning the flag fails in any environment that flips the config on (for example a config-flip CI lane), even though the behavior under test is unchanged. Pinning the flag explicitly keeps the suites self-contained and stable across those lanes.
Does this PR introduce any user-facing change?
No. Test-only change; the
spark.sql.binByRelationOperator.enableddefault is unchanged.How was this patch tested?
Ran the updated suites locally:
build/sbt 'catalyst/testOnly *ResolveBinBySuite'(17 tests, all pass)build/sbt 'sql/testOnly *BinBySuite'(3 tests, all pass)scalastyle is clean for both modules.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)