Skip to content

Conversation

@mantovani
Copy link

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.

@mgaido91
Copy link
Contributor

the example is written in Java, not in Scala. I think you can close this PR, thanks.

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 {
Copy link
Member

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.

Copy link
Author

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.
@mantovani
Copy link
Author

I just changed to the right section.

@srowen
Copy link
Member

srowen commented Jan 31, 2018

IIRC extending App won't work, or didn't. The example is already correct.

@mantovani
Copy link
Author

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.

@vanzin
Copy link
Contributor

vanzin commented Jan 31, 2018

It's not just "will" work, it's working.

https://issues.apache.org/jira/browse/SPARK-4170

@mantovani
Copy link
Author

mantovani commented Jan 31, 2018 via email

@vanzin
Copy link
Contributor

vanzin commented Jan 31, 2018

Did you try it with Scala 2.10? That's still supported by Spark.

@mantovani
Copy link
Author

mantovani commented Jan 31, 2018 via email

@srowen
Copy link
Member

srowen commented Jan 31, 2018

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.

@mantovani
Copy link
Author

mantovani commented Feb 1, 2018 via email

@srowen
Copy link
Member

srowen commented Feb 1, 2018

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.

@mantovani
Copy link
Author

mantovani commented Feb 1, 2018 via email

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@srowen srowen mentioned this pull request May 11, 2018
@asfgit asfgit closed this in 348ddfd May 12, 2018
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
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.
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.

5 participants