Skip to content

Commit

Permalink
Fix incorrect buffers for UnionArray
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 14, 2022
1 parent eb6b7c6 commit d24bae3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arrow/src/array/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,14 @@ pub(crate) fn into_buffers(
DataType::Utf8
| DataType::Binary
| DataType::LargeUtf8
| DataType::LargeBinary
| DataType::Union(_, _) => vec![buffer1.into(), buffer2.into()],
| DataType::LargeBinary => vec![buffer1.into(), buffer2.into()],
DataType::Union(_, mode) => {
match mode {
// Based on Union's DataTypeLayout
UnionMode::Sparse => vec![buffer1.into()],
UnionMode::Dense => vec![buffer1.into(), buffer2.into()],
}
}
_ => vec![buffer1.into()],
}
}
Expand Down

0 comments on commit d24bae3

Please sign in to comment.