Skip to content

Commit 23436c5

Browse files
authored
fix: how binary data is encoded in arrow-pg (#230)
1 parent 4008fa5 commit 23436c5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

arrow-pg/src/encoder.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,12 @@ fn get_large_utf8_value(arr: &Arc<dyn Array>, idx: usize) -> Option<&str> {
169169
})
170170
}
171171

172-
fn get_binary_value(arr: &Arc<dyn Array>, idx: usize) -> Option<String> {
172+
fn get_binary_value(arr: &Arc<dyn Array>, idx: usize) -> Option<&[u8]> {
173173
(!arr.is_null(idx)).then(|| {
174-
String::from_utf8_lossy(
175-
arr.as_any()
176-
.downcast_ref::<BinaryArray>()
177-
.unwrap()
178-
.value(idx),
179-
)
180-
.to_string()
174+
arr.as_any()
175+
.downcast_ref::<BinaryArray>()
176+
.unwrap()
177+
.value(idx)
181178
})
182179
}
183180

0 commit comments

Comments
 (0)