Skip to content

Commit ef33c36

Browse files
authored
Do not inline vortex_array into vortex:: namespace (#5584)
Sadly this is a large break to the Rust API, but we kept conflicting the modules names within vortex_array with the crate names within the vortex workspace. ## Breaking Change Many types exposed on `vortex::*` will now be exposed on `vortex::array::*`. This script should do it: ```bash #!/bin/bash # Script to migrate from vortex::* to vortex::array::* # # Usage: ./migrate_vortex.sh [directory] DIR="${1:-.}" # Modules that stay at vortex:: root level EXCLUDED="array|buffer|compute|compressor|dtype|encodings|error|expr|file|flatbuffers|io|ipc|layout|mask|metrics|proto|scalar|scan|session|utils" find "$DIR" -name "*.rs" -type f | while read file; do # Step 1: Replace all vortex::X with vortex::array::X sed -i.bak -E "s/vortex::([a-zA-Z_][a-zA-Z0-9_]*)/vortex::array::\1/g" "$file" # Step 2: Revert excluded modules back to vortex:: sed -i.bak -E "s/vortex::array::(${EXCLUDED})/vortex::\1/g" "$file" # Step 3: Fix any double array:: that got created sed -i.bak -E "s/vortex::array::array::/vortex::array::/g" "$file" rm -f "${file}.bak" done echo "Migration complete!" ``` --------- Signed-off-by: Nicholas Gates <[email protected]>
1 parent 4f1306b commit ef33c36

File tree

125 files changed

+433
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+433
-434
lines changed

bench-vortex/src/bin/compress.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use std::time::Duration;
1010
use bench_vortex::Engine;
1111
use bench_vortex::Format;
1212
use bench_vortex::Target;
13+
use bench_vortex::compress::bench as compress;
1314
use bench_vortex::compress::bench::CompressMeasurements;
1415
use bench_vortex::compress::bench::CompressOp;
15-
use bench_vortex::compress::bench::{self as compress};
1616
use bench_vortex::datasets::Dataset;
1717
use bench_vortex::datasets::struct_list_of_ints::StructListOfInts;
1818
use bench_vortex::datasets::taxi_data::TaxiData;
@@ -38,11 +38,11 @@ use indicatif::ProgressBar;
3838
use itertools::Itertools;
3939
use regex::Regex;
4040
use tokio::runtime::Runtime;
41-
use vortex::Array;
42-
use vortex::IntoArray;
43-
use vortex::arrays::ChunkedArray;
44-
use vortex::arrays::ChunkedVTable;
45-
use vortex::builders::builder_with_capacity;
41+
use vortex::array::Array;
42+
use vortex::array::IntoArray;
43+
use vortex::array::arrays::ChunkedArray;
44+
use vortex::array::arrays::ChunkedVTable;
45+
use vortex::array::builders::builder_with_capacity;
4646
use vortex::utils::aliases::hash_map::HashMap;
4747

4848
#[derive(Parser, Debug)]

bench-vortex/src/bin/random_access.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use bench_vortex::utils::new_tokio_runtime;
2626
use clap::Parser;
2727
use indicatif::ProgressBar;
2828
use tokio::runtime::Runtime;
29-
use vortex::Array;
30-
use vortex::ArrayRef;
31-
use vortex::ToCanonical;
29+
use vortex::array::Array;
30+
use vortex::array::ArrayRef;
31+
use vortex::array::ToCanonical;
3232
use vortex::buffer::Buffer;
3333
use vortex::buffer::buffer;
3434
use vortex::dtype::Nullability::NonNullable;

bench-vortex/src/compress/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use parquet::basic::Compression;
1414
use parquet::basic::ZstdLevel;
1515
use serde::Serialize;
1616
use tokio::runtime::Runtime;
17-
use vortex::Array;
18-
use vortex::arrays::ChunkedVTable;
17+
use vortex::array::Array;
18+
use vortex::array::arrays::ChunkedVTable;
1919
use vortex::utils::aliases::hash_map::HashMap;
2020
#[cfg(feature = "lance")]
2121
#[rustfmt::skip]

bench-vortex/src/compress/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use std::sync::Arc;
55

6-
use ::vortex::arrays::ChunkedArray;
7-
use ::vortex::arrays::recursive_list_from_list_view;
6+
use ::vortex::array::arrays::ChunkedArray;
7+
use ::vortex::array::arrays::recursive_list_from_list_view;
88
use arrow_array::RecordBatch;
99
use arrow_schema::Schema;
1010

bench-vortex/src/compress/vortex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use bytes::Bytes;
88
use futures::StreamExt;
99
use futures::pin_mut;
10-
use vortex::Array;
10+
use vortex::array::Array;
1111
use vortex::file::OpenOptionsSessionExt;
1212
use vortex::file::WriteOptionsSessionExt;
1313

bench-vortex/src/conversions.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use std::path::PathBuf;
66

77
use arrow_array::RecordBatchReader;
88
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
9-
use vortex::ArrayRef;
10-
use vortex::arrow::FromArrowArray;
9+
use vortex::array::ArrayRef;
10+
use vortex::array::arrow::FromArrowArray;
11+
use vortex::array::iter::ArrayIteratorAdapter;
12+
use vortex::array::iter::ArrayIteratorExt;
13+
use vortex::array::stream::ArrayStream;
1114
use vortex::dtype::DType;
1215
use vortex::dtype::arrow::FromArrowType;
1316
use vortex::error::VortexError;
14-
use vortex::iter::ArrayIteratorAdapter;
15-
use vortex::iter::ArrayIteratorExt;
16-
use vortex::stream::ArrayStream;
1717

1818
pub fn parquet_to_vortex(parquet_path: PathBuf) -> anyhow::Result<impl ArrayStream> {
1919
let reader = ParquetRecordBatchReaderBuilder::try_new(File::open(parquet_path)?)?.build()?;

bench-vortex/src/datasets/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use async_trait::async_trait;
88
use datafusion::prelude::SessionContext;
99
use serde::Serialize;
1010
use url::Url;
11-
use vortex::ArrayRef;
11+
use vortex::array::ArrayRef;
1212

1313
use crate::Format;
1414
use crate::clickbench;

bench-vortex/src/datasets/struct_list_of_ints.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use async_trait::async_trait;
66
use rand::Rng;
77
use rand::SeedableRng;
88
use rand::rngs::StdRng;
9-
use vortex::ArrayRef;
10-
use vortex::IntoArray;
11-
use vortex::arrays::ChunkedArray;
12-
use vortex::arrays::ListArray;
13-
use vortex::arrays::PrimitiveArray;
14-
use vortex::arrays::StructArray;
9+
use vortex::array::ArrayRef;
10+
use vortex::array::IntoArray;
11+
use vortex::array::arrays::ChunkedArray;
12+
use vortex::array::arrays::ListArray;
13+
use vortex::array::arrays::PrimitiveArray;
14+
use vortex::array::arrays::StructArray;
15+
use vortex::array::validity::Validity;
1516
use vortex::dtype::FieldNames;
16-
use vortex::validity::Validity;
1717

1818
use crate::datasets::Dataset;
1919

bench-vortex/src/datasets/taxi_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use anyhow::Result;
77
use async_trait::async_trait;
88
use tokio::fs::File as TokioFile;
99
use tokio::io::AsyncWriteExt;
10-
use vortex::ArrayRef;
10+
use vortex::array::ArrayRef;
11+
use vortex::array::stream::ArrayStreamExt;
1112
use vortex::file::OpenOptionsSessionExt;
1213
use vortex::file::WriteOptionsSessionExt;
13-
use vortex::stream::ArrayStreamExt;
1414
#[cfg(feature = "lance")]
1515
#[rustfmt::skip]
1616
use {

bench-vortex/src/datasets/tpch_l_comment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ use anyhow::Result;
55
use async_trait::async_trait;
66
use futures::TryStreamExt;
77
use glob::glob;
8-
use vortex::Array;
9-
use vortex::ArrayRef;
10-
use vortex::IntoArray;
11-
use vortex::ToCanonical;
12-
use vortex::arrays::ChunkedArray;
8+
use vortex::array::Array;
9+
use vortex::array::ArrayRef;
10+
use vortex::array::IntoArray;
11+
use vortex::array::ToCanonical;
12+
use vortex::array::arrays::ChunkedArray;
1313
use vortex::dtype::Nullability::NonNullable;
1414
use vortex::expr::col;
1515
use vortex::expr::pack;

0 commit comments

Comments
 (0)