Copilot commented on code in PR #13390:
URL: https://github.com/apache/gravitino/pull/13390#discussion_r4068253267


##########
lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/LanceDataTypeConverter.java:
##########
@@ -203,6 +203,10 @@ public ArrowType fromGravitino(Type type) {
 
   @Override
   public Type toGravitino(Field arrowField) {
+    if (arrowField.getMetadata() != null && 
!arrowField.getMetadata().isEmpty()) {
+      return toExternalType(arrowField);
+    }

Review Comment:
   This guard only checks the current field, so metadata on descendants that 
are collapsed into a native complex type is still lost. For example, the 
existing `Map` branch keeps only the key/value types and discards metadata on 
the map's intermediate struct field; `toArrowField` then rebuilds that field 
with null metadata. The round-trip is therefore not lossless for nested map 
metadata; either preserve that metadata or fall back to an external 
representation for such subtrees, with coverage for list/map/union children.
   
   This issue also appears on line 206 of the same file.



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

Reply via email to