Skip to content

[SPARK-57717][SQL] Pin BIN_BY_ENABLED explicitly in BIN BY tests#56815

Open
vranes wants to merge 1 commit into
apache:masterfrom
vranes:bin-by-test-default-istesting
Open

[SPARK-57717][SQL] Pin BIN_BY_ENABLED explicitly in BIN BY tests#56815
vranes wants to merge 1 commit into
apache:masterfrom
vranes:bin-by-test-default-istesting

Conversation

@vranes

@vranes vranes commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The two BIN BY tests that assert the operator is rejected now pin spark.sql.binByRelationOperator.enabled explicitly (= false) via withSQLConf, instead of relying on the config's default:

  • BinBySuite and ResolveBinBySuite: 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 in withSQLConf(BIN_BY_ENABLED.key -> "false").
  • ResolveBinBySuite also drops the assert(!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.enabled default 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)

@MaxGekk MaxGekk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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."

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