Skip to content

Commit 8b218cd

Browse files
committed
remove SharedVec -> Arc<[Array]>
1 parent 42e90aa commit 8b218cd

File tree

15 files changed

+18
-134
lines changed

15 files changed

+18
-134
lines changed

encodings/datetime-parts/src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl DateTimePartsArray {
6161
seconds_dtype: seconds.dtype().clone(),
6262
subseconds_dtype: subsecond.dtype().clone(),
6363
},
64-
vec![days, seconds, subsecond].into(),
64+
[days, seconds, subsecond].into(),
6565
StatsSet::new(),
6666
)
6767
}

encodings/dict/src/dict.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl DictArray {
3636
codes_dtype: codes.dtype().clone(),
3737
values_len: values.len(),
3838
},
39-
vec![values, codes].into(),
39+
[values, codes].into(),
4040
StatsSet::new(),
4141
)
4242
}

encodings/fastlanes/src/for/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl FoRArray {
3737
reference.dtype().clone(),
3838
child.len(),
3939
FoRMetadata { reference, shift },
40-
vec![child].into(),
40+
[child].into(),
4141
StatsSet::new(),
4242
)
4343
}

encodings/fsst/src/array.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::sync::Arc;
2+
13
use fsst::{Decompressor, Symbol};
24
use serde::{Deserialize, Serialize};
35
use vortex::array::VarBinArray;
@@ -73,7 +75,7 @@ impl FSSTArray {
7375
let len = codes.len();
7476
let strings_dtype = codes.dtype().clone();
7577
let uncompressed_lengths_dtype = uncompressed_lengths.dtype().clone();
76-
let children = vec![symbols, symbol_lengths, codes, uncompressed_lengths];
78+
let children = Arc::new([symbols, symbol_lengths, codes, uncompressed_lengths]);
7779

7880
Self::try_from_parts(
7981
dtype,
@@ -83,7 +85,7 @@ impl FSSTArray {
8385
codes_dtype: strings_dtype,
8486
uncompressed_lengths_dtype,
8587
},
86-
children.into(),
88+
children,
8789
StatsSet::new(),
8890
)
8991
}

encodings/zigzag/src/zigzag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl ZigZagArray {
3333
.with_nullability(encoded_dtype.nullability());
3434

3535
let len = encoded.len();
36-
let children = vec![encoded];
36+
let children = [encoded];
3737

3838
Self::try_from_parts(dtype, len, ZigZagMetadata, children.into(), StatsSet::new())
3939
}

vortex-array/src/arc_slice.rs

Lines changed: 0 additions & 114 deletions
This file was deleted.

vortex-array/src/array/constant/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl ConstantArray {
4646
scalar: scalar.clone(),
4747
length,
4848
},
49-
vec![].into(),
49+
[].into(),
5050
stats,
5151
)
5252
.unwrap_or_else(|err| {

vortex-array/src/array/extension/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl ExtensionArray {
2626
ExtensionMetadata {
2727
storage_dtype: storage.dtype().clone(),
2828
},
29-
vec![storage].into(),
29+
[storage].into(),
3030
Default::default(),
3131
)
3232
.vortex_expect("Invalid ExtensionArray")

vortex-array/src/array/null/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl NullArray {
2424
DType::Null,
2525
len,
2626
NullMetadata { len },
27-
vec![].into(),
27+
[].into(),
2828
StatsSet::nulls(len, &DType::Null),
2929
)
3030
.vortex_expect("NullArray::new should never fail!")

vortex-array/src/array/sparse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl SparseArray {
8181
len,
8282
fill_value,
8383
},
84-
vec![indices, values].into(),
84+
[indices, values].into(),
8585
StatsSet::new(),
8686
)
8787
}

vortex-array/src/data.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use vortex_dtype::DType;
55
use vortex_error::{vortex_bail, vortex_panic, VortexResult};
66
use vortex_scalar::Scalar;
77

