Skip to content

Commit

Permalink
Check binary array length when applying truncate (#984)
Browse files Browse the repository at this point in the history
We found an issue in apache/iceberg-python#1592
  • Loading branch information
Fokko authored Feb 21, 2025
1 parent 6fbeb32 commit 1a2a8c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/iceberg/src/transform/truncate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ impl Truncate {

#[inline]
fn truncate_binary(s: &[u8], width: usize) -> &[u8] {
&s[0..width]
if s.len() > width {
&s[0..width]
} else {
s
}
}

#[inline]
Expand Down

0 comments on commit 1a2a8c8

Please sign in to comment.