AnishMahto commented on code in PR #59519:
URL: https://github.com/apache/spark/pull/59519#discussion_r4531359213
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/autocdc/Scd1BatchProcessor.scala:
##########
@@ -225,6 +225,40 @@ object Scd1BatchProcessor {
private[autocdc] def upsertSequenceOf(cdcMetadataCol: Column): Column =
cdcMetadataCol.getField(cdcUpsertSequenceFieldName)
+ /**
+ * When a row last authored any of the user-data leaves at `leafPaths`,
according to its CDC
+ * metadata: the greatest sequence at which it authored one of them. A
delete authors every leaf
+ * at its delete sequence, and an upsert without a version map authors every
leaf at its upsert
+ * sequence.
+ *
+ * @param cdcMetadataCol The row's CDC metadata.
+ * @param leafPaths The name parts of the leaves, as keyed in the version
map.
+ * @return The sequence at which the row last authored any of the leaves, or
null if it authored
+ * none of them. With no leaves, such as for an empty struct, this
is the row's delete
+ * sequence for a delete and its upsert sequence otherwise.
+ */
+ private[autocdc] def lastAuthoredIn(
Review Comment:
This is just used for tests as of this PR, but next PRs in the stack use
this for production code paths, so adding it directly in `Scd1BatchProcessor`
from the get-go.
--
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]