Skip to content

Commit 18babc3

Browse files
authored
Merge branch 'main' into feat/cherry-make-rest-methods-pub
2 parents 6d90539 + bd3f2ec commit 18babc3

File tree

5 files changed

+88
-29
lines changed

5 files changed

+88
-29
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ updates:
3030
schedule:
3131
interval: "weekly"
3232
day: "sunday"
33+
open-pull-requests-limit: 50

Cargo.lock

Lines changed: 54 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ array-init = "2"
4444
arrow-arith = { version = "53.3.0" }
4545
arrow-array = { version = "53.4.0" }
4646
arrow-cast = { version = "53.3.0" }
47-
arrow-ord = { version = "53.3.0" }
47+
arrow-ord = { version = "53.4.0" }
4848
arrow-schema = { version = "53.4.0" }
49-
arrow-select = { version = "53.3.0" }
49+
arrow-select = { version = "53.4.0" }
5050
arrow-string = { version = "53.3.0" }
5151
async-stream = "0.3.5"
5252
async-trait = "0.1.85"
@@ -89,10 +89,10 @@ rust_decimal = "1.31"
8989
serde = { version = "1.0.204", features = ["rc"] }
9090
serde_bytes = "0.11.15"
9191
serde_derive = "1.0.204"
92-
serde_json = "1.0.120"
92+
serde_json = "1.0.138"
9393
serde_repr = "0.1.16"
9494
serde_with = "3.4"
95-
tempfile = "3.15"
95+
tempfile = "3.16"
9696
tokio = { version = "1.36", default-features = false }
9797
typed-builder = "0.20"
9898
url = "2.2.2"

crates/catalog/s3tables/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keywords = ["iceberg", "sql", "catalog"]
3232
anyhow = { workspace = true }
3333
async-trait = { workspace = true }
3434
aws-config = { workspace = true }
35-
aws-sdk-s3tables = "1.6.0"
35+
aws-sdk-s3tables = "1.7.0"
3636
iceberg = { workspace = true }
3737
serde_json = { workspace = true }
3838
uuid = { workspace = true, features = ["v4"] }

crates/iceberg/src/transform/truncate.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ impl Truncate {
4242
}
4343
}
4444

45+
#[inline]
46+
fn truncate_binary(s: &[u8], width: usize) -> &[u8] {
47+
&s[0..width]
48+
}
49+
4550
#[inline]
4651
fn truncate_i32(v: i32, width: i32) -> i32 {
4752
v - v.rem_euclid(width)
@@ -119,6 +124,18 @@ impl TransformFunction for Truncate {
119124
);
120125
Ok(Arc::new(res))
121126
}
127+
DataType::Binary => {
128+
let len = self.width as usize;
129+
let res: arrow_array::BinaryArray = arrow_array::BinaryArray::from_iter(
130+
input
131+
.as_any()
132+
.downcast_ref::<arrow_array::BinaryArray>()
133+
.unwrap()
134+
.iter()
135+
.map(|v| v.map(|v| Self::truncate_binary(v, len))),
136+
);
137+
Ok(Arc::new(res))
138+
}
122139
_ => Err(crate::Error::new(
123140
crate::ErrorKind::FeatureUnsupported,
124141
format!(
@@ -747,6 +764,17 @@ mod test {
747764
.value(0),
748765
"ice"
749766
);
767+
768+
// test binary
769+
let input = Arc::new(arrow_array::BinaryArray::from_vec(vec![b"iceberg"]));
770+
let res = super::Truncate::new(3).transform(input).unwrap();
771+
assert_eq!(
772+
res.as_any()
773+
.downcast_ref::<arrow_array::BinaryArray>()
774+
.unwrap()
775+
.value(0),
776+
b"ice"
777+
);
750778
}
751779

752780
#[test]

0 commit comments

Comments
 (0)