Change FieldSummary {upper,lower}_bound to ByteBuf#1369
Change FieldSummary {upper,lower}_bound to ByteBuf#1369liurenjie1024 merged 6 commits intoapache:mainfrom
FieldSummary {upper,lower}_bound to ByteBuf#1369Conversation
62dcdd3 to
601ef29
Compare
601ef29 to
1da092a
Compare
bd4691f to
d215831
Compare
d215831 to
ccd4632
Compare
| Some(bound) if datum <= bound => ROWS_CANNOT_MATCH, | ||
| Some(_) => ROWS_MIGHT_MATCH, | ||
| Some(bound_bytes) => { | ||
| let bound = ManifestFilterVisitor::bytes_to_datum( |
There was a problem hiding this comment.
@liurenjie1024 what's the cost of datum_from_bytes and bytes_to_datum? Do we need to introduce a new type in between?
There was a problem hiding this comment.
The cost dependends on the type, but I think it's fine for now since it's not supposed to be quite expensive.
| /// field in the list corresponds to a field in the manifest file’s | ||
| /// partition spec. | ||
| pub partitions: Vec<FieldSummary>, | ||
| pub partitions: Option<Vec<FieldSummary>>, |
There was a problem hiding this comment.
There is also a slight semantic difference; when it is omitted, we don't know anything about the partitions. When it is an empty Vec, then it indicates that it is unpartitioned.
| Ok(bound) | ||
| } | ||
|
|
||
| fn bytes_to_datum(bytes: &ByteBuf, t: Type) -> Datum { |
There was a problem hiding this comment.
nit should this be in Datum alongside try_from_bytes?
Co-authored-by: Kevin Liu <[email protected]>
Xuanwo
left a comment
There was a problem hiding this comment.
This change looks good to me and can unlock integration from pyiceberg.
liurenjie1024
left a comment
There was a problem hiding this comment.
Looks good, thanks @Fokko for this fix!

Which issue does this PR close?
I would like to invite everyone to roast my Rust-skills in order for me to improve myself :)
Unblocks #1328
This aligns closely with PyIceberg and Java and greatly simplifies the use of the Avro readers in PyIceberg. Otherwise, we would need to update public APIs.
What changes are included in this PR?
Are these changes tested?