leaves12138 commented on code in PR #10067:
URL: https://github.com/apache/paimon/pull/10067#discussion_r4068235442


##########
paimon-python/pypaimon/data/variant_shredding.py:
##########
@@ -328,7 +332,14 @@ def _build_object_value(fields: List[Tuple[int, bytes]]) 
-> bytes:
         buf.append(0)       # offset[0] = 0 (sentinel)
         return bytes(buf)
 
-    fields = sorted(fields, key=lambda f: f[0])
+    if key_dict is None:
+        fields = sorted(fields, key=lambda f: f[0])
+    else:
+        id_to_name = {key_id: name for name, key_id in key_dict.items()}
+        fields = sorted(
+            fields,
+            key=lambda f: id_to_name[f[0]].encode('utf-16-be'),

Review Comment:
   Verified fixed in acece3ccd57f5ea84a05d53145879a4a9acb7de8. The original 
regression now passes, the added test covers both overflow writing and 
reconstruction, and an independent end-to-end native-read test preserves both 
values and UTF-8 key order. Resolving this finding.



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