Skip to content

Commit

Permalink
Move to the 2024 rust edition (#2490)
Browse files Browse the repository at this point in the history
given the number of unstable features we use, why not enjoy the new
[2024 edition](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html).
  • Loading branch information
AdamGS authored Feb 25, 2025
1 parent dcc482b commit 0c58969
Show file tree
Hide file tree
Showing 469 changed files with 1,170 additions and 1,107 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ include = [
"flatbuffers/**/*.fbs",
"README.md",
]
edition = "2021"
rust-version = "1.84"
edition = "2024"
rust-version = "1.86"
readme = "README.md"
categories = ["database-implementations", "data-structures", "compression"]

Expand Down
10 changes: 5 additions & 5 deletions bench-vortex/src/bin/clickbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use std::fs::{self, File};
use std::path::PathBuf;
use std::time::{Duration, Instant};

use bench_vortex::clickbench::{self, clickbench_queries, HITS_SCHEMA};
use bench_vortex::display::{print_measurements_json, render_table, DisplayFormat, RatioMode};
use bench_vortex::clickbench::{self, HITS_SCHEMA, clickbench_queries};
use bench_vortex::display::{DisplayFormat, RatioMode, print_measurements_json, render_table};
use bench_vortex::measurements::QueryMeasurement;
use bench_vortex::{
default_env_filter, execute_physical_plan, feature_flagged_allocator, get_session_with_cache,
idempotent, physical_plan, Format, IdempotentPath as _,
Format, IdempotentPath as _, default_env_filter, execute_physical_plan,
feature_flagged_allocator, get_session_with_cache, idempotent, physical_plan,
};
use clap::Parser;
use datafusion_physical_plan::display::DisplayableExecutionPlan;
Expand All @@ -18,7 +18,7 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator as _};
use tokio::runtime::Builder;
use tracing::info_span;
use tracing_futures::Instrument;
use vortex::error::{vortex_panic, VortexExpect};
use vortex::error::{VortexExpect, vortex_panic};

feature_flagged_allocator!();

Expand Down
8 changes: 4 additions & 4 deletions bench-vortex/src/bin/compress.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use bench_vortex::compress::bench::{benchmark_compress, CompressMeasurements};
use bench_vortex::compress::bench::{CompressMeasurements, benchmark_compress};
use bench_vortex::datasets::BenchmarkDataset;
use bench_vortex::datasets::public_bi_data::PBIDataset::{
AirlineSentiment, Arade, Bimbo, CMSprovider, Euro2016, Food, HashTags,
};
use bench_vortex::datasets::struct_list_of_ints::StructListOfInts;
use bench_vortex::datasets::taxi_data::TaxiData;
use bench_vortex::datasets::tpch_l_comment::{TPCHLCommentCanonical, TPCHLCommentChunked};
use bench_vortex::datasets::BenchmarkDataset;
use bench_vortex::display::{print_measurements_json, render_table, DisplayFormat, RatioMode};
use bench_vortex::{default_env_filter, feature_flagged_allocator, setup_logger, Format};
use bench_vortex::display::{DisplayFormat, RatioMode, print_measurements_json, render_table};
use bench_vortex::{Format, default_env_filter, feature_flagged_allocator, setup_logger};
use clap::Parser;
use indicatif::ProgressBar;
use regex::Regex;
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/bin/notimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use vortex::arrays::{
VarBinViewArray,
};
use vortex::buffer::buffer;
use vortex::datetime_dtype::{TemporalMetadata, TimeUnit, TIME_ID};
use vortex::datetime_dtype::{TIME_ID, TemporalMetadata, TimeUnit};
use vortex::dtype::{DType, ExtDType, Nullability, PType};
use vortex::encodings::alp::{ALPArray, Exponents, RDEncoder};
use vortex::encodings::bytebool::ByteBoolArray;
Expand Down
6 changes: 3 additions & 3 deletions bench-vortex/src/bin/random_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use std::process::ExitCode;

use bench_vortex::bench_run::run_with_setup;
use bench_vortex::datasets::taxi_data::{taxi_data_parquet, taxi_data_vortex};
use bench_vortex::display::{print_measurements_json, render_table, DisplayFormat, RatioMode};
use bench_vortex::display::{DisplayFormat, RatioMode, print_measurements_json, render_table};
use bench_vortex::measurements::TimingMeasurement;
use bench_vortex::random_access::take::{take_parquet, take_vortex_tokio};
use bench_vortex::{default_env_filter, feature_flagged_allocator, setup_logger, Format};
use bench_vortex::{Format, default_env_filter, feature_flagged_allocator, setup_logger};
use clap::Parser;
use indicatif::ProgressBar;
use tokio::runtime::{Builder, Runtime};
use vortex::buffer::{buffer, Buffer};
use vortex::buffer::{Buffer, buffer};

