huaxingao commented on code in PR #14854:
URL: https://github.com/apache/iceberg/pull/14854#discussion_r2648878863
##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/StructInternalRow.java:
##########
@@ -178,8 +180,36 @@ public UTF8String getUTF8String(int ordinal) {
}
private UTF8String getUTF8StringInternal(int ordinal) {
- CharSequence seq = struct.get(ordinal, CharSequence.class);
- return UTF8String.fromString(seq.toString());
+ Object value = struct.get(ordinal, Object.class);
+
+ if (value == null) {
+ return null;
+ }
+
+ if (value instanceof UTF8String) {
+ return (UTF8String) value;
+ }
+
+ if (value instanceof UUID) {
+ return UTF8String.fromString(value.toString());
+ }
+
+ if (value instanceof ByteBuffer) {
Review Comment:
Is there a test for this `ByteBuffer` path?
--
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]