Skip to content

Commit

Permalink
Support StructArray in Row Format (#3159) (#3212)
Browse files Browse the repository at this point in the history
* Extract Codec and Encoder

* Add StructArray support to Row format (#3159)

* More docs

* Review feedback
  • Loading branch information
tustvold authored Nov 29, 2022
1 parent b2bfe9c commit 733d32e
Show file tree
Hide file tree
Showing 2 changed files with 384 additions and 137 deletions.
6 changes: 5 additions & 1 deletion arrow/src/row/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ pub fn decode_bool(rows: &mut [&[u8]], options: SortOptions) -> BooleanArray {
unsafe { BooleanArray::from(builder.build_unchecked()) }
}

fn decode_nulls(rows: &[&[u8]]) -> (usize, Buffer) {
/// Decodes a single byte from each row, interpreting `0x01` as a valid value
/// and all other values as a null
///
/// Returns the null count and null buffer
pub fn decode_nulls(rows: &[&[u8]]) -> (usize, Buffer) {
let mut null_count = 0;
let buffer = MutableBuffer::collect_bool(rows.len(), |idx| {
let valid = rows[idx][0] == 1;
Expand Down
Loading

0 comments on commit 733d32e

Please sign in to comment.