Skip to content

Conversation

@vanzin
Copy link
Contributor

@vanzin vanzin commented Dec 14, 2017

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

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").
@vanzin
Copy link
Contributor Author

vanzin commented Dec 14, 2017

@rxin I believe this is what you were trying to do?

@SparkQA
Copy link

SparkQA commented Dec 14, 2017

Test build #84890 has finished for PR 19974 at commit 4402fc7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


test("SPARK-22779: correctly compute default value for fallback configs") {
val fallback = SQLConf.buildConf("spark.sql.__test__.spark_22779")
.fallbackConf(SQLConf.PARQUET_COMPRESSION)
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@gatorsmile
Copy link
Member

LGTM

@gatorsmile
Copy link
Member

Thanks! Merged to master.

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.

4 participants