Skip to content

Commit 9c16134

Browse files
committed
Merge remote-tracking branch 'origin/ngates/expr-reduce-rules' into ji/expr-reduce-rules
# Conflicts: # vortex-gpu/benches/gpu_bitunpack.rs # vortex-layout/src/layouts/dict/reader.rs
2 parents 30b9b3a + 8e90e86 commit 9c16134

File tree

33 files changed

+101
-219
lines changed

33 files changed

+101
-219
lines changed

vortex-file/src/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl VortexFile {
8585
self.footer
8686
.layout()
8787
// TODO(ngates): we may want to allow the user pass in a name here?
88-
.new_reader("".into(), segment_source)
88+
.new_reader("".into(), segment_source, &self.session)
8989
}
9090

9191
/// Initiate a scan of the file, returning a builder for configuring the scan.

vortex-file/src/footer/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ impl Footer {
8686
.map(|encoding| encoding.id());
8787
let array_ctx = ArrayContext::try_from_registry(session.arrays().registry(), array_ids)?;
8888

89-
let root_layout =
90-
layout_from_flatbuffer(layout_bytes, &dtype, &layout_ctx, &array_ctx, session)?;
89+
let root_layout = layout_from_flatbuffer(layout_bytes, &dtype, &layout_ctx, &array_ctx)?;
9190

9291
let segments: Arc<[SegmentSpec]> = fb_footer
9392
.segment_specs()

vortex-file/src/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl VortexWriteOptions {
150150
let layout_fut = self.session.handle().spawn_nested(|h| async move {
151151
let layout = self
152152
.strategy
153-
.write_stream(ctx2, &self.session, segments.clone(), stream, eof, h)
153+
.write_stream(ctx2, segments.clone(), stream, eof, h)
154154
.await?;
155155
Ok::<_, VortexError>((layout, segments.segment_specs()))
156156
});

vortex-gpu/benches/gpu_bitunpack.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![allow(clippy::unwrap_used)]
55
#![allow(dead_code)]
66

7-
87
use rand::prelude::StdRng;
98
use rand::{Rng, SeedableRng};
109
use vortex_alp::{ALPArray, Exponents};

vortex-layout/src/children.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use vortex_array::ArrayContext;
1010
use vortex_dtype::DType;
1111
use vortex_error::{VortexResult, vortex_bail, vortex_err};
1212
use vortex_flatbuffers::{FlatBuffer, layout as fbl};
13-
use vortex_session::VortexSession;
1413

1514
use crate::segments::SegmentId;
1615
use crate::{LayoutContext, LayoutRef};
@@ -98,7 +97,6 @@ pub(crate) struct ViewedLayoutChildren {
9897
flatbuffer_loc: usize,
9998
array_ctx: ArrayContext,
10099
layout_ctx: LayoutContext,
101-
session: VortexSession,
102100
}
103101

104102
impl ViewedLayoutChildren {
@@ -112,14 +110,12 @@ impl ViewedLayoutChildren {
112110
flatbuffer_loc: usize,
113111
array_ctx: ArrayContext,
114112
layout_ctx: LayoutContext,
115-
session: VortexSession,
116113
) -> Self {
117114
Self {
118115
flatbuffer,
119116
flatbuffer_loc,
120117
array_ctx,
121118
layout_ctx,
122-
session,
123119
}
124120
}
125121

@@ -148,7 +144,6 @@ impl LayoutChildren for ViewedLayoutChildren {
148144
flatbuffer_loc: fb_child._tab.loc(),
149145
array_ctx: self.array_ctx.clone(),
150146
layout_ctx: self.layout_ctx.clone(),
151-
session: self.session.clone(),
152147
};
153148
let encoding = self
154149
.layout_ctx
@@ -170,7 +165,6 @@ impl LayoutChildren for ViewedLayoutChildren {
170165
.collect_vec(),
171166
&viewed_children,
172167
self.array_ctx.clone(),
173-
&self.session,
174168
)
175169
}
176170

vortex-layout/src/encoding.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use arcref::ArcRef;
88
use vortex_array::{ArrayContext, DeserializeMetadata};
99
use vortex_dtype::DType;
1010
use vortex_error::{VortexExpect, VortexResult, vortex_panic};
11-
use vortex_session::VortexSession;
1211

1312
use crate::segments::SegmentId;
1413
use crate::{IntoLayout, LayoutChildren, LayoutRef, VTable};
@@ -30,7 +29,6 @@ pub trait LayoutEncoding: 'static + Send + Sync + Debug + private::Sealed {
3029
segment_ids: Vec<SegmentId>,
3130
children: &dyn LayoutChildren,
3231
ctx: ArrayContext,
33-
session: &VortexSession,
3432
) -> VortexResult<LayoutRef>;
3533
}
3634

