YannByron commented on code in PR #5201:
URL: https://github.com/apache/hudi/pull/5201#discussion_r850035645


##########
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:
   Which avro version will be used depends on the build environment, not the 
codes !
   see the pom and search `avro.version`, you will see when will use the 
different avro version.



-- 
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]

Reply via email to