John Zhuge created SPARK-62297:
----------------------------------
Summary: Generalize <key>.defaultList for class-list configs
Key: SPARK-62297
URL: https://issues.apache.org/jira/browse/SPARK-62297
Project: Spark
Issue Type: Umbrella
Components: SQL, Spark Core
Affects Versions: 4.5.0
Reporter: John Zhuge
SPARK-60483 added {{spark.sql.extensions.defaultList}} so a platform can ship
default session extensions without users having to repeat them when they set
{{spark.sql.extensions}}. During review (apache/spark#59743) [~sarutak] asked
whether this should become a general mechanism. Other class-list configs have
the same problem: admins and users write to the same key, so a user value
silently drops the platform defaults. SPARK-37602 is the same request for
{{spark.extraListeners}}.
h3. Spec (the behaviors agreed on #59743)
# {{get}} / {{SET}} on the parent key shows only the parent's raw value. The
default list is not folded into it.
# The effective list is {{defaultList}} entries first, then the user list, with
last-win dedup: a class in both lists is applied once, at the user's position,
and logs one warning per shared class. Duplicates within a single list are kept
as listed.
# {{spark.plugins}} keeps its existing {{.distinct}} behavior and is documented
as the exception.
The {{.defaultList}} key is static when the parent is static.
h3. Proposed work
# Follow-up tests for {{spark.sql.extensions.defaultList}} (SPARK-61843).
# A {{ConfigBuilder}} helper for {{Seq[String]}} class-list configs that
registers the companion {{<key>.defaultList}} entry (matching static-ness,
generated doc text, version) and one shared merge function. {{withPrepended}}
is not reused: it concatenates into the parent value, which breaks rule 1, and
it stays for string configs such as java options and class path.
{{spark.sql.extensions.defaultList}} moves onto the helper with no behavior
change.
# Apply it to {{spark.extraListeners}} (SPARK-37602),
{{spark.sql.queryExecutionListeners}}, and
{{spark.sql.streaming.streamingQueryListeners}}.
# A test in the style of {{SparkConfigBindingPolicySuite}} that every
{{*.defaultList}} key is registered, matches the parent's static-ness, and is
referenced in the parent's doc.
h3. Non-goals
This composes defaults; it does not enforce them. A user can still set the
{{.defaultList}} key, so admin-owned enforcement (the concern raised on #34856)
is out of scope.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]