spark-test commented on code in PR #60707:
URL: https://github.com/apache/spark/pull/60707#discussion_r4625935605


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:
##########
@@ -106,6 +106,19 @@ class PropagateEmptyRelationSuite extends PlanTest {
     assert(optimized6.output.head.metadata == metadata, "New output should 
keep metadata")
   }
 
+  test("SPARK-62057: keep empty children of a streaming Union") {

Review Comment:
   **Nit (P3):** This case covers a streaming Union with one non-empty and one 
empty child. The guard also keeps a streaming Union whose children are all 
empty (PropagateEmptyRelation.scala:78-81), and the fix needs that too: for a 
stream-stream left semi join over `s1.union(s2)` with the watermark on the 
right input's join key, a micro-batch in which only the right input has data 
would otherwise plan one join over the collapsed relation instead of one per 
input, the change in stateful operators between micro-batches that this PR 
fixes. No test builds that shape, and the `StreamingJoinSuite` tests cannot, 
because `input1` keeps its `EventTimeWatermark`, so restoring the all-empty 
collapse would pass every test. A second case with two empty streaming 
children, unchanged with the conf at its default and collapsed into one empty 
streaming `LocalRelation` with the conf set to true, would cover it; like this 
case, it needs a fresh plan for each run.
   
   **Verification:**
   - **Behavior:** With the conf at its default, optimizing a streaming Union 
whose children are all empty streaming relations returns the Union unchanged.
   - **Compatibility:** With the conf set to true, the same streaming Union 
becomes a single empty relation that is still marked streaming, as on the base 
branch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to