[SPARK-56447][SHELL] Fix spark-shell REPL classpath initialization error#55305
Draft
jiwen624 wants to merge 1 commit intoapache:masterfrom
Draft
[SPARK-56447][SHELL] Fix spark-shell REPL classpath initialization error#55305jiwen624 wants to merge 1 commit intoapache:masterfrom
jiwen624 wants to merge 1 commit intoapache:masterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
In
Main.doMain, prependjava.class.pathto the-classpathargument passed to the REPL'sGenericRunnerSettings:Why are the changes needed?
$SPARK_HOME/bin/spark-shellfails with:This works in previous versions.
bin/spark-shellhas passed-Dscala.usejavacp=truesince SPARK-4161 to address exactly this behaviour. The mechanism is broken after SPARK-52587 which initializes the compiler before the classpath is set. The fix makes doMain explicitly include java.class.path in the -classpath argument, restoring correct behaviour regardless of how SparkILoop is constructed.Does this PR introduce any user-facing change?
Yes. spark-shell was broken with a compiler initialization error. This PR fixes it so spark-shell starts and evaluates
expressions correctly again.
How was this patch tested?
Added a unit test in ReplSuite that calls Main.doMain with Array.empty (no explicit -classpath argument) and verifies the output. This test fails on the unfixed code and passes after the fix.
Was this patch authored or co-authored using generative AI tooling?
No