Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Jul 13, 2024
1 parent e2656c9 commit 47adf22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arrow-row/src/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ fn decode_binary_view_inner(
let mut output_buffer_cap = 0;
let mut inline_buffer_cap = 0;
for r in rows.iter() {
let len = decoded_len(r, options);
if len > 12 {
output_buffer_cap += len;
let l = decoded_len(r, options);
if l <= 12 {
inline_buffer_cap += l;
} else {
inline_buffer_cap += len;
output_buffer_cap += l;
}
}

let mut output_buffer = MutableBuffer::new(output_buffer_cap);
let mut inline_buffer = MutableBuffer::new(inline_buffer_cap);
let mut output_buffer = MutableBuffer::new(output_buffer_cap);
let mut views = BufferBuilder::<u128>::new(len);

for row in rows {
Expand Down Expand Up @@ -307,8 +307,8 @@ fn decode_binary_view_inner(
if check_utf8 {
// We validate the utf8 of the output buffer and the inline buffer
// This is much faster than validating each string individually
std::str::from_utf8(output_buffer.as_slice()).unwrap();
std::str::from_utf8(inline_buffer.as_slice()).unwrap();
std::str::from_utf8(output_buffer.as_slice()).unwrap();
}

let builder = ArrayDataBuilder::new(DataType::BinaryView)
Expand Down

0 comments on commit 47adf22

Please sign in to comment.