Skip to content

Commit 2b286f8

Browse files
committed
fix
Signed-off-by: Joe Isaacs <[email protected]>
1 parent f8dc9b9 commit 2b286f8

File tree

10 files changed

+38
-79
lines changed

10 files changed

+38
-79
lines changed

bench-vortex/src/bin/compress.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use std::io::{Write, stdout};
66
use std::path::PathBuf;
77
use std::time::Duration;
88

9-
use bench_vortex::compress::bench::{
10-
CompressMeasurements, CompressOp, {self as compress},
11-
};
9+
use bench_vortex::compress::bench::{self as compress, CompressMeasurements, CompressOp};
1210
use bench_vortex::datasets::Dataset;
1311
use bench_vortex::datasets::struct_list_of_ints::StructListOfInts;
1412
use bench_vortex::datasets::taxi_data::TaxiData;

bench-vortex/src/compress/bench.rs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@
33

44
use std::borrow::Cow;
55
use std::fmt;
6-
#[cfg(feature = "lance")]
7-
use std::fs;
8-
#[cfg(feature = "lance")]
9-
use std::path::PathBuf;
10-
#[cfg(feature = "lance")]
11-
use std::sync::Arc;
126
use std::sync::atomic::{AtomicU64, Ordering};
137
use std::time::Duration;
148

159
use anyhow::Result;
16-
#[cfg(feature = "lance")]
17-
use arrow_array::RecordBatch;
1810
use bytes::Bytes;
1911
use clap::ValueEnum;
20-
#[cfg(feature = "lance")]
21-
use parking_lot::Mutex;
2212
use parquet::basic::{Compression, ZstdLevel};
2313
use serde::Serialize;
2414
use tokio::runtime::Runtime;
2515
use vortex::Array;
2616
use vortex::arrays::ChunkedVTable;
2717
use vortex::utils::aliases::hash_map::HashMap;
28-
2918
#[cfg(feature = "lance")]
30-
use super::lance::*;
19+
use {
20+
super::lance::*,
21+
crate::{
22+
bench_run::run_with_setup,
23+
utils::{convert_utf8view_batch, convert_utf8view_schema},
24+
},
25+
arrow_array::RecordBatch,
26+
parking_lot::Mutex,
27+
std::fs,
28+
std::path::PathBuf,
29+
std::sync::Arc,
30+
};
31+
3132
use crate::Format;
3233
use crate::bench_run::run;
33-
#[cfg(feature = "lance")]
34-
use crate::bench_run::run_with_setup;
3534
use crate::compress::chunked_to_vec_record_batch;
3635
use crate::compress::parquet::{parquet_compress_write, parquet_decompress_read};
3736
use crate::compress::vortex::{vortex_compress_write, vortex_decompress_read};
3837
use crate::measurements::{CompressionTimingMeasurement, CustomUnitMeasurement};
39-
#[cfg(feature = "lance")]
40-
use crate::utils::convert_utf8view_batch;
41-
#[cfg(feature = "lance")]
42-
use crate::utils::convert_utf8view_schema;
4338

