Skip to content

Commit db61cec

Browse files
committed
fix imports
Signed-off-by: Connor Tsui <[email protected]>
1 parent e1a7962 commit db61cec

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

vortex-vector/src/primitive/macros.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ macro_rules! match_each_pvector {
9292
}};
9393
}
9494

95-
pub(crate) use match_each_pvector;
96-
9795
/// Matches on all primitive type variants of [`PrimitiveVectorMut`] and executes the same code
9896
/// for each variant branch.
9997
///
@@ -176,5 +174,3 @@ macro_rules! match_each_pvector_mut {
176174
}
177175
}};
178176
}
179-
180-
pub(crate) use match_each_pvector_mut;

vortex-vector/src/primitive/vector.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use vortex_dtype::half::f16;
77
use vortex_dtype::{NativePType, PType, PTypeDowncast, PTypeUpcast};
88
use vortex_error::vortex_panic;
99

10-
use super::macros::match_each_pvector;
11-
use crate::{PVector, PrimitiveVectorMut, VectorOps};
10+
use crate::{PVector, PrimitiveVectorMut, VectorOps, match_each_pvector};
1211

1312
/// An immutable vector of primitive values.
1413
///

vortex-vector/src/primitive/vector_mut.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use vortex_dtype::half::f16;
77
use vortex_dtype::{NativePType, PType, PTypeDowncast, PTypeUpcast};
88
use vortex_error::vortex_panic;
99

10-
use super::macros::match_each_pvector_mut;
11-
use crate::{PVectorMut, PrimitiveVector, VectorMutOps};
10+
use crate::{PVectorMut, PrimitiveVector, VectorMutOps, match_each_pvector_mut};
1211

1312
/// A mutable vector of primitive values.
1413
///

vortex-vector/src/struct_/vector.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub struct StructVector {
3333

3434
/// The length of the vector (which is the same as all field vectors).
3535
///
36-
/// This is stored here as a convenience, and also helps in the case that the `StructVector` has
37-
/// no fields.
36+
/// This is stored here as a convenience, as the validity also tracks this information.
3837
pub(super) len: usize,
3938
}
4039

@@ -111,14 +110,14 @@ impl StructVector {
111110
}
112111
}
113112

114-
/// Decomposes the struct vector into its constituent parts (fields, validity, and length).
113+
/// Decomposes the struct vector into its constituent parts (fields and validity).
115114
pub fn into_parts(self) -> (Arc<Box<[Vector]>>, Mask) {
116115
(self.fields, self.validity)
117116
}
118117

119118
/// Returns the fields of the `StructVector`, each stored column-wise as a [`Vector`].
120-
pub fn fields(&self) -> &[Vector] {
121-
self.fields.as_ref()
119+
pub fn fields(&self) -> &Arc<Box<[Vector]>> {
120+
&self.fields
122121
}
123122
}
124123

vortex-vector/src/struct_/vector_mut.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,14 @@ impl VectorMutOps for StructVectorMut {
237237
);
238238

239239
// Extend each field vector.
240-
let pairs = self.fields.iter_mut().zip(other.fields());
240+
let pairs = self.fields.iter_mut().zip(other.fields().as_ref());
241241
for (self_mut_vector, other_vec) in pairs {
242242
match (self_mut_vector, other_vec) {
243243
(VectorMut::Null(a), Vector::Null(b)) => a.extend_from_vector(b),
244244
(VectorMut::Bool(a), Vector::Bool(b)) => a.extend_from_vector(b),
245245
(VectorMut::Primitive(a), Vector::Primitive(b)) => a.extend_from_vector(b),
246+
(VectorMut::String(a), Vector::String(b)) => a.extend_from_vector(b),
247+
(VectorMut::Binary(a), Vector::Binary(b)) => a.extend_from_vector(b),
246248
(VectorMut::Struct(a), Vector::Struct(b)) => a.extend_from_vector(b),
247249
_ => {
248250
vortex_panic!("Mismatched field types in `StructVectorMut::extend_from_vector`")
@@ -324,6 +326,8 @@ impl VectorMutOps for StructVectorMut {
324326
(VectorMut::Null(a), VectorMut::Null(b)) => a.unsplit(b),
325327
(VectorMut::Bool(a), VectorMut::Bool(b)) => a.unsplit(b),
326328
(VectorMut::Primitive(a), VectorMut::Primitive(b)) => a.unsplit(b),
329+
(VectorMut::String(a), VectorMut::String(b)) => a.unsplit(b),
330+
(VectorMut::Binary(a), VectorMut::Binary(b)) => a.unsplit(b),
327331
(VectorMut::Struct(a), VectorMut::Struct(b)) => a.unsplit(b),
328332
_ => {
329333
vortex_panic!("Mismatched field types in `StructVectorMut::unsplit`")

vortex-vector/src/vector.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
99
use vortex_error::vortex_panic;
1010

11-
use crate::macros::match_each_vector;
1211
use crate::varbin::{BinaryVector, StringVector};
13-
use crate::{BoolVector, NullVector, PrimitiveVector, StructVector, VectorMut, VectorOps};
12+
use crate::{
13+
BoolVector, NullVector, PrimitiveVector, StructVector, VectorMut, VectorOps, match_each_vector,
14+
};
1415

1516
/// An enum over all kinds of immutable vectors, which represent fully decompressed (canonical)
1617
/// array data.

vortex-vector/src/vector_mut.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use vortex_dtype::DType;
1010
use vortex_error::vortex_panic;
1111
use vortex_mask::MaskMut;
1212

13-
use super::macros::match_each_vector_mut;
1413
use crate::varbin::{BinaryVectorMut, StringVectorMut};
1514
use crate::{
1615
BoolVectorMut, NullVectorMut, PrimitiveVectorMut, StructVectorMut, Vector, VectorMutOps,
16+
match_each_vector_mut,
1717
};
1818

1919
/// An enum over all kinds of mutable vectors, which represent fully decompressed (canonical) array
@@ -98,6 +98,8 @@ impl VectorMutOps for VectorMut {
9898
(VectorMut::Null(a), Vector::Null(b)) => a.extend_from_vector(b),
9999
(VectorMut::Bool(a), Vector::Bool(b)) => a.extend_from_vector(b),
100100
(VectorMut::Primitive(a), Vector::Primitive(b)) => a.extend_from_vector(b),
101+
(VectorMut::String(a), Vector::String(b)) => a.extend_from_vector(b),
102+
(VectorMut::Binary(a), Vector::Binary(b)) => a.extend_from_vector(b),
101103
(VectorMut::Struct(a), Vector::Struct(b)) => a.extend_from_vector(b),
102104
_ => vortex_panic!("Mismatched vector types"),
103105
}

0 commit comments

Comments
 (0)