-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37504][PYTHON] Pyspark create SparkSession with existed session should not pass static conf #34757
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
Closed
Closed
[SPARK-37504][PYTHON] Pyspark create SparkSession with existed session should not pass static conf #34757
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
800a184
[SPARK-37054][PYSPARK] Pyspark create SparkSession with existed sessi…
AngersZhuuuu a91cdc9
reformat
AngersZhuuuu 85f9188
Update session.py
AngersZhuuuu 8a0f79c
Update session.py
AngersZhuuuu 5b406f5
Update session.py
AngersZhuuuu bc644ff
Update session.py
AngersZhuuuu 00b4c9a
update
AngersZhuuuu 2889e1f
update
AngersZhuuuu a7f4a51
Update SparkSession.scala
AngersZhuuuu af2185f
Update sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
AngersZhuuuu 93c429e
Update sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
AngersZhuuuu f6f06cc
Update SparkSession.scala
AngersZhuuuu 47480cf
update
AngersZhuuuu 8e66ec4
Update session.py
AngersZhuuuu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,8 +277,8 @@ def getOrCreate(self) -> "SparkSession": | |
| # Do not update `SparkConf` for existing `SparkContext`, as it's shared | ||
| # by all sessions. | ||
| session = SparkSession(sc, options=self._options) | ||
| for key, value in self._options.items(): | ||
| session._jsparkSession.sessionState().conf().setConfString(key, value) | ||
| else: | ||
| session._jvm.SparkSession.applyModifiableSettings(session._jsparkSession, self._options) | ||
| return session | ||
|
|
||
| builder = Builder() | ||
|
|
@@ -291,7 +291,7 @@ def __init__( | |
| self, | ||
| sparkContext: SparkContext, | ||
| jsparkSession: Optional[JavaObject] = None, | ||
| options: Optional[Dict[str, Any]] = {}, | ||
| options: Dict[str, Any] = {}, | ||
| ): | ||
| from pyspark.sql.context import SQLContext | ||
|
|
||
|
|
@@ -304,8 +304,11 @@ def __init__( | |
| and not self._jvm.SparkSession.getDefaultSession().get().sparkContext().isStopped() | ||
| ): | ||
| jsparkSession = self._jvm.SparkSession.getDefaultSession().get() | ||
| self._jvm.SparkSession.applyModifiableSettings(jsparkSession, options) | ||
| else: | ||
| jsparkSession = self._jvm.SparkSession(self._jsc.sc(), options) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall we add a short comment here that this is the case when we can set static configurations |
||
| else: | ||
| self._jvm.SparkSession.applyModifiableSettings(jsparkSession, options) | ||
| self._jsparkSession = jsparkSession | ||
| self._jwrapped = self._jsparkSession.sqlContext() | ||
| self._wrapped = SQLContext(self._sc, self, self._jwrapped) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.