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


##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/autocdc/Scd2BatchProcessor.scala:
##########
@@ -639,6 +639,193 @@ case class Scd2BatchProcessor(
       .filter(!isRedundantAtSameEffectiveSequence)
       .drop(Scd2BatchProcessor.nextEffectiveRecordStartAtColName)
   }
+
+  /**
+   * Recompute every row's [[startAtColName]] and [[endAtColName]] over the 
per-key chronological
+   * window so the dataframe reflects the canonical SCD2 timeline that the 
downstream aux- and
+   * target-table merges consume.
+   *
+   * Decomposition tails and tombstones round-trip unchanged. An open upsert 
may close at its
+   * successor's effective sequence (becoming closed); a closed upsert may 
have its endAt cleared

Review Comment:
   Deletes are represented as instantaneous tombstones, so an open upsert can 
also close against a delete. Updated the doc to say the closing successor may 
be a later upsert or a delete.



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