-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22779][sql] Resolve default values for fallback configs. #19974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SQLConf allows some callers to define a custom default value for configs, and that complicates a little bit the handling of fallback config entries, since most of the default value resolution is hidden by the config code. This change peaks into the internals of these fallback configs to figure out the correct default value, and also returns the current human-readable default when showing the default value (e.g. through "set -v").
|
@rxin I believe this is what you were trying to do? |
|
Test build #84890 has finished for PR 19974 at commit
|
|
|
||
| test("SPARK-22779: correctly compute default value for fallback configs") { | ||
| val fallback = SQLConf.buildConf("spark.sql.__test__.spark_22779") | ||
| .fallbackConf(SQLConf.PARQUET_COMPRESSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In SQLConf, all our conf are TypedConfigBuilder, instead of ConfigBuilder. The type-safe ConfigBuilder is unable to call fallbackConf , right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea sounds like this PR is fixing a non-existing issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true no existing config uses this, but Reynold was trying to fix this so my guess is he's trying to add one and it wasn't working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at least this is good for renaming. In the future, if we rename the SQLConf, we can use this mechanism.
|
LGTM |
|
Thanks! Merged to master. |
SQLConf allows some callers to define a custom default value for
configs, and that complicates a little bit the handling of fallback
config entries, since most of the default value resolution is
hidden by the config code.
This change peaks into the internals of these fallback configs
to figure out the correct default value, and also returns the
current human-readable default when showing the default value
(e.g. through "set -v").