pvary commented on a change in pull request #4218:
URL: https://github.com/apache/iceberg/pull/4218#discussion_r817599665



##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/Deserializer.java
##########
@@ -125,13 +125,14 @@ public FieldDeserializer primitive(PrimitiveType type, 
ObjectInspectorPair pair)
 
     @Override
     public FieldDeserializer struct(StructType type, ObjectInspectorPair pair, 
List<FieldDeserializer> deserializers) {
+      GenericRecord template = type != null ? GenericRecord.create(type) : 
null;
       return o -> {
         if (o == null) {
           return null;
         }
 
         List<Object> data = ((StructObjectInspector) 
pair.sourceInspector()).getStructFieldsDataAsList(o);
-        Record result = GenericRecord.create(type);
+        Record result = template.copy();

Review comment:
       There were an issue with positional deletes where the row was not 
present in the file. The code below still created reader for the empty struct.
   ```
         Types.StructType struct = iType != null ? iType.asStructType() : null;
         return visitor.struct(struct, group, visitFields(struct, group, 
visitor));
   ```
   
   Changed it to this, let's see if it breaks something:
   ```
         return iType != null ?
                 visitor.struct(iType.asStructType(), group, 
visitFields(iType.asStructType(), group, visitor)) : null;
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to