lucasfang commented on code in PR #388:
URL: https://github.com/apache/paimon-cpp/pull/388#discussion_r4091200471


##########
src/paimon/common/data/blob_utils.cpp:
##########
@@ -108,6 +112,16 @@ bool BlobUtils::IsBlobField(const 
std::shared_ptr<arrow::Field>& field) {
     return IsBlobMetadata(field->metadata());
 }
 
+bool BlobUtils::IsArrayBlobField(const std::shared_ptr<arrow::Field>& field) {
+    if (field == nullptr || field->type()->id() != arrow::Type::LIST) {
+        return false;
+    }
+    const auto& list_type = checked_cast<const 
arrow::ListType&>(*field->type());
+    // Arrow's C schema importer passes MakeChildField(0) directly to 
ListType, retaining the
+    // element field's metadata.
+    return IsBlobField(list_type.value_field());

Review Comment:
   IsArrayBlobField / IsMapBlobField use inconsistent detection strategies — 
src/paimon/common/data/blob_utils.cpp
   
   IsMapBlobField deliberately avoids relying on nested-field metadata 
("Arrow's C schema bridge does not retain nested field metadata for MapType") 
and instead does a structural check: map_type.item_type()->id() == 
LARGE_BINARY, justified by the fact that "Paimon's ordinary binary type is 
BINARY, so LARGE_BINARY uniquely identifies a BLOB value here."The new 
IsArrayBlobField takes the opposite approach and depends entirely on the 
element field's metadata surviving the bridge: return 
IsBlobField(list_type.value_field());. So the same "container BLOB" concept is 
detected structurally for MAP but via metadata for ARRAY.



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