Open
Conversation
Root Cause Analysis: Livy Scala 2.13 Statement Execution Failure
Prophecy's Scala init code (DetectSparkProvider) contains blank lines (\n\n) between statements — e.g., between the closing } of the object definition and the DetectSparkProvider.detectSparkProvider() call. Livy's AbstractSparkInterpreter.executeLines() splits submitted code by \n and interprets each line individually via IMain.interpret(). When it encounters an empty line (""), the Scala 2.13 REPL (rewritten with JLine 3 in scala/scala#8036) returns Results.Error for the empty input, whereas the Scala 2.12 REPL silently accepted it. This caused executeLines to immediately return ExecuteError("Error", "", []) — the exact empty-error response observed. Manual curl tests passed because they used single \n (no blank lines). The fix skips blank/empty lines in executeLine(), treating them as no-ops, consistent with standard REPL :paste mode semantics.
Root Cause Analysis: Livy Scala 2.13 Statement Execution Failure
Prophecy's Scala init code (DetectSparkProvider) contains blank lines (\n\n) between statements — e.g., between the closing } of the object definition and the DetectSparkProvider.detectSparkProvider() call. Livy's AbstractSparkInterpreter.executeLines() splits submitted code by \n and interprets each line individually via IMain.interpret(). When it encounters an empty line (""), the Scala 2.13 REPL (rewritten with JLine 3 in scala/scala#8036) returns Results.Error for the empty input, whereas the Scala 2.12 REPL silently accepted it. This caused executeLines to immediately return ExecuteError("Error", "", []) — the exact empty-error response observed. Manual curl tests passed because they used single \n (no blank lines). The fix skips blank/empty lines in executeLine(), treating them as no-ops, consistent with standard REPL :paste mode semantics.
Contributor
|
Thanks for sharing your changes @rashmin405 ! Could you please open a JIRA for this at issues.apache.org and add unit/integration test runs at https://github.com/apache/incubator-livy/blob/master/.github/workflows/unit-tests.yaml#L33 and https://github.com/apache/incubator-livy/blob/master/.github/workflows/integration-tests.yaml#L32 ? |
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?
(Please fill in changes proposed in this fix)
(Include a link to the associated JIRA and make sure to add a link to this pr on the JIRA as well)
How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
Please review https://livy.incubator.apache.org/community/ before opening a pull request.