akashrn5 commented on code in PR #18387:
URL: https://github.com/apache/iceberg/pull/18387#discussion_r4247355803
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/VectorizedSparkOrcReaders.java:
##########
@@ -156,7 +156,9 @@ public Converter primitive(Type.PrimitiveType iPrimitive,
TypeDescription primit
break;
case BINARY:
primitiveValueReader =
- Type.TypeID.UUID == iPrimitive.typeId()
+ // iPrimitive is null for the variant metadata and value fields,
which are
Review Comment:
done
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/data/TestOrcWrite.java:
##########
@@ -56,4 +57,26 @@ public void splitOffsets() throws IOException {
writer.close();
assertThat(writer.splitOffsets()).as("Split offsets not
present").isNotEmpty();
}
+
+ @Test
+ public void variantIsNotSupported() throws IOException {
+ Schema variantSchema =
+ new Schema(
+ optional(1, "id", Types.IntegerType.get()),
+ optional(2, "payload", Types.VariantType.get()));
+
+ File testFile = File.createTempFile("junit", null, temp.toFile());
+ assertThat(testFile.delete()).as("Delete should succeed").isTrue();
+
+ // The ORC variant mapping visits the metadata and value fields with a
null Iceberg type, so
+ // this must report that variant is unsupported instead of throwing a
NullPointerException.
Review Comment:
done
--
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]