Skip to content
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-24785] [SHELL] Making sure REPL prints Spark UI info and then Welcome message #21749

Closed
wants to merge 11 commits into from

Conversation

dbtsai
Copy link
Member

@dbtsai dbtsai commented Jul 11, 2018

What changes were proposed in this pull request?

After #21495 the welcome message is printed first, and then Scala prompt will be shown before the Spark UI info is printed.

Although it's a minor issue, but visually, it doesn't look as nice as the existing behavior. This PR intends to fix it by duplicating the Scala process code to arrange the printing order. However, one variable is private, so reflection has to be used which is not desirable.

We can use this PR to brainstorm how to handle it properly and how Scala can change their APIs to fit our need.

How was this patch tested?

Existing test

dbtsai added 7 commits June 28, 2018 15:33
Update LICENSE

Update JLine

update scala-parser-combinators

Error handling

Fix compilation

temp

Revert hack

remove hack
@SparkQA
Copy link

SparkQA commented Jul 11, 2018

Test build #92871 has finished for PR 21749 at commit b1e28e8.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


val field = classOf[ILoop].getDeclaredFields.filter(_.getName.contains("globalFuture")).head
field.setAccessible(true)
field.set(this, Future successful true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reflection has to be used to access private globalFuture in ILoop.

@SparkQA
Copy link

SparkQA commented Jul 11, 2018

Test build #92872 has finished for PR 21749 at commit f0a76a3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@felixcheung
Copy link
Member

agreed, it's not ideal to use reflection...

@felixcheung
Copy link
Member

@skonto perhaps you folks can give some guidance on this?

@skonto
Copy link
Contributor

skonto commented Jul 12, 2018

@felixcheung sure I will add this to our https://docs.google.com/document/d/1fbkjEL878witxVQpOCbjlvOvadHtVjYXeB-2mgzDTvk where we track remaining issues. Scala team already is discussing this with @dbtsai.

@dbtsai
Copy link
Member Author

dbtsai commented Aug 20, 2018

Ping @zsxwing @gatorsmile

@dbtsai
Copy link
Member Author

dbtsai commented Aug 21, 2018

@srowen

@srowen
Copy link
Member

srowen commented Aug 21, 2018

I am fairly neutral on whether to hack to support multiple Scala 2.11 versions, and 2.11.12, or just leave it at 2.11.8. I think this hack is pretty low risk because I can't see any more 2.11.x releases coming, and won't rebreak.

@dbtsai dbtsai changed the title [SPARK-24785] [SHELL] Making sure REPL prints Spark UI info and then Welcome message [SPARK-24785] [SHELL] [WIP] Consolidate REPL code between Scala 2.11 and Scala 2.12 Aug 21, 2018
@SparkQA
Copy link

SparkQA commented Aug 22, 2018

Test build #95052 has finished for PR 21749 at commit 8715fbe.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

This reverts commit 8715fbe.
@dbtsai dbtsai changed the title [SPARK-24785] [SHELL] [WIP] Consolidate REPL code between Scala 2.11 and Scala 2.12 [SPARK-24785] [SHELL] Making sure REPL prints Spark UI info and then Welcome message Aug 22, 2018
@dbtsai
Copy link
Member Author

dbtsai commented Aug 22, 2018

@srowen Scala 2.12 branch also has the wrong message printing order issue.

I don't know if I have enough time to finish the work on the consolidation of Scala 2.11 and 2.12 codebase before we cut 2.4, so I will work on it in another PR.

Can you help me to review this PR?

Thanks.

@SparkQA
Copy link

SparkQA commented Aug 22, 2018

Test build #95092 has finished for PR 21749 at commit b8c1837.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Aug 22, 2018

As it's more a cosmetic issue than anything, and reverting the Scala 2.12 change at least I think will be a problem, I'd suggest not reverting the scala version, but instead fixing forward. (Or at least, fix 2.11 but don't revert the 2.12 version, and accept that it has an issue.)

I'd love to unify the two Scala REPL source trees even if it costs some reflection. The change here looks OK on its surface; does it work?

Did you open another PR where you fully merged the source trees? I swear I just saw it last night but can't find the other PR now, if so. That would really be the right fix, even if it has to wait until after 2.4, or even after the first RC. We still have Scala 2.12 issues in flight that I really want to fix for 2.4.

@gatorsmile
Copy link
Member

Talked with @zsxwing . We do not need to revert the version bump, as long as this PR does not introduce a new regression.

BTW, merging to the RC branches should be treated as backporting to the previous releases.

@dbtsai
Copy link
Member Author

dbtsai commented Aug 22, 2018

@srowen It does work, and I have used it for my development recently. You should be able to build with my branch to test it out. I was trying to merge two source trees yesterday, and I realized I need more time to carefully test out the classloader issues, so I decided to take it out from this PR.

I have couple other tasks I want to deal with for 2.4 releases, and I will try to find time to work on it in RC period.

@gatorsmile That will be great. We were using very old version of Scala 2.11, and it's a good time to upgrade it.

@vanzin
Copy link
Contributor

vanzin commented Aug 22, 2018

The patch LGTM. I'd add a comment where Spark-specific code was inserted, so it's easy to find later. But ok as is too.

Not sure why it seems like a big deal to have the Scala libraries add an initialization hook to that class...

@dbtsai
Copy link
Member Author

dbtsai commented Aug 22, 2018

@vanzin Thanks for the reviewing. I'll merge it as it, and have another PR trying to merge 2.11 and 2.12 branches. I had a positive conversation with Scala community to add a proper hook for us, and they agreed with it.

@asfgit asfgit closed this in 2bc7b75 Aug 22, 2018
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.

7 participants