rahil-c commented on code in PR #6155:
URL: https://github.com/apache/hudi/pull/6155#discussion_r927004127
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeRecordReaderUtils.java:
##########
@@ -189,7 +190,13 @@ public static Writable avroToArrayWritable(Object value,
Schema schema) {
Writable[] recordValues = new Writable[schema.getFields().size()];
int recordValueIndex = 0;
for (Schema.Field field : schema.getFields()) {
- recordValues[recordValueIndex++] =
avroToArrayWritable(record.get(field.name()), field.schema());
+ Object fieldValue = null;
+ try {
+ fieldValue = record.get(field.name());
+ } catch (AvroRuntimeException e) {
+ LOG.debug("Field:" + field.name() + "not found in Schema:" +
schema.toString());
Review Comment:
I think also the perfomance concerns are not with the actual try catch but
more so to do with the exception handling
https://www.oreilly.com/library/view/programming-jakarta-struts/0596006519/ch10s02.html#:~:text=In%20general%2C%20wrapping%20your%20Java,proper%20handler%20for%20the%20exception.
```
In general, wrapping your Java code with try/catch blocks doesn’t have a
significant performance impact on your applications. Only when exceptions
actually occur is there a negative performance impact, which is due to the
lookup the JVM must perform to locate the proper handler for the exception.
```
In this case though i think we will need to catch the exception
--
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]