[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-19 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/14234


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71090897
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -65,11 +51,13 @@ val words = lines.as[String].flatMap(_.split(" "))
 val wordCounts = words.groupBy("value").count()
 {% endhighlight %}
 
-This `lines` DataFrame represents an unbounded table containing the 
streaming text data. This table contains one column of strings named 
“value”, and each line in the streaming text data becomes a row in the 
table. Note, that this is not currently receiving any data as we are just 
setting up the transformation, and have not yet started it. Next, we have 
converted the DataFrame to a  Dataset of String using `.as(Encoders.STRING())`, 
so that we can apply the `flatMap` operation to split each line into multiple 
words. The resultant `words` Dataset contains all the words. Finally, we have 
defined the `wordCounts` DataFrame by grouping by the unique values in the 
Dataset and counting them. Note that this is a streaming DataFrame which 
represents the running word counts of the stream.
--- End diff --

Scala snippet uses `.as[String]` while Java's uses `.as(Encoders.STRING())`.
In Scala context, it is weird to read "we have converted the DataFrame to a 
 Dataset of String using `.as(Encoders.STRING())`" while *we* actually used 
`.as[String]`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71090763
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

Done
Now it renders like


![image](https://cloud.githubusercontent.com/assets/8685962/16903373/9b28e956-4c7c-11e6-8c20-a2154d238761.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71087433
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -65,11 +51,13 @@ val words = lines.as[String].flatMap(_.split(" "))
 val wordCounts = words.groupBy("value").count()
 {% endhighlight %}
 
-This `lines` DataFrame represents an unbounded table containing the 
streaming text data. This table contains one column of strings named 
“value”, and each line in the streaming text data becomes a row in the 
table. Note, that this is not currently receiving any data as we are just 
setting up the transformation, and have not yet started it. Next, we have 
converted the DataFrame to a  Dataset of String using `.as(Encoders.STRING())`, 
so that we can apply the `flatMap` operation to split each line into multiple 
words. The resultant `words` Dataset contains all the words. Finally, we have 
defined the `wordCounts` DataFrame by grouping by the unique values in the 
Dataset and counting them. Note that this is a streaming DataFrame which 
represents the running word counts of the stream.
--- End diff --

Is that change valid -- not sure either way but can you show why? Both are 
valid in Java and Scala


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71087415
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

OK the code still renders? hm, maybe these really are vestigial. The 
"First.." and "Next..." text does not belong within any code div. It belongs 
outside and between them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71087402
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
--- End diff --

Add spaces rather than remove them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71081040
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

 Before | After
--|-

![image](https://cloud.githubusercontent.com/assets/8685962/16900343/dc61ee0e-4c22-11e6-8ae3-58b7f6d70ca6.png)
 | 
![image](https://cloud.githubusercontent.com/assets/8685962/16900349/014fd1b8-4c23-11e6-882f-4421cbfbb5fe.png)

# Before
- "First, we have to ..." should be moved to the corresponding code block
- The "Next, let's create ..." paragraph is repeated twice


![image](https://cloud.githubusercontent.com/assets/8685962/16900343/dc61ee0e-4c22-11e6-8ae3-58b7f6d70ca6.png)


# After

![image](https://cloud.githubusercontent.com/assets/8685962/16900349/014fd1b8-4c23-11e6-882f-4421cbfbb5fe.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71080823
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
--- End diff --

It changes "Scala/ Java/ Python" to "Scala/Java/Python"; when `/` is used 
as and/or, it comes with no spaces around.
This is happening everywhere, shall I revert it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71080656
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

It renders like this, is it okay?


![image](https://cloud.githubusercontent.com/assets/8685962/16900231/447f728a-4c1f-11e6-8d2d-2b3e4a06cc44.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71077854
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -410,26 +398,21 @@ see how this model handles event-time based 
processing and late arriving data.
 ## Handling Event-time and Late Data
 Event-time is the time embedded in the data itself. For many applications, 
you may want to operate on this event-time. For example, if you want to get the 
number of events generated by IoT devices every minute, then you probably want 
to use the time when the data was generated (that is, event-time in the data), 
rather than the time Spark receives them. This event-time is very naturally 
expressed in this model -- each event from the devices is a row in the table, 
and event-time is a column value in the row. This allows window-based 
aggregations (e.g. number of event every minute) to be just a special type of 
grouping and aggregation on the even-time column -- each time window is a group 
and each row can belong to multiple windows/groups. Therefore, such 
event-time-window-based aggregation queries can be defined consistently on both 
a static dataset (e.g. from collected device events logs) as well as on a data 
stream, making the life of the user much easier.
 
-Furthermore this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
+Furthermore, this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
 
 ## Fault Tolerance Semantics
 Delivering end-to-end exactly-once semantics was one of key goals behind 
the design of Structured Streaming. To achieve that, we have designed the 
Structured Streaming sources, the sinks and the execution engine to reliably 
track the exact progress of the processing so that it can handle any kind of 
failure by restarting and/or reprocessing. Every streaming source is assumed to 
have offsets (similar to Kafka offsets, or Kinesis sequence numbers)
 to track the read position in the stream. The engine uses checkpointing 
and write ahead logs to record the offset range of the data being processed in 
each trigger. The streaming sinks are designed to be idempotent for handling 
reprocessing. Together, using replayable sources and idempotant sinks, 
Structured Streaming can ensure **end-to-end exactly-once semantics** under any 
failure.
 
 # API using Datasets and DataFrames
-Since Spark 2.0, DataFrames and Datasets can represent static, bounded 
data, as well as streaming, unbounded data. Similar to static 
Datasets/DataFrames, you can use the common entry point `SparkSession` (
-[Scala](api/scala/index.html#org.apache.spark.sql.SparkSession)/
--- End diff --

Add spaces rather than remove them


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71077849
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-Next, let’s create a streaming DataFrame that represents text data 
received from a server listening on localhost:, and transform the DataFrame 
to calculate word counts.
-
-
-
+First, we have to import the necessary classes and create a local 
SparkSession, the starting point of all functionalities related to Spark.
--- End diff --

Does not belong solely in the Scala block


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71077847
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
--- End diff --

This just put all this text on one line? we shoudln't do that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-17 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71077843
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

I think this breaks the page. These are the bits where plugins fill in the 
code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073776
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -1093,12 +1067,10 @@ spark.streams().awaitAnyTermination()   # block 
until any one of them terminates
 
 
 
-Finally, for asynchronous monitoring of streaming queries, you can create 
and attach a `StreamingQueryListener` (

-[Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryListener)/

-[Java](api/java/org/apache/spark/sql/streaming/StreamingQueryListener.html) 
docs), which will give you regular callback-based updates when queries are 
started and terminated.
+Finally, for asynchronous monitoring of streaming queries, you can create 
and attach a `StreamingQueryListener` 
([Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryListener)/[Java](api/java/org/apache/spark/sql/streaming/StreamingQueryListener.html)
 docs), which will give you regular callback-based updates when queries are 
started and terminated.
 
 ## Recovering from Failures with Checkpointing 
-In case of a failure or intentional shutdown, you can recover the previous 
progress and state of a previous query, and continue where it left off. This is 
done using checkpointing and write ahead logs. You can configure a query with a 
checkpoint location, and the query will save all the progress information (i.e. 
range of offsets processed in each trigger), and the running aggregates (e.g. 
word counts in the quick example) will be saved the checkpoint location. As of 
Spark 2.0, this checkpoint location has to be a path in a HDFS compatible file 
system, and can be set as an option in the DataStreamWriter when [starting a 
query](#starting-streaming-queries). 
--- End diff --

Added anchor `[quick example](#quick-example)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073767
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -620,16 +603,14 @@ df.groupBy("type").count()
 ### Window Operations on Event Time
 Aggregations over a sliding event-time window are straightforward with 
Structured Streaming. The key idea to understand about window-based 
aggregations are very similar to grouped aggregations. In a grouped 
aggregation, aggregate values (e.g. counts) are maintained for each unique 
value in the user-specified grouping column. In case of window-based 
aggregations, aggregate values are maintained for each window the event-time of 
a row falls into. Let's understand this with an illustration. 
 
-Imagine our quick example is modified and the stream now contains lines 
along with the time when the line was generated. Instead of running word 
counts, we want to count words within 10 minute windows, updating every 5 
minutes. That is, word counts in words received between 10 minute windows 12:00 
- 12:10, 12:05 - 12:15, 12:10 - 12:20, etc. Note that 12:00 - 12:10 means data 
that arrived after 12:00 but before 12:10. Now, consider a word that was 
received at 12:07. This word should increment the counts corresponding to two 
windows 12:00 - 12:10 and 12:05 - 12:15. So the counts will be indexed by both, 
the grouping key (i.e. the word) and the window (can be calculated from the 
event-time).
--- End diff --

Added anchor `[quick example](#quick-example)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073763
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -519,10 +502,10 @@ csvDF = spark \
 
 
 
-These examples generate streaming DataFrames that are untyped, meaning 
that the schema of the DataFrame is not checked at compile time, only checked 
at runtime when the query is submitted. Some operations like `map`, `flatMap`, 
etc. need the type to be known at compile time. To do those, you can convert 
these untyped streaming DataFrames to typed streaming Datasets using the same 
methods as static DataFrame. See the SQL Programming Guide for more details. 
Additionally, more details on the supported streaming sources are discussed 
later in the document.
--- End diff --

Added link `[SQL Programming Guide](sql-programming-guide.html)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073751
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -439,7 +422,7 @@ Here are some examples.
 
 
 {% highlight scala %}
-val spark: SparkSession = … 
--- End diff --

Using same convention; it is `...` everywhere


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073746
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -410,26 +398,21 @@ see how this model handles event-time based 
processing and late arriving data.
 ## Handling Event-time and Late Data
 Event-time is the time embedded in the data itself. For many applications, 
you may want to operate on this event-time. For example, if you want to get the 
number of events generated by IoT devices every minute, then you probably want 
to use the time when the data was generated (that is, event-time in the data), 
rather than the time Spark receives them. This event-time is very naturally 
expressed in this model -- each event from the devices is a row in the table, 
and event-time is a column value in the row. This allows window-based 
aggregations (e.g. number of event every minute) to be just a special type of 
grouping and aggregation on the even-time column -- each time window is a group 
and each row can belong to multiple windows/groups. Therefore, such 
event-time-window-based aggregation queries can be defined consistently on both 
a static dataset (e.g. from collected device events logs) as well as on a data 
stream, making the life of the user much easier.
 
-Furthermore this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
+Furthermore, this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
 
 ## Fault Tolerance Semantics
 Delivering end-to-end exactly-once semantics was one of key goals behind 
the design of Structured Streaming. To achieve that, we have designed the 
Structured Streaming sources, the sinks and the execution engine to reliably 
track the exact progress of the processing so that it can handle any kind of 
failure by restarting and/or reprocessing. Every streaming source is assumed to 
have offsets (similar to Kafka offsets, or Kinesis sequence numbers)
 to track the read position in the stream. The engine uses checkpointing 
and write ahead logs to record the offset range of the data being processed in 
each trigger. The streaming sinks are designed to be idempotent for handling 
reprocessing. Together, using replayable sources and idempotant sinks, 
Structured Streaming can ensure **end-to-end exactly-once semantics** under any 
failure.
 
 # API using Datasets and DataFrames
-Since Spark 2.0, DataFrames and Datasets can represent static, bounded 
data, as well as streaming, unbounded data. Similar to static 
Datasets/DataFrames, you can use the common entry point `SparkSession` (
-[Scala](api/scala/index.html#org.apache.spark.sql.SparkSession)/
-[Java](api/java/org/apache/spark/sql/SparkSession.html)/
-[Python](api/python/pyspark.sql.html#pyspark.sql.SparkSession) docs) to 
create streaming DataFrames/Datasets from streaming sources, and apply the same 
operations on them as static DataFrames/Datasets. If you are not familiar with 
Datasets/DataFrames, you are strongly advised to familiarize yourself with them 
using the 
+Since Spark 2.0, DataFrames and Datasets can represent static, bounded 
data, as well as streaming, unbounded data. Similar to static 
Datasets/DataFrames, you can use the common entry point `SparkSession` 
([Scala](api/scala/index.html#org.apache.spark.sql.SparkSession)/[Java](api/java/org/apache/spark/sql/SparkSession.html)/[Python](api/python/pyspark.sql.html#pyspark.sql.SparkSession)
 docs) to create streaming DataFrames/Datasets from streaming sources, and 
apply the same operations on them as static DataFrames/Datasets. If you are not 
familiar with Datasets/DataFrames, you are strongly advised to familiarize 
yourself with them using the 
 [DataFrame/Dataset Programming Guide](sql-programming-guide.html).
 
 ## Creating streaming DataFrames and streaming Datasets
 Streaming DataFrames can be created through the `DataStreamReader` 
interface 

-([Scala](api/scala/index.html#org.apache.spark.sql.streaming.DataStreamReader)/
-[Java](api/java/org/apache/spark/sql/streaming/DataStreamReader.html)/


[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073739
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -410,26 +398,21 @@ see how this model handles event-time based 
processing and late arriving data.
 ## Handling Event-time and Late Data
 Event-time is the time embedded in the data itself. For many applications, 
you may want to operate on this event-time. For example, if you want to get the 
number of events generated by IoT devices every minute, then you probably want 
to use the time when the data was generated (that is, event-time in the data), 
rather than the time Spark receives them. This event-time is very naturally 
expressed in this model -- each event from the devices is a row in the table, 
and event-time is a column value in the row. This allows window-based 
aggregations (e.g. number of event every minute) to be just a special type of 
grouping and aggregation on the even-time column -- each time window is a group 
and each row can belong to multiple windows/groups. Therefore, such 
event-time-window-based aggregation queries can be defined consistently on both 
a static dataset (e.g. from collected device events logs) as well as on a data 
stream, making the life of the user much easier.
 
-Furthermore this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
+Furthermore, this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
 
 ## Fault Tolerance Semantics
 Delivering end-to-end exactly-once semantics was one of key goals behind 
the design of Structured Streaming. To achieve that, we have designed the 
Structured Streaming sources, the sinks and the execution engine to reliably 
track the exact progress of the processing so that it can handle any kind of 
failure by restarting and/or reprocessing. Every streaming source is assumed to 
have offsets (similar to Kafka offsets, or Kinesis sequence numbers)
 to track the read position in the stream. The engine uses checkpointing 
and write ahead logs to record the offset range of the data being processed in 
each trigger. The streaming sinks are designed to be idempotent for handling 
reprocessing. Together, using replayable sources and idempotant sinks, 
Structured Streaming can ensure **end-to-end exactly-once semantics** under any 
failure.
 
 # API using Datasets and DataFrames
-Since Spark 2.0, DataFrames and Datasets can represent static, bounded 
data, as well as streaming, unbounded data. Similar to static 
Datasets/DataFrames, you can use the common entry point `SparkSession` (
-[Scala](api/scala/index.html#org.apache.spark.sql.SparkSession)/
--- End diff --

many cases like this later


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073736
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -410,26 +398,21 @@ see how this model handles event-time based 
processing and late arriving data.
 ## Handling Event-time and Late Data
 Event-time is the time embedded in the data itself. For many applications, 
you may want to operate on this event-time. For example, if you want to get the 
number of events generated by IoT devices every minute, then you probably want 
to use the time when the data was generated (that is, event-time in the data), 
rather than the time Spark receives them. This event-time is very naturally 
expressed in this model -- each event from the devices is a row in the table, 
and event-time is a column value in the row. This allows window-based 
aggregations (e.g. number of event every minute) to be just a special type of 
grouping and aggregation on the even-time column -- each time window is a group 
and each row can belong to multiple windows/groups. Therefore, such 
event-time-window-based aggregation queries can be defined consistently on both 
a static dataset (e.g. from collected device events logs) as well as on a data 
stream, making the life of the user much easier.
 
-Furthermore this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
+Furthermore, this model naturally handles data that has arrived later than 
expected based on its event-time. Since Spark is updating the Result Table, it 
has full control over updating/cleaning up the aggregates when there is late 
data. While not yet implemented in Spark 2.0, event-time watermarking will be 
used to manage this data. These are explained later in more details in the 
[Window Operations](#window-operations-on-event-time) section.
 
 ## Fault Tolerance Semantics
 Delivering end-to-end exactly-once semantics was one of key goals behind 
the design of Structured Streaming. To achieve that, we have designed the 
Structured Streaming sources, the sinks and the execution engine to reliably 
track the exact progress of the processing so that it can handle any kind of 
failure by restarting and/or reprocessing. Every streaming source is assumed to 
have offsets (similar to Kafka offsets, or Kinesis sequence numbers)
 to track the read position in the stream. The engine uses checkpointing 
and write ahead logs to record the offset range of the data being processed in 
each trigger. The streaming sinks are designed to be idempotent for handling 
reprocessing. Together, using replayable sources and idempotant sinks, 
Structured Streaming can ensure **end-to-end exactly-once semantics** under any 
failure.
 
 # API using Datasets and DataFrames
-Since Spark 2.0, DataFrames and Datasets can represent static, bounded 
data, as well as streaming, unbounded data. Similar to static 
Datasets/DataFrames, you can use the common entry point `SparkSession` (
-[Scala](api/scala/index.html#org.apache.spark.sql.SparkSession)/
--- End diff --

( Scala/ Java/ Python docs) to (Scala/Java/Python docs)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073721
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -223,7 +211,7 @@ $ ./bin/run-example 
org.apache.spark.examples.sql.streaming.JavaStructuredNetwor
 {% endhighlight %}
 
 
- {% highlight bash %}   
--- End diff --

The trailing spaces add unnecessary line to the snippet


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073714
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -65,11 +51,13 @@ val words = lines.as[String].flatMap(_.split(" "))
 val wordCounts = words.groupBy("value").count()
 {% endhighlight %}
 
-This `lines` DataFrame represents an unbounded table containing the 
streaming text data. This table contains one column of strings named 
“value”, and each line in the streaming text data becomes a row in the 
table. Note, that this is not currently receiving any data as we are just 
setting up the transformation, and have not yet started it. Next, we have 
converted the DataFrame to a  Dataset of String using `.as(Encoders.STRING())`, 
so that we can apply the `flatMap` operation to split each line into multiple 
words. The resultant `words` Dataset contains all the words. Finally, we have 
defined the `wordCounts` DataFrame by grouping by the unique values in the 
Dataset and counting them. Note that this is a streaming DataFrame which 
represents the running word counts of the stream.
--- End diff --

`.as(Encoders.STRING())`, java's, changed to `.as[String]`, scala's


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073700
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -82,8 +70,6 @@ SparkSession spark = SparkSession
 .builder()
 .appName("JavaStructuredNetworkWordCount")
 .getOrCreate();
-
-import spark.implicits._
--- End diff --

Moved to `Scala` snippet


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
Github user ahmed-mahran commented on a diff in the pull request:

https://github.com/apache/spark/pull/14234#discussion_r71073691
  
--- Diff: docs/structured-streaming-programming-guide.md ---
@@ -14,29 +14,13 @@ Structured Streaming is a scalable and fault-tolerant 
stream processing engine b
 
 # Quick Example
 Let’s say you want to maintain a running word count of text data 
received from a data server listening on a TCP socket. Let’s see how you can 
express this using Structured Streaming. You can see the full code in 

-[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/

-[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/

-[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
-[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works. First, we have to import the necessary classes and 
create a local SparkSession, the starting point of all functionalities related 
to Spark.

+[Scala]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala)/[Java]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java)/[Python]({{site.SPARK_GITHUB_URL}}/blob/master/examples/src/main/python/sql/streaming/structured_network_wordcount.py).
 And if you 
+[download Spark](http://spark.apache.org/downloads.html), you can directly 
run the example. In any case, let’s walk through the example step-by-step and 
understand how it works.
 
 
 
 
-
--- End diff --

Removing empty `` elements


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14234: [MINOR][SQL][STREAMING][DOCS] Fix minor typos, pu...

2016-07-16 Thread ahmed-mahran
GitHub user ahmed-mahran opened a pull request:

https://github.com/apache/spark/pull/14234

[MINOR][SQL][STREAMING][DOCS] Fix minor typos, punctuations and grammar

## What changes were proposed in this pull request?

Minor fixes correcting some typos, punctuations, grammar.
Adding more anchors for easy navigation.
Fixing minor issues with code snippets.


## How was this patch tested?

`jekyll serve`


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ahmed-mahran/spark b-struct-streaming-docs

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/14234.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #14234


commit 4b566b1b5d21af24032701c17b41c7e411659b92
Author: Ahmed Mahran 
Date:   2016-07-16T23:58:02Z

Fix minor typos, punctuations and grammar

Minor fixes correcting some typos, punctuations, grammar. Adding
more anchors for easy navigation.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org