JingsongLi commented on code in PR #9148:
URL: https://github.com/apache/paimon/pull/9148#discussion_r3756882005


##########
paimon-python/pypaimon/read/reader/field_indices.py:
##########
@@ -29,6 +29,23 @@ def blob_field_indices(fields: List[DataField]) -> Set[int]:
     }
 
 
+def descriptor_field_indices(
+        fields: List[DataField], descriptor_field_names: Iterable[str]) -> 
Set[int]:
+    names = set(descriptor_field_names)
+    if not names:
+        return set()
+    return {i for i, f in enumerate(fields) if f.name in names}
+
+
+def descriptor_field_indices_for_table(table, fields: List[DataField]) -> 
Set[int]:
+    from pypaimon.common.options.core_options import CoreOptions
+
+    if not CoreOptions.blob_as_descriptor(table.options):
+        return set()
+    return descriptor_field_indices(

Review Comment:
   [P2] When `blob-as-descriptor=true`, `BlobInlineConvertReader` resolves 
configured `blob-view-field` values to `descriptor.serialize()` before rows are 
exposed. If the upstream value is a legacy v1 descriptor, Python reserializes 
it as v1 without the magic header (unlike Java, whose 
`BlobDescriptor.serialize()` always writes `CURRENT_VERSION`). Because this 
helper marks only `blob-descriptor-field`, `OffsetRow.get_blob()` takes the 
heuristic path for the resolved view column and returns `BlobData` containing 
the descriptor bytes instead of a reference to the payload. Please either mark 
resolved view fields as descriptor-backed here or normalize reserialized 
descriptors to v2, and add a v1 blob-view regression test.



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