JingsongLi commented on code in PR #1405:
URL: https://github.com/apache/paimon-rust/pull/1405#discussion_r4662090016


##########
crates/paimon/src/variant.rs:
##########
@@ -2914,12 +3015,17 @@ pub(crate) fn rebuild_shredded_with_cache(
         false
     };
     let mut builder = if compact {
+        if metadata.len() > SIZE_LIMIT {
+            return data_invalid("Variant value or metadata exceeds constructor 
size limit");
+        }
+        cache.validate_compact_metadata(metadata)?;

Review Comment:
   **[P2] Avoid revalidating the same wide dictionaries on every row**
   
   The new cache reuses validation in the nine-dictionary case. With a 512-row 
Parquet batch rotating through 17 valid dictionaries of 5,363 keys each, it 
still misses on every row. The dictionaries total 2,096,763 bytes, so this hits 
the 16-entry limit even though the bytes fit. Each row has only the typed `age` 
key and no residual. The baseline compact path rebuilds that value without 
traversing the unused source keys.
   
   I ran the same in-memory Parquet round-trip on `ea90bef2` and its merge with 
this PR, `89b4caf5`. Arrow reconstruction medians were 2.7–2.8 ms on the 
baseline and 743–750 ms with the PR over two runs of seven samples each, with 
the same decoded results. Please reuse successful validation across distinct 
metadata values in a batch, for example by borrowing the metadata bytes from 
the input Arrow array, and cover a workload above the current entry limit.



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