-
Notifications
You must be signed in to change notification settings - Fork 29k
changed scala example from java "style" to scala #20458
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
Conversation
|
the example is written in Java, not in Scala. I think you can close this PR, thanks. |
docs/quick-start.md
Outdated
| String logFile = "YOUR_SPARK_HOME/README.md"; // Should be some file on your system | ||
| SparkSession spark = SparkSession.builder().appName("Simple Application").getOrCreate(); | ||
| Dataset<String> logData = spark.read().textFile(logFile).cache(); | ||
| public class SimpleApp extends App { |
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.
Yes, this isn't valid Java, and it's supposed to be Java. It was correct before.
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.
Sorry, I updated the wrong section.
updated the right section, Scala.
|
I just changed to the right section. |
|
IIRC extending App won't work, or didn't. The example is already correct. |
|
It's not just "will" work, it's working. I never said that it wasn't working, the Scala example was wrote using Java "style" not Scala "style" which . Which you don't create a main method but extends App. |
|
|
Hello Marcel,
This is an old bug and was fixed long time ago, I just runned the following
example and got the correct result:
DemoBug: rslt1 = 3 rslt2 = 3
Doesn't make sense use Java traditional way "main(...)" just because 4
years ago the "Scala approach" had a bug. Sometimes we can't use feature
because of bugs, it's fine but we should move on when they are fixed.
…On Wed, Jan 31, 2018 at 4:20 PM, Marcelo Vanzin ***@***.***> wrote:
It's not just "will" work, it's working.
https://issues.apache.org/jira/browse/SPARK-4170
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20458 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAC5fS39XmaJETebqFaYm7SzKOtDk1KVks5tQNkWgaJpZM4R0i6_>
.
--
--
Daniel de Oliveira Mantovani
Perl Evangelist/Data Hacker
+1 786 459 1341
|
|
Did you try it with Scala 2.10? That's still supported by Spark. |
|
I just tested with Scala 2.10.6 and Spark 2.1.1 and worked perfect. Since this patch won't be applied for Spark 1.x documentation, it would be fine.
18/01/31 17:21:28 INFO DAGScheduler: Job 1 finished: count at
Bootstrap.scala:14, took 0.024446 s
DemoBug: rslt1 = 3 rslt2 = 3
…On Wed, Jan 31, 2018 at 5:16 PM, Marcelo Vanzin ***@***.***> wrote:
Did you try it with Scala 2.10? That's still supported by Spark.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20458 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAC5fSAOjXpf1HNiOCQhx_BUL4GxaC4gks5tQOYggaJpZM4R0i6_>
.
--
--
Daniel de Oliveira Mantovani
Perl Evangelist/Data Hacker
+1 786 459 1341
|
|
Yeah, that's what I was thinking of. Subclasses of |
|
If I change all examples of the documentation will be accept ?
…On Wed, Jan 31, 2018 at 6:41 PM, Sean Owen ***@***.***> wrote:
Yeah, that's what I was thinking of. Subclasses of App don't necessarily
work in Spark (not just Scala). I don't know if that has changed as Spark
and Scala moved forward. While that's an interesting item to investigate,
here the question is changing one example to use App, while none of the
others do and there's a reason not to. We don't want to do that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20458 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAC5fXruoTYCd0hMD4wsXtMSNUYB-pz5ks5tQPohgaJpZM4R0i6_>
.
--
--
Daniel de Oliveira Mantovani
Perl Evangelist/Data Hacker
+1 786 459 1341
|
|
The point is that it won't always work in Spark, so, certainly not unless you test them. I just don't think it's worth it, especially as it's setting an expectation as an example that it is the best way to do it. |
|
Sean, I already tested. Can you please be more specific how should be the
tests ? I just tested on Spark 2.1.1 and Scala 2.11 and 2.10.
On Wed, Jan 31, 2018 at 19:19 Sean Owen ***@***.***> wrote:
The point is that it won't always work in Spark, so, certainly not unless
you test them. I just don't think it's worth it, especially as it's setting
an expectation as an example that it is the best way to do it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20458 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAC5fQJd6YYF8AI0tijFEkzDKExgiABUks5tQQL_gaJpZM4R0i6_>
.
--
…--
Daniel de Oliveira Mantovani
Perl Evangelist/Data Hacker
+1 786 459 1341
|
|
Can one of the admins verify this patch? |
Closes apache#20458 Closes apache#20530 Closes apache#20557 Closes apache#20966 Closes apache#20857 Closes apache#19694 Closes apache#18227 Closes apache#20683 Closes apache#20881 Closes apache#20347 Closes apache#20825 Closes apache#20078 Closes apache#21281 Closes apache#19951 Closes apache#20905 Closes apache#20635 Author: Sean Owen <[email protected]> Closes apache#21303 from srowen/ClosePRs.
What changes were proposed in this pull request?
I changed an example wrote in Scala using Java "style" to Scala "style".
How was this patch tested?
It's not necessary test, the language documentation should be enough. For the documentation propose.
http://www.scala-lang.org/api/2.9.2/scala/App.html
Please review http://spark.apache.org/contributing.html before opening a pull request.