Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,13 @@ We'll create a very simple Spark application, `SimpleApp.java`:
{% highlight java %}
/* SimpleApp.java */
import org.apache.spark.sql.SparkSession;
import org.apache.spark.sql.Dataset;

public class SimpleApp {
public static void main(String[] args) {
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();
Dataset<String> logData = spark.read().textFile(logFile).cache();

long numAs = logData.filter(s -> s.contains("a")).count();
long numBs = logData.filter(s -> s.contains("b")).count();
Expand Down Expand Up @@ -330,6 +331,10 @@ Note that Spark artifacts are tagged with a Scala version.
<name>Simple Project</name>
<packaging>jar</packaging>
<version>1.0</version>
<properties>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We're not giving the complete Maven config here, and Java 8 is required, so that's one of many pieces of config I think we assume the user will fill in. (Anyway, this is probably better specified by configuring the compiler plugin directly)?

But I agree with the two changes above. Any other bits of Java example with a similar problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Any other bits of Java example with a similar problem?

Not that I'm currently aware of.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see two other instances in structured-streaming-programming-guide.md around line 1044.
If you can address those and remove this stanza, I'll merge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you can address those and remove this stanza, I'll merge.

This is done.

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
Expand Down