huaxingao commented on code in PR #14379:
URL: https://github.com/apache/iceberg/pull/14379#discussion_r2505637137
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/StructInternalRow.java:
##########
@@ -338,11 +348,37 @@ private ArrayData collectionToArrayData(Type elementType,
Collection<?> values)
array ->
(BiConsumer<Integer, Map<?, ?>>)
(pos, map) -> array[pos] =
mapToMapData(elementType.asMapType(), map));
+ case VARIANT:
+ return fillArray(
+ values,
+ array -> (BiConsumer<Integer, Object>) (pos, v) -> array[pos] =
toVariantVal(v));
default:
throw new UnsupportedOperationException("Unsupported array element
type: " + elementType);
}
}
+ private static VariantVal toVariantVal(Object value) {
+ if (value instanceof VariantVal) {
+ return (VariantVal) value;
Review Comment:
I removed this conditional branch.
--
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]