yihua commented on code in PR #13444:
URL: https://github.com/apache/hudi/pull/13444#discussion_r2217084039
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/CDCFileGroupIterator.scala:
##########
@@ -414,11 +385,10 @@ class CDCFileGroupIterator(split: HoodieCDCFileGroupSplit,
}
// load afterFileSlice to afterImageRecords
if (currentCDCFileSplit.getAfterFileSlice.isPresent) {
- val iter =
loadFileSlice(currentCDCFileSplit.getAfterFileSlice.get())
+ val iter =
loadFileSliceWithKeys(currentCDCFileSplit.getAfterFileSlice.get())
afterImageRecords.clear()
- iter.foreach { row =>
- val key = getRecordKey(row)
- afterImageRecords.put(key, row.copy())
+ iter.foreach { tuple =>
+ afterImageRecords.put(tuple._1, tuple._2.copy())
Review Comment:
nit: is `tuple._2.copy()` still needed as it goes through FGReader now?
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/CDCFileGroupIterator.scala:
##########
@@ -430,10 +400,7 @@ class CDCFileGroupIterator(split: HoodieCDCFileGroupSplit,
if (currentCDCFileSplit.getBeforeFileSlice.isPresent) {
loadBeforeFileSliceIfNeeded(currentCDCFileSplit.getBeforeFileSlice.get)
}
- recordIter = beforeImageRecords.values.map { record =>
- deserialize(record)
- }.iterator
- beforeImageRecords.clear()
Review Comment:
Is `beforeImageRecords` still cleared somewhere?
--
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]