Skip to content

Commit 50f2a1c

Browse files
committed
rename PathStrategy -> TableStrategy
Signed-off-by: Andrew Duffy <[email protected]>
1 parent 15b8c9e commit 50f2a1c

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

vortex-file/src/strategy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use vortex_layout::layouts::compressed::CompressingStrategy;
1414
use vortex_layout::layouts::compressed::CompressorPlugin;
1515
use vortex_layout::layouts::dict::writer::DictStrategy;
1616
use vortex_layout::layouts::flat::writer::FlatLayoutStrategy;
17-
use vortex_layout::layouts::path::PathStrategy;
1817
use vortex_layout::layouts::repartition::RepartitionStrategy;
1918
use vortex_layout::layouts::repartition::RepartitionWriterOptions;
19+
use vortex_layout::layouts::table::TableStrategy;
2020
use vortex_layout::layouts::zoned::writer::ZonedLayoutOptions;
2121
use vortex_layout::layouts::zoned::writer::ZonedStrategy;
2222
use vortex_utils::aliases::hash_map::HashMap;
@@ -142,7 +142,7 @@ impl WriteStrategyBuilder {
142142
let validity_strategy = CollectStrategy::new(compress_then_flat);
143143

144144
// Take any field overrides from the builder and apply them to the final strategy.
145-
let table_strategy = PathStrategy::new(Arc::new(validity_strategy), Arc::new(repartition))
145+
let table_strategy = TableStrategy::new(Arc::new(validity_strategy), Arc::new(repartition))
146146
.with_field_writers(self.field_writers);
147147

148148
Arc::new(table_strategy)

vortex-file/tests/test_write_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use vortex_file::WriteOptionsSessionExt;
2424
use vortex_io::session::RuntimeSession;
2525
use vortex_layout::layouts::compressed::CompressingStrategy;
2626
use vortex_layout::layouts::flat::writer::FlatLayoutStrategy;
27-
use vortex_layout::layouts::path::PathStrategy;
27+
use vortex_layout::layouts::table::TableStrategy;
2828
use vortex_layout::session::LayoutSession;
2929
use vortex_metrics::VortexMetrics;
3030
use vortex_session::VortexSession;
@@ -66,14 +66,14 @@ async fn test_file_roundtrip() {
6666
.into_array();
6767

6868
// Create a writer which by default uses the BtrBlocks compressor, but for a.raw column it will
69-
// leave it uncompressed.
69+
// leave it uncompressed. And for the a.no_dict column disables dictionary compression.
7070
let default_strategy = Arc::new(CompressingStrategy::new_btrblocks(
7171
FlatLayoutStrategy::default(),
7272
false,
7373
));
7474

7575
let writer = Arc::new(
76-
PathStrategy::new(Arc::new(FlatLayoutStrategy::default()), default_strategy)
76+
TableStrategy::new(Arc::new(FlatLayoutStrategy::default()), default_strategy)
7777
.with_field_writer(field_path!(a.raw), Arc::new(FlatLayoutStrategy::default())),
7878
);
7979

vortex-layout/src/layouts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ pub mod dict;
1818
pub mod file_stats;
1919
pub mod flat;
2020
pub(crate) mod partitioned;
21-
pub mod path;
2221
pub mod repartition;
2322
pub mod row_idx;
2423
pub mod struct_;
24+
pub mod table;
2525
pub mod zoned;
2626

2727
pub type SharedArrayFuture = Shared<BoxFuture<'static, SharedVortexResult<ArrayRef>>>;

vortex-layout/src/layouts/struct_/reader.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ mod tests {
417417
use crate::LayoutRef;
418418
use crate::LayoutStrategy;
419419
use crate::layouts::flat::writer::FlatLayoutStrategy;
420-
use crate::layouts::path::PathStrategy;
420+
use crate::layouts::table::TableStrategy;
421421
use crate::segments::SegmentSource;
422422
use crate::segments::TestSegments;
423423
use crate::sequence::SequenceId;
@@ -430,7 +430,7 @@ mod tests {
430430

431431
let segments = Arc::new(TestSegments::default());
432432
let (ptr, eof) = SequenceId::root().split();
433-
let strategy = PathStrategy::new(
433+
let strategy = TableStrategy::new(
434434
Arc::new(FlatLayoutStrategy::default()),
435435
Arc::new(FlatLayoutStrategy::default()),
436436
);
@@ -463,7 +463,7 @@ mod tests {
463463
let ctx = ArrayContext::empty();
464464
let segments = Arc::new(TestSegments::default());
465465
let (ptr, eof) = SequenceId::root().split();
466-
let strategy = PathStrategy::new(
466+
let strategy = TableStrategy::new(
467467
Arc::new(FlatLayoutStrategy::default()),
468468
Arc::new(FlatLayoutStrategy::default()),
469469
);
@@ -499,7 +499,7 @@ mod tests {
499499

500500
let segments = Arc::new(TestSegments::default());
501501
let (ptr, eof) = SequenceId::root().split();
502-
let strategy = PathStrategy::new(
502+
let strategy = TableStrategy::new(
503503
Arc::new(FlatLayoutStrategy::default()),
504504
Arc::new(FlatLayoutStrategy::default()),
505505
);
@@ -540,7 +540,7 @@ mod tests {
540540
let ctx = ArrayContext::empty();
541541
let segments = Arc::new(TestSegments::default());
542542
let (ptr, eof) = SequenceId::root().split();
543-
let strategy = PathStrategy::new(
543+
let strategy = TableStrategy::new(
544544
Arc::new(FlatLayoutStrategy::default()),
545545
Arc::new(FlatLayoutStrategy::default()),
546546
);

vortex-layout/src/layouts/struct_/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ use crate::sequence::SequentialStreamExt;
4141
/// as its own distinct stream.
4242
///
4343
/// This is now deprecated, users are encouraged to instead use the
44-
/// [`PathStrategy`][crate::layouts::path::PathStrategy].
44+
/// [`TableStrategy`][crate::layouts::table::TableStrategy].
4545
#[derive(Clone)]
46-
#[deprecated(since = "0.57.0", note = "Use the `PathStrategy` instead.")]
46+
#[deprecated(since = "0.57.0", note = "Use the `TableStrategy` instead.")]
4747
pub struct StructStrategy {
4848
child: Arc<dyn LayoutStrategy>,
4949
validity: Arc<dyn LayoutStrategy>,
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use crate::sequence::SequentialStreamExt;
4444

4545
/// A configurable strategy for writing tables with nested field columns, allowing
4646
/// overrides for specific leaf columns.
47-
pub struct PathStrategy {
47+
pub struct TableStrategy {
4848
/// A set of leaf field overrides, e.g. to force one column to be compact-compressed.
4949
leaf_writers: HashMap<FieldPath, Arc<dyn LayoutStrategy>>,
5050
/// The writer for any validity arrays that may be present
@@ -53,7 +53,7 @@ pub struct PathStrategy {
5353
fallback: Arc<dyn LayoutStrategy>,
5454
}
5555

56-
impl Default for PathStrategy {
56+
impl Default for TableStrategy {
5757
fn default() -> Self {
5858
let flat = Arc::new(FlatLayoutStrategy::default());
5959

@@ -65,7 +65,7 @@ impl Default for PathStrategy {
6565
}
6666
}
6767

68-
impl PathStrategy {
68+
impl TableStrategy {
6969
/// Create a new writer with the specified write strategies for validity, and for all leaf
7070
/// fields, with no overrides.
7171
///
@@ -76,12 +76,12 @@ impl PathStrategy {
7676
/// ```
7777
/// # use std::sync::Arc;
7878
/// # use vortex_layout::layouts::flat::writer::FlatLayoutStrategy;
79-
/// # use vortex_layout::layouts::path::PathStrategy;
79+
/// # use vortex_layout::layouts::table::TableStrategy;
8080
///
8181
/// // Build a write strategy that does not compress validity or any leaf fields.
8282
/// let flat = Arc::new(FlatLayoutStrategy::default());
8383
///
84-
/// let strategy = PathStrategy::new(flat.clone(), flat.clone());
84+
/// let strategy = TableStrategy::new(flat.clone(), flat.clone());
8585
/// ```
8686
pub fn new(validity: Arc<dyn LayoutStrategy>, fallback: Arc<dyn LayoutStrategy>) -> Self {
8787
Self {
@@ -101,7 +101,7 @@ impl PathStrategy {
101101
/// # use vortex_layout::layouts::compact::CompactCompressor;
102102
/// # use vortex_layout::layouts::compressed::CompressingStrategy;
103103
/// # use vortex_layout::layouts::flat::writer::FlatLayoutStrategy;
104-
/// # use vortex_layout::layouts::path::PathStrategy;
104+
/// # use vortex_layout::layouts::table::TableStrategy;
105105
///
106106
/// // A strategy for compressing data using the balanced BtrBlocks compressor.
107107
/// let compress_btrblocks = CompressingStrategy::new_btrblocks(FlatLayoutStrategy::default(), true);
@@ -112,7 +112,7 @@ impl PathStrategy {
112112
/// // Our combined strategy uses no compression for validity buffers, BtrBlocks compression
113113
/// // for most columns, and will use ZSTD compression for a nested binary column that we know
114114
/// // is never filtered in.
115-
/// let strategy = PathStrategy::new(
115+
/// let strategy = TableStrategy::new(
116116
/// Arc::new(FlatLayoutStrategy::default()),
117117
/// Arc::new(compress_btrblocks),
118118
/// )
@@ -146,7 +146,7 @@ impl PathStrategy {
146146
}
147147
}
148148

149-
impl PathStrategy {
149+
impl TableStrategy {
150150
// Descend into a subfield for the writer.
151151
fn descend(&self, field: &Field) -> Self {
152152
// Start with the existing set of overrides, then only retain the ones that contain
@@ -184,7 +184,7 @@ impl PathStrategy {
184184

185185
/// Specialized strategy for when we exactly know the input schema.
186186
#[async_trait]
187-
impl LayoutStrategy for PathStrategy {
187+
impl LayoutStrategy for TableStrategy {
188188
async fn write_stream(
189189
&self,
190190
ctx: ArrayContext,
@@ -361,7 +361,7 @@ mod tests {
361361
use vortex_dtype::field_path;
362362

363363
use crate::layouts::flat::writer::FlatLayoutStrategy;
364-
use crate::layouts::path::PathStrategy;
364+
use crate::layouts::table::TableStrategy;
365365

366366
#[test]
367367
#[should_panic(
@@ -371,7 +371,7 @@ mod tests {
371371
let flat = Arc::new(FlatLayoutStrategy::default());
372372

373373
// Success
374-
let path = PathStrategy::default().with_field_writer(field_path!(a.b.c), flat.clone());
374+
let path = TableStrategy::default().with_field_writer(field_path!(a.b.c), flat.clone());
375375

376376
// Should panic right here.
377377
let _path = path.with_field_writer(field_path!(a.b), flat);

0 commit comments

Comments
 (0)