Skip to content

Commit 669a11b

Browse files
Seigneurin, Alexis (CONT)srowen
authored andcommitted
[DOCS][MINOR] Fixed a few typos in the Structured Streaming documentation
Fixed a few typos. There is one more I'm not sure of: ``` Append mode uses watermark to drop old aggregation state. But the output of a windowed aggregation is delayed the late threshold specified in `withWatermark()` as by the modes semantics, rows can be added to the Result Table only once after they are ``` Not sure how to change `is delayed the late threshold`. Author: Seigneurin, Alexis (CONT) <[email protected]> Closes #17443 from aseigneurin/typos.
1 parent e9d268f commit 669a11b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/structured-streaming-programming-guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,11 @@ However, to run this query for days, it's necessary for the system to bound the
717717
intermediate in-memory state it accumulates. This means the system needs to know when an old
718718
aggregate can be dropped from the in-memory state because the application is not going to receive
719719
late data for that aggregate any more. To enable this, in Spark 2.1, we have introduced
720-
**watermarking**, which let's the engine automatically track the current event time in the data and
720+
**watermarking**, which lets the engine automatically track the current event time in the data
721721
and attempt to clean up old state accordingly. You can define the watermark of a query by
722-
specifying the event time column and the threshold on how late the data is expected be in terms of
722+
specifying the event time column and the threshold on how late the data is expected to be in terms of
723723
event time. For a specific window starting at time `T`, the engine will maintain state and allow late
724-
data to be update the state until `(max event time seen by the engine - late threshold > T)`.
724+
data to update the state until `(max event time seen by the engine - late threshold > T)`.
725725
In other words, late data within the threshold will be aggregated,
726726
but data later than the threshold will be dropped. Let's understand this with an example. We can
727727
easily define watermarking on the previous example using `withWatermark()` as shown below.
@@ -792,7 +792,7 @@ This watermark lets the engine maintain intermediate state for additional 10 min
792792
data to be counted. For example, the data `(12:09, cat)` is out of order and late, and it falls in
793793
windows `12:05 - 12:15` and `12:10 - 12:20`. Since, it is still ahead of the watermark `12:04` in
794794
the trigger, the engine still maintains the intermediate counts as state and correctly updates the
795-
counts of the related windows. However, when the watermark is updated to 12:11, the intermediate
795+
counts of the related windows. However, when the watermark is updated to `12:11`, the intermediate
796796
state for window `(12:00 - 12:10)` is cleared, and all subsequent data (e.g. `(12:04, donkey)`)
797797
is considered "too late" and therefore ignored. Note that after every trigger,
798798
the updated counts (i.e. purple rows) are written to sink as the trigger output, as dictated by
@@ -825,7 +825,7 @@ section for detailed explanation of the semantics of each output mode.
825825
same column as the timestamp column used in the aggregate. For example,
826826
`df.withWatermark("time", "1 min").groupBy("time2").count()` is invalid
827827
in Append output mode, as watermark is defined on a different column
828-
as the aggregation column.
828+
from the aggregation column.
829829

830830
- `withWatermark` must be called before the aggregation for the watermark details to be used.
831831
For example, `df.groupBy("time").count().withWatermark("time", "1 min")` is invalid in Append
@@ -909,7 +909,7 @@ track of all the data received in the stream. This is therefore fundamentally ha
909909
efficiently.
910910

911911
## Starting Streaming Queries
912-
Once you have defined the final result DataFrame/Dataset, all that is left is for you start the streaming computation. To do that, you have to use the `DataStreamWriter`
912+
Once you have defined the final result DataFrame/Dataset, all that is left is for you to start the streaming computation. To do that, you have to use the `DataStreamWriter`
913913
([Scala](api/scala/index.html#org.apache.spark.sql.streaming.DataStreamWriter)/[Java](api/java/org/apache/spark/sql/streaming/DataStreamWriter.html)/[Python](api/python/pyspark.sql.html#pyspark.sql.streaming.DataStreamWriter) docs)
914914
returned through `Dataset.writeStream()`. You will have to specify one or more of the following in this interface.
915915

@@ -1396,15 +1396,15 @@ You can directly get the current status and metrics of an active query using
13961396
`lastProgress()` returns a `StreamingQueryProgress` object
13971397
in [Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryProgress)
13981398
and [Java](api/java/org/apache/spark/sql/streaming/StreamingQueryProgress.html)
1399-
and an dictionary with the same fields in Python. It has all the information about
1399+
and a dictionary with the same fields in Python. It has all the information about
14001400
the progress made in the last trigger of the stream - what data was processed,
14011401
what were the processing rates, latencies, etc. There is also
14021402
`streamingQuery.recentProgress` which returns an array of last few progresses.
14031403

1404-
In addition, `streamingQuery.status()` returns `StreamingQueryStatus` object
1404+
In addition, `streamingQuery.status()` returns a `StreamingQueryStatus` object
14051405
in [Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryStatus)
14061406
and [Java](api/java/org/apache/spark/sql/streaming/StreamingQueryStatus.html)
1407-
and an dictionary with the same fields in Python. It gives information about
1407+
and a dictionary with the same fields in Python. It gives information about
14081408
what the query is immediately doing - is a trigger active, is data being processed, etc.
14091409

14101410
Here are a few examples.

0 commit comments

Comments
 (0)