anew commented on code in PR #57365:
URL: https://github.com/apache/spark/pull/57365#discussion_r3627441034


##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/autocdc/Scd2BatchProcessor.scala:
##########
@@ -811,6 +811,93 @@ case class Scd2BatchProcessor(
     staged.select(outputColumns.toImmutableArraySeq: _*)
   }
 
+  /**
+   * Drop delete-encoded rows (tombstones and decomposition tails) that became 
redundant after
+   * reconciliation.
+   *
+   * A tombstone or decomposition tail is redundant when the immediately 
preceding row's reconciled
+   * [[endAtColName]] equals its own sequence: the preceding upsert already 
encodes the delete
+   * boundary, so the standalone delete-encoded row should no longer be routed 
to aux.
+   *
+   * For example, an open upsert `[startAt=10, endAt=null)` followed by a 
tombstone at `15`

Review Comment:
   Good point — the asymmetry was only in the wording, not the logic. Rewrote 
the doc to state the single rule both cases share: a delete-encoded row is 
redundant when the immediately preceding reconciled upsert's endAt equals the 
row's own boundary (its startAt/identity is irrelevant to the check). I also 
spelled out where the [null, 20) decomposition tail comes from — the open-head 
+ tail split produced when a closed row is bisected by an out-of-order event.



-- 
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