feature_flagged_allocator!();

Expand Down
20 changes: 11 additions & 9 deletions bench-vortex/src/bin/tpch.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use std::process::ExitCode;
use std::time::{Duration, Instant};

use bench_vortex::display::{print_measurements_json, render_table, DisplayFormat, RatioMode};
use bench_vortex::display::{DisplayFormat, RatioMode, print_measurements_json, render_table};
use bench_vortex::measurements::QueryMeasurement;
use bench_vortex::metrics::MetricsSetExt;
use bench_vortex::tpch::dbgen::{DBGen, DBGenOptions};
use bench_vortex::tpch::duckdb::{generate_tpch, DuckdbTpchOptions};
use bench_vortex::tpch::duckdb::{DuckdbTpchOptions, generate_tpch};
use bench_vortex::tpch::{
load_datasets, run_tpch_query, tpch_queries, EXPECTED_ROW_COUNTS_SF1, EXPECTED_ROW_COUNTS_SF10,
TPC_H_ROW_COUNT_ARRAY_LENGTH,
EXPECTED_ROW_COUNTS_SF1, EXPECTED_ROW_COUNTS_SF10, TPC_H_ROW_COUNT_ARRAY_LENGTH, load_datasets,
run_tpch_query, tpch_queries,
};
use bench_vortex::{default_env_filter, feature_flagged_allocator, setup_logger, Format};
use bench_vortex::{Format, default_env_filter, feature_flagged_allocator, setup_logger};
use clap::{Parser, ValueEnum};
use datafusion_physical_plan::metrics::{Label, MetricsSet};
use indicatif::ProgressBar;
Expand Down Expand Up @@ -113,13 +113,15 @@ fn main() -> ExitCode {
//
// The folder must already be populated with data!
if !tpch_benchmark_remote_data_dir.ends_with("/") {
warn!("Supply a --use-remote-data-dir argument which ends in a slash e.g. s3://vortex-bench-dev/parquet/");
warn!(
"Supply a --use-remote-data-dir argument which ends in a slash e.g. s3://vortex-bench-dev/parquet/"
);
}
info!(
concat!(
"Assuming data already exists at this remote (e.g. S3, GCS) URL: {}.\n",
"If it does not, you should kill this command, locally generate the files (by running without\n",
"--use-remote-data-dir) and upload data/tpch/1/ to some remote location.",
"Assuming data already exists at this remote (e.g. S3, GCS) URL: {}.\n",
"If it does not, you should kill this command, locally generate the files (by running without\n",
"--use-remote-data-dir) and upload data/tpch/1/ to some remote location.",
),
tpch_benchmark_remote_data_dir,
);
Expand Down
12 changes: 6 additions & 6 deletions bench-vortex/src/clickbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ use datafusion::datasource::listing::{
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
};
use datafusion::prelude::{ParquetReadOptions, SessionContext};
use futures::{stream, StreamExt, TryStreamExt};
use tokio::fs::{create_dir_all, OpenOptions};
use futures::{StreamExt, TryStreamExt, stream};
use tokio::fs::{OpenOptions, create_dir_all};
use tracing::info;
use vortex::TryIntoArray;
use vortex::arrow::FromArrowType;
use vortex::dtype::DType;
use vortex::error::{vortex_err, VortexError};
use vortex::file::{VortexWriteOptions, VORTEX_FILE_EXTENSION};
use vortex::error::{VortexError, vortex_err};
use vortex::file::{VORTEX_FILE_EXTENSION, VortexWriteOptions};
use vortex::stream::ArrayStreamAdapter;
use vortex::TryIntoArray;
use vortex_datafusion::persistent::VortexFormat;

use crate::{idempotent_async, CTX};
use crate::{CTX, idempotent_async};

pub static HITS_SCHEMA: LazyLock<Schema> = LazyLock::new(|| {
use DataType::*;
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/compress/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use vortex::arrays::ChunkedArray;
use vortex::nbytes::NBytes;
use vortex::{ArrayExt, ArrayRef};

use crate::Format;
use crate::bench_run::run;
use crate::compress::chunked_to_vec_record_batch;
use crate::compress::parquet::{parquet_compress_write, parquet_decompress_read};
use crate::compress::vortex::{vortex_compress_write, vortex_decompress_read};
use crate::measurements::{CustomUnitMeasurement, ThroughputMeasurement};
use crate::Format;

#[derive(Default)]
pub struct CompressMeasurements {
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/compress/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::sync::Arc;
use arrow_array::RecordBatch;
use arrow_schema::Schema;
use bytes::Bytes;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
use parquet::arrow::ArrowWriter;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
use parquet::basic::Compression;
use parquet::file::properties::WriterProperties;

Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/compress/vortex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::io::Cursor;
use arrow_array::ArrayRef;
use bytes::Bytes;
use futures::TryStreamExt;
use vortex::Array;
use vortex::arrow::IntoArrowArray;
use vortex::error::VortexResult;
use vortex::file::{VortexOpenOptions, VortexWriteOptions};
use vortex::stream::ArrayStreamArrayExt;
use vortex::Array;

#[inline(never)]
pub async fn vortex_compress_write(array: &dyn Array, buf: &mut Vec<u8>) -> VortexResult<u64> {
Expand Down
10 changes: 5 additions & 5 deletions bench-vortex/src/datasets/public_bi_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ use std::sync::LazyLock;

use async_trait::async_trait;
use enum_iterator::Sequence;
use futures::{stream, StreamExt, TryStreamExt};
use humansize::{format_size, DECIMAL};
use futures::{StreamExt, TryStreamExt, stream};
use humansize::{DECIMAL, format_size};
use log::{debug, info};
use reqwest::Url;
use tokio::fs::File;
use vortex::aliases::hash_map::HashMap;
use vortex::arrays::ChunkedArray;
use vortex::error::{vortex_err, VortexExpect, VortexResult};
use vortex::error::{VortexExpect, VortexResult, vortex_err};
use vortex::file::{VortexOpenOptions, VortexWriteOptions};
use vortex::io::TokioFile;
use vortex::{Array, ArrayRef};

use crate::datasets::BenchmarkDataset;
use crate::datasets::data_downloads::{decompress_bz2, download_data};
use crate::datasets::public_bi_data::PBIDataset::*;
use crate::datasets::BenchmarkDataset;
use crate::parquet_reader::parquet_to_vortex;
use crate::{idempotent, idempotent_async, IdempotentPath};
use crate::{IdempotentPath, idempotent, idempotent_async};

// NB: we do not expect this to change, otherwise we'd crawl the site and populate it at runtime
// We will eventually switch over to self-hosting this data, at which time this map will need
Expand Down
6 changes: 3 additions & 3 deletions bench-vortex/src/datasets/taxi_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use std::path::PathBuf;

use async_trait::async_trait;
use tokio::fs::File;
use vortex::ArrayRef;
use vortex::error::VortexError;
use vortex::file::{VortexOpenOptions, VortexWriteOptions};
use vortex::io::TokioFile;
use vortex::ArrayRef;

use crate::datasets::data_downloads::download_data;
use crate::datasets::BenchmarkDataset;
use crate::datasets::data_downloads::download_data;
use crate::parquet_reader::parquet_to_vortex;
use crate::{idempotent_async, IdempotentPath};
use crate::{IdempotentPath, idempotent_async};

pub struct TaxiData;

Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use tabled::settings::themes::Colorization;
use tabled::settings::{Color, Style};
use vortex::aliases::hash_map::HashMap;

use crate::measurements::{MeasurementValue, TableValue, ToJson, ToTable};
use crate::Format;
use crate::measurements::{MeasurementValue, TableValue, ToJson, ToTable};

#[derive(ValueEnum, Default, Clone, Debug)]
pub enum DisplayFormat {
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use datafusion::execution::object_store::DefaultObjectStoreRegistry;
use datafusion::execution::runtime_env::RuntimeEnvBuilder;
use datafusion::prelude::{SessionConfig, SessionContext};
use datafusion_physical_plan::metrics::MetricsSet;
use datafusion_physical_plan::{collect, ExecutionPlan};
use datafusion_physical_plan::{ExecutionPlan, collect};
use rand::{Rng, SeedableRng as _};
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::Arc;

use datafusion_physical_plan::metrics::{Label, MetricValue, MetricsSet};
use datafusion_physical_plan::Metric;
use datafusion_physical_plan::metrics::{Label, MetricValue, MetricsSet};
use vortex::aliases::hash_map::HashMap;

pub trait MetricsSetExt {
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/parquet_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use std::path::PathBuf;

use arrow_array::RecordBatchReader;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
use vortex::TryIntoArray;
use vortex::arrow::FromArrowType;
use vortex::dtype::DType;
use vortex::error::{VortexError, VortexResult};
use vortex::iter::{ArrayIteratorAdapter, ArrayIteratorExt};
use vortex::stream::ArrayStream;
use vortex::TryIntoArray;

pub async fn parquet_to_vortex(parquet_path: PathBuf) -> VortexResult<impl ArrayStream> {
let reader = ParquetRecordBatchReaderBuilder::try_new(File::open(parquet_path)?)?.build()?;
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/random_access/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use arrow_select::concat::concat_batches;
use arrow_select::take::take_record_batch;
use futures::stream;
use itertools::Itertools;
use parquet::arrow::ParquetRecordBatchStreamBuilder;
use parquet::arrow::arrow_reader::ArrowReaderOptions;
use parquet::arrow::async_reader::AsyncFileReader;
use parquet::arrow::ParquetRecordBatchStreamBuilder;
use parquet::file::metadata::RowGroupMetaData;
use stream::StreamExt;
use vortex::aliases::hash_map::HashMap;
Expand Down
4 changes: 3 additions & 1 deletion bench-vortex/src/tpch/dbgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ fn get_or_cache_toolchain(
let download_dir = dbgen_dir(cache_dir, version, platform);
std::fs::create_dir_all(&download_dir)?;

let url = format!("https://github.com/spiraldb/tpch-dbgen/releases/download/{version}/dbgen-{platform}-{version}.tar");
let url = format!(
"https://github.com/spiraldb/tpch-dbgen/releases/download/{version}/dbgen-{platform}-{version}.tar"
);

let mut zip_file = reqwest::blocking::get(url)?;
let zip_path = download_dir.join(
Expand Down
10 changes: 5 additions & 5 deletions bench-vortex/src/tpch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ use std::sync::Arc;
use arrow_array::StructArray as ArrowStructArray;
use arrow_schema::Schema;
use datafusion::dataframe::DataFrameWriteOptions;
use datafusion::datasource::MemTable;
use datafusion::datasource::listing::{
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
};
use datafusion::datasource::MemTable;
use datafusion::prelude::{CsvReadOptions, ParquetReadOptions, SessionContext};
use futures::StreamExt;
use named_locks::with_lock;
use object_store::ObjectStore;
use object_store::aws::AmazonS3Builder;
use object_store::gcp::GoogleCloudStorageBuilder;
use object_store::local::LocalFileSystem;
use object_store::path::Path as ObjectStorePath;
use object_store::ObjectStore;
use tokio::fs::OpenOptions;
use url::Url;
use vortex::arrays::ChunkedArray;
use vortex::arrow::{FromArrowArray, FromArrowType};
use vortex::dtype::DType;
use vortex::error::VortexExpect as _;
use vortex::file::{VortexWriteOptions, VORTEX_FILE_EXTENSION};
use vortex::file::{VORTEX_FILE_EXTENSION, VortexWriteOptions};
use vortex::{Array, ArrayRef, TryIntoArray};
use vortex_datafusion::persistent::VortexFormat;
use vortex_datafusion::SessionContextExt;
use vortex_datafusion::persistent::VortexFormat;

use crate::{get_session_with_cache, Format, CTX};
use crate::{CTX, Format, get_session_with_cache};

pub mod dbgen;
pub mod duckdb;
Expand Down
4 changes: 2 additions & 2 deletions encodings/alp/benches/alp_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
use divan::Bencher;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng as _};
use vortex_alp::{alp_encode, ALPFloat, ALPRDFloat, RDEncoder};
use vortex_alp::{ALPFloat, ALPRDFloat, RDEncoder, alp_encode};
use vortex_array::Array;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::validity::Validity;
use vortex_array::Array;
use vortex_buffer::buffer;
use vortex_dtype::NativePType;

Expand Down
11 changes: 6 additions & 5 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ use vortex_array::stats::StatsSet;
use vortex_array::variants::PrimitiveArrayTrait;
use vortex_array::vtable::{StatisticsVTable, VTableRef};
use vortex_array::{
encoding_ids, Array, ArrayCanonicalImpl, ArrayExt, ArrayImpl, ArrayRef, ArrayStatisticsImpl,
Array, ArrayCanonicalImpl, ArrayExt, ArrayImpl, ArrayRef, ArrayStatisticsImpl,
ArrayValidityImpl, ArrayVariantsImpl, Canonical, Encoding, EncodingId, SerdeMetadata,
encoding_ids,
};
use vortex_dtype::{DType, PType};
use vortex_error::{vortex_bail, VortexResult};
use vortex_error::{VortexResult, vortex_bail};
use vortex_mask::Mask;

use crate::alp::serde::ALPMetadata;
use crate::alp::{alp_encode, decompress, Exponents};
use crate::alp::{Exponents, alp_encode, decompress};

#[derive(Clone, Debug)]
pub struct ALPArray {
Expand Down Expand Up @@ -142,13 +143,13 @@ impl StatisticsVTable<&ALPArray> for ALPEncoding {}

#[cfg(test)]
mod tests {
use vortex_array::SerdeMetadata;
use vortex_array::patches::PatchesMetadata;
use vortex_array::test_harness::check_metadata;
use vortex_array::SerdeMetadata;
use vortex_dtype::PType;

use crate::alp::serde::ALPMetadata;
use crate::Exponents;
use crate::alp::serde::ALPMetadata;

#[cfg_attr(miri, ignore)]
#[test]
Expand Down
Loading

0 comments on commit 0c58969

Please sign in to comment.