xiarixiaoyao commented on code in PR #8873:
URL: https://github.com/apache/hudi/pull/8873#discussion_r1214115916


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HiveAvroSerializer.java:
##########
@@ -336,8 +337,12 @@ private Object serializeList(ListTypeInfo typeInfo, 
ListObjectInspector fieldOI,
     // NOTE: We have to resolve nullable schema, since Avro permits array 
elements
     //       to be null
     Schema arrayNestedType = resolveNullableSchema(schema.getElementType());
-    Schema elementType = arrayNestedType.getField("element") == null ? 
arrayNestedType : arrayNestedType.getField("element").schema();
-
+    Schema elementType;
+    if (listElementObjectInspector.getCategory() == 
ObjectInspector.Category.PRIMITIVE) {
+      elementType = arrayNestedType;
+    } else {
+      elementType = arrayNestedType.getField("element") == null ? 
arrayNestedType : arrayNestedType.getField("element").schema();

Review Comment:
   thanks for your fix.
   I remember there is a slight difference in the array types used by hive2 and 
hive3 to handle AVRO,
   Actually, I have encountered your issue before and I want to handle it in 
this way. At present, it seems that this method is incorrect.
   



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