Skip to content

Commit a64c7ae

Browse files
feat[vector]: fill in VectorMut::with_capacity (#5173)
Signed-off-by: Joe Isaacs <[email protected]>
1 parent a485f5e commit a64c7ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vortex-vector/src/vector_mut.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ impl VectorMut {
6666
DType::Decimal(decimal_dtype, _) => {
6767
DecimalVectorMut::with_capacity(decimal_dtype, capacity).into()
6868
}
69-
DType::Utf8(_) | DType::Binary(_) | DType::List(..) | DType::Extension(_) => {
70-
vortex_panic!("Unsupported dtype for VectorMut")
71-
}
69+
DType::Utf8(..) => StringVectorMut::with_capacity(capacity).into(),
70+
DType::Binary(..) => BinaryVectorMut::with_capacity(capacity).into(),
71+
DType::Extension(ext) => VectorMut::with_capacity(ext.storage_dtype(), capacity),
72+
DType::List(..) => todo!("vector mut with capacity"),
7273
}
7374
}
7475
}

0 commit comments

Comments
 (0)