4439
#[derive(Default)]
4540
pub struct CompressMeasurements {

bench-vortex/src/datasets/file.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ use datafusion::datasource::listing::{
1111
};
1212
use datafusion::prelude::SessionContext;
1313
use glob::Pattern;
14-
#[cfg(feature = "lance")]
15-
use lance::datafusion::LanceTableProvider;
16-
#[cfg(feature = "lance")]
17-
use lance::dataset::Dataset;
1814
use tracing::info;
1915
use url::Url;
2016
use vortex_datafusion::VortexFormat;
21-
2217
#[cfg(feature = "lance")]
23-
use crate::Format;
18+
use {crate::Format, lance::datafusion::LanceTableProvider, lance::dataset::Dataset};
19+
2420
use crate::SESSION;
2521
use crate::datasets::BenchmarkDataset;
2622

bench-vortex/src/datasets/taxi_data.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#[cfg(feature = "lance")]
5-
use std::fs::File;
64
use std::path::PathBuf;
75

86
use anyhow::Result;
97
use async_trait::async_trait;
10-
#[cfg(feature = "lance")]
11-
use lance::dataset::Dataset as LanceDataset;
12-
#[cfg(feature = "lance")]
13-
use lance::dataset::WriteParams;
14-
#[cfg(feature = "lance")]
15-
use lance_encoding::version::LanceFileVersion;
16-
#[cfg(feature = "lance")]
17-
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
188
use tokio::fs::File as TokioFile;
199
use tokio::io::AsyncWriteExt;
2010
use vortex::ArrayRef;
2111
use vortex::file::{OpenOptionsSessionExt, WriteOptionsSessionExt};
2212
use vortex::stream::ArrayStreamExt;
13+
#[cfg(feature = "lance")]
14+
use {
15+
lance::dataset::{Dataset as LanceDataset, WriteParams},
16+
lance_encoding::version::LanceFileVersion,
17+
parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder,
18+
std::fs::File,
19+
};
2320

2421
use crate::conversions::parquet_to_vortex;
2522
use crate::datasets::Dataset;

bench-vortex/src/public_bi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use std::borrow::Cow;
5-
use std::fmt::{
6-
Display, {self},
7-
};
5+
use std::fmt::{self, Display};
86
use std::fs;
97
use std::os::unix::fs::MetadataExt;
108
use std::path::{Path, PathBuf};

bench-vortex/src/random_access/take.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ use arrow_select::take::take_record_batch;
1111
use futures::stream;
1212
use itertools::Itertools;
1313
#[cfg(feature = "lance")]
14-
use lance::dataset::Dataset;
15-
#[cfg(feature = "lance")]
16-
use lance::dataset::ProjectionRequest;
14+
use lance::dataset::{Dataset, ProjectionRequest};
1715
use parquet::arrow::ParquetRecordBatchStreamBuilder;
1816
use parquet::arrow::arrow_reader::ArrowReaderOptions;
1917
use parquet::arrow::async_reader::AsyncFileReader;

bench-vortex/src/tpch/dbgen.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
/// This is a simple wrapper around the `dbgen` tool.
77
///
88
/// For more information, see the [dbgen](https://github.com/vortex-data/tpch-dbgen) project.
9-
use std::fmt::Display;
10-
/// Download TPC-H data via Docker.
11-
///
12-
/// This is a simple wrapper around the `dbgen` tool.
13-
///
14-
/// For more information, see the [dbgen](https://github.com/vortex-data/tpch-dbgen) project.
15-
use std::fmt::Formatter;
9+
use std::fmt::{Display, Formatter};
1610
use std::fs::File;
1711
use std::io::copy;
1812
use std::path::{Path, PathBuf};

bench-vortex/src/tpch/schema.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ use std::sync::LazyLock;
66
/// Arrow schemas for TPC-H tables.
77
///
88
/// Adapted from the SQL definitions in https://github.com/dimitri/tpch-citus/blob/master/schema/tpch-schema.sql
9-
use arrow_schema::DataType;
10-
/// Arrow schemas for TPC-H tables.
11-
///
12-
/// Adapted from the SQL definitions in https://github.com/dimitri/tpch-citus/blob/master/schema/tpch-schema.sql
13-
use arrow_schema::Field;
14-
/// Arrow schemas for TPC-H tables.
15-
///
16-
/// Adapted from the SQL definitions in https://github.com/dimitri/tpch-citus/blob/master/schema/tpch-schema.sql
17-
use arrow_schema::Schema;
9+
use arrow_schema::{DataType, Field, Schema};
1810

1911
pub static NATION: LazyLock<Schema> = LazyLock::new(|| {
2012
Schema::new(vec![

bench-vortex/src/tpch/tpch_benchmark.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ use log::{info, warn};
1414
use similar::{ChangeTag, TextDiff};
1515
use tokio::runtime::Runtime;
1616
use url::Url;
17+
#[cfg(feature = "lance")]
18+
use {crate::file::register_lance_files, crate::utils};
1719

1820
use crate::benchmark_trait::Benchmark;
1921
use crate::engines::{EngineCtx, ddb};
20-
#[cfg(feature = "lance")]
21-
use crate::file::register_lance_files;
2222
use crate::tpch::schema::{CUSTOMER, LINEITEM, NATION, ORDERS, PART, PARTSUPP, REGION, SUPPLIER};
2323
use crate::tpch::tpchgen::TpchGenOptions;
2424
use crate::tpch::{
2525
EXPECTED_ROW_COUNTS_SF1, EXPECTED_ROW_COUNTS_SF10, register_arrow, register_parquet,
2626
register_vortex_compact_file, register_vortex_file, tpch_queries, tpchgen,
2727
};
28-
#[cfg(feature = "lance")]
29-
use crate::utils;
3028
use crate::{BenchmarkDataset, Format, IdempotentPath, Target};
3129

3230
/// TPCH benchmark implementation

bench-vortex/src/utils/parquet_utils.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
#[cfg(feature = "lance")]
5-
use std::fs;
64
use std::fs::File;
7-
#[cfg(feature = "lance")]
8-
use std::path::Path;
95
#[cfg(not(feature = "lance"))]
106
use std::path::PathBuf;
117
use std::sync::Arc;
@@ -14,20 +10,17 @@ use anyhow::anyhow;
1410
use arrow_array::{RecordBatch, RecordBatchReader};
1511
use arrow_cast::cast;
1612
use arrow_schema::{ArrowError, DataType, Field, Schema, SchemaRef};
17-
#[cfg(feature = "lance")]
18-
use lance::dataset::Dataset as LanceDataset;
19-
#[cfg(feature = "lance")]
20-
use lance::dataset::WriteParams;
21-
#[cfg(feature = "lance")]
22-
use lance_encoding::version::LanceFileVersion;
23-
#[cfg(feature = "lance")]
24-
use log::info;
2513
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
2614
#[cfg(feature = "lance")]
27-
use tokio::fs::create_dir_all;
28-
29-
#[cfg(feature = "lance")]
30-
use crate::utils::idempotent_async;
15+
use {
16+
crate::utils::idempotent_async,
17+
lance::dataset::{Dataset as LanceDataset, WriteParams},
18+
lance_encoding::version::LanceFileVersion,
19+
log::info,
20+
std::fs,
21+
std::path::{Path, PathBuf},
22+
tokio::fs::create_dir_all,
23+
};
3124

3225
/// A streaming iterator that reads RecordBatches from multiple Parquet files sequentially.
3326
/// Works equally well for single files and multiple files.

0 commit comments

Comments
 (0)