liianghuang commented on code in PR #14854:
URL: https://github.com/apache/iceberg/pull/14854#discussion_r2700747139


##########
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:
   @huaxingao I believe these are where conversions happened
   
   
https://github.com/apache/iceberg/blob/bf549615515157addf94d637538b34f847aea061/parquet/src/main/java/org/apache/iceberg/parquet/ParquetMetrics.java#L247-L248
   
   so if the tests we used pass the tests, then it means we covered this 
conversion from the iceberg and let Spark know how to read those metrics?



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