8-
use crate::arc_slice::SharedVec;
98
use crate::encoding::EncodingRef;
109
use crate::stats::{Stat, Statistics, StatsSet};
1110
use crate::{Array, ArrayDType, ArrayMetadata, ToArray};
@@ -17,7 +16,7 @@ pub struct ArrayData {
1716
len: usize,
1817
metadata: Arc<dyn ArrayMetadata>,
1918
buffer: Option<Buffer>,
20-
children: SharedVec<Array>,
19+
children: Arc<[Array]>,
2120
stats_map: Arc<RwLock<StatsSet>>,
2221
}
2322

@@ -28,7 +27,7 @@ impl ArrayData {
2827
len: usize,
2928
metadata: Arc<dyn ArrayMetadata>,
3029
buffer: Option<Buffer>,
31-
children: SharedVec<Array>,
30+
children: Arc<[Array]>,
3231
statistics: StatsSet,
3332
) -> VortexResult<Self> {
3433
let data = Self {

vortex-array/src/implementation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ macro_rules! impl_encoding {
6464
dtype: vortex_dtype::DType,
6565
len: usize,
6666
metadata: [<$Name Metadata>],
67-
children: $crate::arc_slice::SharedVec<$crate::Array>,
67+
children: std::sync::Arc<[$crate::Array]>,
6868
stats: $crate::stats::StatsSet,
6969
) -> VortexResult<Self> {
7070
Ok(Self { typed: $crate::TypedArray::try_from_parts(dtype, len, metadata, None, children, stats)? })

vortex-array/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use crate::variants::ArrayVariants;
3535
use crate::visitor::{AcceptArrayVisitor, ArrayVisitor};
3636

3737
pub mod accessor;
38-
pub mod arc_slice;
3938
pub mod array;
4039
pub mod arrow;
4140
mod canonical;

vortex-array/src/typed.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use vortex_buffer::Buffer;
44
use vortex_dtype::DType;
55
use vortex_error::{vortex_bail, vortex_panic, VortexError, VortexResult};
66

7-
use crate::arc_slice::SharedVec;
87
use crate::stats::StatsSet;
98
use crate::{Array, ArrayData, ArrayDef, IntoArray, ToArray, TryDeserializeArrayMetadata};
109

@@ -20,7 +19,7 @@ impl<D: ArrayDef> TypedArray<D> {
2019
len: usize,
2120
metadata: D::Metadata,
2221
buffer: Option<Buffer>,
23-
children: SharedVec<Array>,
22+
children: Arc<[Array]>,
2423
stats: StatsSet,
2524
) -> VortexResult<Self> {
2625
let array = Array::Data(ArrayData::try_new(

vortex-array/src/view.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use vortex_dtype::{DType, Nullability};
99
use vortex_error::{vortex_bail, vortex_err, VortexError, VortexExpect as _, VortexResult};
1010
use vortex_scalar::{PValue, Scalar, ScalarValue};
1111

12-
use crate::arc_slice::SharedVec;
1312
use crate::encoding::EncodingRef;
1413
use crate::opaque::OpaqueEncoding;
1514
use crate::stats::{Stat, Statistics, StatsSet};
@@ -23,7 +22,7 @@ pub struct ArrayView {
2322
len: usize,
2423
flatbuffer: Buffer,
2524
flatbuffer_loc: usize,
26-
buffers: SharedVec<Buffer>,
25+
buffers: Arc<[Buffer]>,
2726
ctx: Arc<Context>,
2827
// TODO(ngates): a store a Projection. A projected ArrayView contains the full fb::Array
2928
// metadata, but only the buffers from the selected columns. Therefore we need to know
@@ -74,7 +73,7 @@ impl ArrayView {
7473
len,
7574
flatbuffer,
7675
flatbuffer_loc,
77-
buffers: SharedVec::from(buffers),
76+
buffers: buffers.into(),
7877
ctx,
7978
};
8079

0 commit comments

Comments
 (0)