Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Jul 8, 2018

What changes were proposed in this pull request?

In the PR, I propose to extend RuntimeConfig by new method isModifiable() which returns true if a config parameter can be modified at runtime (for current session state). For static SQL and core parameters, the method returns false.

How was this patch tested?

Added new test to RuntimeConfigSuite for checking Spark core and SQL parameters.

MaxGekk added 2 commits July 8, 2018 21:28
In the PR, I propose to extend `RuntimeConfig` by new method `isModifiable()` which returns `true` if a config parameter can be modified at runtime (in notebooks). For static SQL and core parameters, the method returns `false`.
@ignore_unicode_prefix
@since(2.4)
def isModifiable(self, key):
"""Is the configuration property modifiable or not."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not make all doc comments across languages identical?

Copy link
Member Author

Choose a reason for hiding this comment

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

From which language would you prefer the comment? or maybe the comment should contain more information? Please, let me know if something is not clear, and we should explain that in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to change to:

Indicates that the configuration property with the given key modifiable in the current session or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor language tweak suggestion:

Indicates whether the configuration property with the given key is modifiable in the current session.

@SparkQA
Copy link

SparkQA commented Jul 8, 2018

Test build #92721 has finished for PR 21730 at commit b90dbf8.

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

@SparkQA
Copy link

SparkQA commented Jul 9, 2018

Test build #92722 has finished for PR 21730 at commit 465a5dd.

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


/**
* Indicates whether the configuration property with the given key
* is modifiable in the current session.
Copy link
Member

Choose a reason for hiding this comment

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

nit: If a key is not a valid conf, this function will still return false. Should we specify this in the comments?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added @return tag with this info.

Copy link
Member

@gengliangwang gengliangwang left a comment

Choose a reason for hiding this comment

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

LGTM. This is useful.

val conf = newConf()

// SQL configs
assert(!conf.isModifiable("spark.sql.sources.schemaStringLengthThreshold"))
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a case for nonexistent sql conf key?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a couple tests

@SparkQA
Copy link

SparkQA commented Jul 11, 2018

Test build #92886 has finished for PR 21730 at commit d0d4620.

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

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

LGTM. Merged to master

@asfgit asfgit closed this in 3ab48f9 Jul 12, 2018
@MaxGekk MaxGekk deleted the is-modifiable branch August 17, 2019 13:34
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.

5 participants