yihua commented on code in PR #13694:
URL: https://github.com/apache/hudi/pull/13694#discussion_r2272280488
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/CDCFileGroupIterator.scala:
##########
@@ -516,17 +525,19 @@ class CDCFileGroupIterator(split: HoodieCDCFileGroupSplit,
.withBufferSize(HoodieMetadataConfig.MAX_READER_BUFFER_SIZE_PROP.defaultValue)
.withPartition(partitionPath)
.withMetaClient(metaClient)
- .withRecordBuffer(recordBuffer)
+ .withRecordBuffer(keyBasedFileGroupRecordBuffer.get())
.build
-
CloseableIteratorListener.addListener(recordBuffer.getLogRecordIterator).asScala
+
CloseableIteratorListener.addListener(keyBasedFileGroupRecordBuffer.get().getLogRecordIterator).asScala
}
/**
* Convert InternalRow to json string.
*/
- private def convertRowToJsonString(record: InternalRow): UTF8String = {
- internalRowToJsonStringConverter.convert(record)
+ private def convertBufferedRecordToJsonString(record:
BufferedRecord[InternalRow]): UTF8String = {
+ internalRowToJsonStringConverterMap.getOrElseUpdate(record.getSchemaId,
+ new
InternalRowToJsonStringConverter(HoodieInternalRowUtils.getCachedSchema(readerContext.getRecordContext.decodeAvroSchema(record.getSchemaId))))
Review Comment:
I used `assertSame` for stricter validation and it also passes, so it means
the function is only evaluated if the key does not exist, which is what we
expect.
--
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]