Skip to content

refactor: group orphan spark.comet.explain.* configs under one prefix#5026

Open
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:rename-explain-configs
Open

refactor: group orphan spark.comet.explain.* configs under one prefix#5026
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:rename-explain-configs

Conversation

@andygrove

Copy link
Copy Markdown
Member

Summary

Part of #4978 (Category 3).

Three explain-related boolean flags lived at the top level while their close
siblings (format, native.enabled, rules) already sat under
spark.comet.explain.*. This PR moves them under the group so the config
namespace is discoverable and consistent.

Rename table

Old key New key
spark.comet.explainFallback.enabled spark.comet.explain.fallback.enabled
spark.comet.explainCodegen.enabled spark.comet.explain.codegen.enabled
spark.comet.logFallbackReasons.enabled spark.comet.explain.fallback.log.enabled

For the placement question raised by the issue on logFallbackReasons
(either explain.fallback.log.enabled or fallback.log.enabled), I went with
explain.fallback.log.enabled. logFallbackReasons and explainFallback are
the two fallback-reason reporters — one aggregated WARN vs one WARN per
reason — so nesting the "log every reason" variant under the same
.explain.fallback.* parent makes the pairing visible in tab-completion and
docs.

Every renamed key is registered via .withAlternative(...), so existing user
configurations keep working (a one-time deprecation warning is logged per old
key). No behavior change.

Not in this PR

  • The ENABLE_COMET_LOG_FALLBACK_REASONS env var is preserved as-is. There is
    no alias mechanism for env vars, and renaming it would silently break users
    who set it in their launcher configs.
  • The dev/diffs/iceberg/*.diff files still reference the old string keys.
    They keep working through aliases, and the shuffle rename PR (refactor: unify shuffle configs under spark.comet.shuffle.* prefix #4986) took
    the same approach — regenerating those diffs is out of scope here.

Val rename

val COMET_LOG_FALLBACK_REASONS is renamed to
COMET_EXPLAIN_FALLBACK_LOG_ENABLED to match the new key (the two sibling
vals already had matching names, so only this one moved).

Test plan

  • ./mvnw -Pspark-3.5 test -pl spark -Dsuites="org.apache.comet.CometConfSuite" — 10 tests pass (including 3 new alias tests)
  • ./mvnw -Pspark-3.5 -pl spark spotless:check — clean
  • ./mvnw -Pspark-3.5 -pl spark test-compile — clean
  • CI runs the broader test matrix

Three explain-related boolean flags lived at the top level while their
close siblings (`format`, `native.enabled`, `rules`) already sat under
`spark.comet.explain.*`. Move them under the group:

  - `spark.comet.explainFallback.enabled`
      -> `spark.comet.explain.fallback.enabled`
  - `spark.comet.explainCodegen.enabled`
      -> `spark.comet.explain.codegen.enabled`
  - `spark.comet.logFallbackReasons.enabled`
      -> `spark.comet.explain.fallback.log.enabled`

`logFallbackReasons` and `explainFallback` are the two fallback-reason
reporters (aggregated single WARN vs one WARN per reason); putting them
both under `.explain.fallback.*` makes the relationship visible.

Old keys keep working via `.withAlternative(...)` and log a one-time
deprecation warning when read. The `ENABLE_COMET_LOG_FALLBACK_REASONS`
env var is preserved as-is.

The `val COMET_LOG_FALLBACK_REASONS` is renamed to
`COMET_EXPLAIN_FALLBACK_LOG_ENABLED` to match the new key; the two
sibling vals already had matching names.

Part of apache#4978 (Category 3).
@andygrove andygrove added this to the 1.0.0 milestone Jul 24, 2026
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.

1 participant