-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-51254][PYTHON][CONNECT] Disallow --master with Spark Connect URL #50000
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,6 +508,11 @@ def getOrCreate(self) -> "SparkSession": | |
|
||
if url is None and is_api_mode_connect: | ||
url = opts.get("spark.master", os.environ.get("MASTER", "local")) | ||
if url.startswith("sc://"): | ||
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. instead of a bandaid fix, can we refactor the code to have different branches for 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. The problem is that this is Python specific. Spark Connect Server is launched without Spark Submit itself. For other cases, the exceptions are covered via |
||
raise PySparkRuntimeError( | ||
errorClass="MASTER_URL_INVALID", | ||
messageParameters={}, | ||
) | ||
|
||
if url is None: | ||
raise PySparkRuntimeError( | ||
|
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.
shouldn't we already have a error condition for it? How do we validate MASTER url before without Spark Connect?
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.
We actually don't have the error class (and even if there is, that has to be listed in JVM's error class JSON file). The error is thrown from
prepareSubmitEnvironment
atcore/src/main/scala/org/apache/spark/deploy/SparkSubmit
.