Skip to content

Comments

adding scala 2.13 support for Livy#515

Open
rashmin405 wants to merge 4 commits intoapache:masterfrom
SimpleDataLabsInc:rashmin/git_livy_scala_213
Open

adding scala 2.13 support for Livy#515
rashmin405 wants to merge 4 commits intoapache:masterfrom
SimpleDataLabsInc:rashmin/git_livy_scala_213

Conversation

@rashmin405
Copy link

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.

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.
@gyogal
Copy link
Contributor

gyogal commented Feb 23, 2026

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.

2 participants