diff --git a/arrow-pg/src/encoder.rs b/arrow-pg/src/encoder.rs index 8ac10da..074939c 100644 --- a/arrow-pg/src/encoder.rs +++ b/arrow-pg/src/encoder.rs @@ -169,15 +169,12 @@ fn get_large_utf8_value(arr: &Arc, idx: usize) -> Option<&str> { }) } -fn get_binary_value(arr: &Arc, idx: usize) -> Option { +fn get_binary_value(arr: &Arc, idx: usize) -> Option<&[u8]> { (!arr.is_null(idx)).then(|| { - String::from_utf8_lossy( - arr.as_any() - .downcast_ref::() - .unwrap() - .value(idx), - ) - .to_string() + arr.as_any() + .downcast_ref::() + .unwrap() + .value(idx) }) }