-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18261][Structured Streaming] Add statistics to MemorySink for joining #15786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,31 @@ class MemorySinkSuite extends StreamTest with BeforeAndAfter { | |
| query.stop() | ||
| } | ||
|
|
||
| test("MemoryPlan statistics for joining") { | ||
|
||
| val input = MemoryStream[Int] | ||
| val query = input.toDF() | ||
| .writeStream | ||
| .format("memory") | ||
| .queryName("memStream") | ||
| .start() | ||
|
|
||
| val memStream = spark.table("memStream").as[Int] | ||
|
|
||
| input.addData(1) | ||
| query.processAllAvailable() | ||
| checkDatasetUnorderly( | ||
| memStream.crossJoin(memStream.withColumnRenamed("value", "value2")).as[(Int, Int)], | ||
| (1, 1)) | ||
|
|
||
| input.addData(2) | ||
| query.processAllAvailable() | ||
| checkDatasetUnorderly( | ||
| memStream.crossJoin(memStream.withColumnRenamed("value", "value2")).as[(Int, Int)], | ||
| (1, 1), (1, 2), (2, 1), (2, 2)) | ||
|
|
||
| query.stop() | ||
|
||
| } | ||
|
|
||
| ignore("stress test") { | ||
| // Ignore the stress test as it takes several minutes to run | ||
| (0 until 1000).foreach { _ => | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everywhere else, this is defined as a lazy val. Can you make it such that:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @brkyvz. I'm afraid it should not be
lazy valas the statistics should vary from batch to batch --sink.allData.sizeshould vary from batch to batch.sizePerRow, however, does not vary from batch to batch, thus it'sprivate valas it is now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah! you're right! good catch!