@@ -54,7 +52,6 @@ impl<V: VTable> LayoutEncoding for LayoutEncodingAdapter<V> {
5452
segment_ids: Vec<SegmentId>,
5553
children: &dyn LayoutChildren,
5654
ctx: ArrayContext,
57-
session: &VortexSession,
5855
) -> VortexResult<LayoutRef> {
5956
let metadata = <V::Metadata as DeserializeMetadata>::deserialize(metadata)?;
6057
let layout = V::build(
@@ -65,7 +62,6 @@ impl<V: VTable> LayoutEncoding for LayoutEncodingAdapter<V> {
6562
segment_ids,
6663
children,
6764
ctx,
68-
session,
6965
)?;
7066

7167
// Validate that the builder function returned the expected values.

vortex-layout/src/flatbuffers.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use vortex_array::ArrayContext;
99
use vortex_dtype::DType;
1010
use vortex_error::{VortexExpect, VortexResult, vortex_err};
1111
use vortex_flatbuffers::{FlatBuffer, FlatBufferRoot, WriteFlatBuffer, layout};
12-
use vortex_session::VortexSession;
1312

1413
use crate::children::ViewedLayoutChildren;
1514
use crate::segments::SegmentId;
@@ -38,7 +37,6 @@ pub fn layout_from_flatbuffer(
3837
dtype: &DType,
3938
layout_ctx: &LayoutContext,
4039
array_ctx: &ArrayContext,
41-
session: &VortexSession,
4240
) -> VortexResult<LayoutRef> {
4341
let fb_layout = root_with_opts::<layout::Layout>(&LAYOUT_VERIFIER, &flatbuffer)?;
4442
let encoding = layout_ctx
@@ -52,7 +50,6 @@ pub fn layout_from_flatbuffer(
5250
fb_layout._tab.loc(),
5351
array_ctx.clone(),
5452
layout_ctx.clone(),
55-
session.clone(),
5653
)
5754
};
5855

@@ -71,7 +68,6 @@ pub fn layout_from_flatbuffer(
7168
.collect(),
7269
&viewed_children,
7370
array_ctx.clone(),
74-
session,
7571
)?;
7672

7773
Ok(layout)

vortex-layout/src/layout.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use itertools::Itertools;
1010
use vortex_array::SerializeMetadata;
1111
use vortex_dtype::{DType, FieldName};
1212
use vortex_error::{VortexExpect, VortexResult, vortex_err};
13+
use vortex_session::VortexSession;
1314

1415
use crate::display::DisplayLayoutTree;
1516
use crate::segments::{SegmentId, SegmentSource};
@@ -63,6 +64,7 @@ pub trait Layout: 'static + Send + Sync + Debug + private::Sealed {
6364
&self,
6465
name: Arc<str>,
6566
segment_source: Arc<dyn SegmentSource>,
67+
session: &VortexSession,
6668
) -> VortexResult<LayoutReaderRef>;
6769
}
6870

@@ -273,8 +275,9 @@ impl<V: VTable> Layout for LayoutAdapter<V> {
273275
&self,
274276
name: Arc<str>,
275277
segment_source: Arc<dyn SegmentSource>,
278+
session: &VortexSession,
276279
) -> VortexResult<LayoutReaderRef> {
277-
V::new_reader(&self.0, name, segment_source)
280+
V::new_reader(&self.0, name, segment_source, session)
278281
}
279282
}
280283

vortex-layout/src/layouts/buffered.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use futures::StreamExt as _;
1111
use vortex_array::ArrayContext;
1212
use vortex_error::VortexResult;
1313
use vortex_io::runtime::Handle;
14-
use vortex_session::VortexSession;
1514

1615
use crate::segments::SegmentSinkRef;
1716
use crate::sequence::{
@@ -41,7 +40,6 @@ impl LayoutStrategy for BufferedStrategy {
4140
async fn write_stream(
4241
&self,
4342
ctx: ArrayContext,
44-
session: &VortexSession,
4543
segment_sink: SegmentSinkRef,
4644
mut stream: SendableSequentialStream,
4745
mut eof: SequencePointer,
@@ -96,7 +94,6 @@ impl LayoutStrategy for BufferedStrategy {
9694
self.child
9795
.write_stream(
9896
ctx,
99-
session,
10097
segment_sink,
10198
SequentialStreamAdapter::new(dtype, buffered_stream).sendable(),
10299
eof,

vortex-layout/src/layouts/chunked/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ impl VTable for ChunkedVTable {
6565
layout: &Self::Layout,
6666
name: Arc<str>,
6767
segment_source: Arc<dyn SegmentSource>,
68+
session: &VortexSession,
6869
) -> VortexResult<LayoutReaderRef> {
6970
Ok(Arc::new(ChunkedReader::new(
7071
layout.clone(),
7172
name,
7273
segment_source,
74+
session,
7375
)))
7476
}
7577

@@ -98,7 +100,6 @@ impl VTable for ChunkedVTable {
98100
_segment_ids: Vec<SegmentId>,
99101
children: &dyn LayoutChildren,
100102
_ctx: ArrayContext,
101-
_session: &VortexSession,
102103
) -> VortexResult<Self::Layout> {
103104
Ok(ChunkedLayout::new(
104105
row_count,

0 commit comments

Comments
 (0)