[SPARK-29450][SS] Measure the number of output rows for streaming aggregation with append mode#26104
Closed
HeartSaVioR wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-29450][SS] Measure the number of output rows for streaming aggregation with append mode#26104HeartSaVioR wants to merge 1 commit intoapache:masterfrom
HeartSaVioR wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
Author
|
cc. @tdas @zsxwing @jose-torres @gaborgsomogyi |
|
Test build #111992 has finished for PR 26104 at commit
|
Contributor
Author
|
I've added the query and screenshots to show which issue this PR fixes. |
Contributor
Author
|
retest this, please |
|
Test build #113983 has finished for PR 26104 at commit
|
Contributor
Author
|
@tdas @zsxwing @jose-torres @gaborgsomogyi Kindly reminder. |
Member
|
Retest this please. |
|
Test build #115529 has finished for PR 26104 at commit
|
Member
|
Merged to master. |
Contributor
Author
|
Thanks all for reviewing and merging! |
gatorsmile
reviewed
Jan 14, 2020
Member
|
@HeartSaVioR Could you help backport this to 2.4? |
Contributor
Author
|
Ah yes I didn't get the intention on comment and now I'm seeing the intention. Happy to submit a PR for porting back of this. Thanks! |
HeartSaVioR
added a commit
to HeartSaVioR/spark
that referenced
this pull request
Jan 15, 2020
…regation with append mode
### What changes were proposed in this pull request?
This patch addresses missing metric, the number of output rows for streaming aggregation with append mode. Other modes are correctly measuring it.
### Why are the changes needed?
Without the patch, the value for such metric is always 0.
### Does this PR introduce any user-facing change?
No.
### How was this patch tested?
Unit test added. Also manually tested with below query:
> query
```
import spark.implicits._
spark.conf.set("spark.sql.shuffle.partitions", "5")
val df = spark.readStream
.format("rate")
.option("rowsPerSecond", 1000)
.load()
.withWatermark("timestamp", "5 seconds")
.selectExpr("timestamp", "mod(value, 100) as mod", "value")
.groupBy(window($"timestamp", "10 seconds"), $"mod")
.agg(max("value").as("max_value"), min("value").as("min_value"), avg("value").as("avg_value"))
val query = df
.writeStream
.format("memory")
.option("queryName", "test")
.outputMode("append")
.start()
query.awaitTermination()
```
> before the patch

> after the patch

Closes apache#26104 from HeartSaVioR/SPARK-29450.
Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan.opensource@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This patch addresses missing metric, the number of output rows for streaming aggregation with append mode. Other modes are correctly measuring it.
Why are the changes needed?
Without the patch, the value for such metric is always 0.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit test added. Also manually tested with below query: