Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions vortex-layout/src/layouts/struct_/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ impl StructReader {
.collect()
});

let mut dtypes: Vec<DType> = struct_dt.fields().collect();
let mut names: Vec<Arc<str>> = struct_dt
.names()
.iter()
.map(|x| Arc::clone(x.inner()))
.collect();

if layout.dtype.is_nullable() {
dtypes.insert(0, DType::Bool(Nullability::NonNullable));
names.insert(0, Arc::from("validity"));
let nullable = layout.dtype.is_nullable();
let extra = nullable as usize;

let mut dtypes: Vec<DType> = Vec::with_capacity(struct_dt.nfields() + extra);
let mut names: Vec<Arc<str>> = Vec::with_capacity(struct_dt.nfields() + extra);
if nullable {
dtypes.push(DType::Bool(Nullability::NonNullable));
names.push(Arc::from("validity"));
}
dtypes.extend(struct_dt.fields());
names.extend(struct_dt.names().iter().map(|x| Arc::clone(x.inner())));

let lazy_children = LazyReaderChildren::new(
Arc::clone(&layout.children),
Expand Down
Loading