yihua commented on code in PR #13844:
URL: https://github.com/apache/hudi/pull/13844#discussion_r2328128041
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/HoodieStreamerUtils.java:
##########
@@ -113,6 +115,12 @@ public static Option<JavaRDD<HoodieRecord>>
createHoodieRecords(HoodieStreamer.C
BuiltinKeyGenerator builtinKeyGenerator = (BuiltinKeyGenerator)
HoodieSparkKeyGeneratorFactory.createKeyGenerator(props);
return new
CloseableMappingIterator<>(ClosableIterator.wrap(genericRecordIterator), genRec
-> {
try {
+ if (shouldErrorTable) {
+ Schema schema = genRec.getSchema();
+ if (!GenericData.get().validate(schema, genRec)) {
+ throw new HoodieException("The record does not match the
schema: " + schema);
Review Comment:
`HoodieAvroUtils.avroToBytes(record)` invoked in the payload class
`BaseAvroPayload` in the old way throws NPE for the record which is caught by
this method. Could we throw `HoodieIOException` instead giving this is
serialization as you mentioned? Also, this exception is not surfaced to user
and only caught in this method, when error table writer is enabled.
--
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]