tprelle commented on a change in pull request #4283:
URL: https://github.com/apache/iceberg/pull/4283#discussion_r821769738
##########
File path:
mr/src/test/java/org/apache/iceberg/mr/hive/serde/objectinspector/TestIcebergRecordObjectInspector.java
##########
@@ -61,4 +61,17 @@ public void testIcebergRecordObjectInspector() {
Assert.assertEquals(innerRecord.get(0),
innerSoi.getStructFieldData(innerData, stringField));
}
+ @Test
+ public void testIcebergRecordObjectInspectorWithRowNull() {
+ Schema schema = new Schema(
+ required(1, "integer_field", Types.IntegerType.get()),
+ required(2, "struct_field", Types.StructType.of(
+ Types.NestedField.required(3, "string_field",
Types.StringType.get())))
+ );
+ StructObjectInspector soi = (StructObjectInspector)
IcebergObjectInspector.create(schema);
+ Assert.assertNull(soi.getStructFieldsDataAsList(null));
+ StructField integerField = soi.getStructFieldRef("integer_field");
+ Assert.assertNull(soi.getStructFieldData(null, integerField));
Review comment:
yes it's the expected behaviour in hive base on the comment of the
abstract class
https://github.com/apache/hive/blob/master/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StructObjectInspector.java
But i will try to add a integration test.
--
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]