You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/18 04:20:04 UTC

[GitHub] tdas commented on a change in pull request #23634: [SPARK-26154][SS] Streaming left/right outer join should not return outer nulls for already matched rows

tdas commented on a change in pull request #23634: [SPARK-26154][SS] Streaming left/right outer join should not return outer nulls for already matched rows
URL: https://github.com/apache/spark/pull/23634#discussion_r257545608
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala
 ##########
 @@ -712,5 +708,186 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with
       assertNumStateRows(total = 2, updated = 2)
     )
   }
+
+  test("SPARK-26187 self left outer join should not return outer nulls for already matched rows") {
+    val inputStream = MemoryStream[(Int, Long)]
+
+    val df = inputStream.toDS()
+      .select(col("_1").as("value"), col("_2").cast("timestamp").as("timestamp"))
+
+    val fooStream = df.select(col("value").as("fooId"), col("timestamp").as("fooTime"))
+
+    val barStream = df
+      // Introduce misses for ease of debugging
+      .where(col("value") % 2 === 0)
+      .select(col("value").as("barId"), col("timestamp").as("barTime"))
+
+    val query = fooStream
+      .withWatermark("fooTime", "5 seconds")
+      .join(
+        barStream.withWatermark("barTime", "5 seconds"),
+        expr("barId = fooId AND barTime >= fooTime AND barTime <= fooTime + interval 5 seconds"),
 
 Review comment:
   Why not stick to the naming convention in existing tests of using "leftX" and "rightX". Its much easier to read the code when it is so. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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