danny0405 commented on code in PR #5201:
URL: https://github.com/apache/hudi/pull/5201#discussion_r849225179
##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -164,6 +164,18 @@ public static GenericRecord jsonBytesToAvro(byte[] bytes,
Schema schema) throws
return reader.read(null, jsonDecoder);
}
+ /**
+ * True if the schema contains this name of field
+ */
+ public static boolean containsFieldInSchema(Schema schema, String fieldName)
{
+ try {
+ Field field = schema.getField(fieldName);
+ return field != null;
+ } catch (Exception e) {
+ return false;
+ }
Review Comment:
Do we have different avro version for current code path ?
--
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]