Skip to content

Commit 136811f

Browse files
committed
wip
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent cc35ed4 commit 136811f

291 files changed

Lines changed: 1314 additions & 1069 deletions

File tree

Some content is hidden

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ needless_range_loop = "allow"
350350
or_fun_call = "deny"
351351
panic = "deny"
352352
# panic_in_result_fn = "deny" -- we cannot disable this for tests to use assertions
353-
clone_on_ref_ptr = "warn"
353+
clone_on_ref_ptr = "deny"
354354
redundant_clone = "deny"
355355
same_name_method = "deny"
356356
tests_outside_test_module = "deny"

benchmarks/compress-bench/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn chunked_to_vec_record_batch(
2222
.map(|array| {
2323
// TODO(connor)[ListView]: The rust Parquet implementation does not support writing
2424
// `ListView` to Parquet files yet.
25-
let converted_array = recursive_list_from_list_view(Arc::clone(&array))?;
25+
let converted_array = recursive_list_from_list_view(Arc::clone(array))?;
2626
Ok(RecordBatch::try_from(converted_array.as_ref())?)
2727
})
2828
.collect::<anyhow::Result<Vec<_>>>()?;

benchmarks/compress-bench/src/parquet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Compressor for ParquetCompressor {
5353
// Read the input parquet file
5454
let file = File::open(parquet_path)?;
5555
let builder = ParquetRecordBatchReaderBuilder::try_new(file)?;
56-
let schema = Arc::clone(&builder.schema());
56+
let schema = Arc::clone(builder.schema());
5757
let reader = builder.build()?;
5858
let batches: Vec<RecordBatch> = reader.collect::<Result<Vec<_>, _>>()?;
5959

@@ -69,7 +69,7 @@ impl Compressor for ParquetCompressor {
6969
// First compress to get the bytes we'll decompress
7070
let file = File::open(parquet_path)?;
7171
let builder = ParquetRecordBatchReaderBuilder::try_new(file)?;
72-
let schema = Arc::clone(&builder.schema());
72+
let schema = Arc::clone(builder.schema());
7373
let reader = builder.build()?;
7474
let batches: Vec<RecordBatch> = reader.collect::<Result<Vec<_>, _>>()?;
7575

benchmarks/datafusion-bench/src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ pub fn make_object_store(
8181
.with_bucket_name(bucket_name)
8282
.build()?,
8383
);
84-
session
85-
.register_object_store(&Url::parse(&format!("s3://{bucket_name}/"))?, Arc::clone(&s3));
84+
session.register_object_store(
85+
&Url::parse(&format!("s3://{bucket_name}/"))?,
86+
Arc::clone(&s3) as _,
87+
);
8688
Ok(s3)
8789
}
8890
"gs" => {
@@ -92,13 +94,15 @@ pub fn make_object_store(
9294
.with_bucket_name(bucket_name)
9395
.build()?,
9496
);
95-
session
96-
.register_object_store(&Url::parse(&format!("gs://{bucket_name}/"))?, Arc::clone(&gcs));
97+
session.register_object_store(
98+
&Url::parse(&format!("gs://{bucket_name}/"))?,
99+
Arc::clone(&gcs) as _,
100+
);
97101
Ok(gcs)
98102
}
99103
_ => {
100104
let fs = Arc::new(LocalFileSystem::default());
101-
session.register_object_store(&Url::parse("file:/")?, Arc::clone(&fs));
105+
session.register_object_store(&Url::parse("file:/")?, Arc::clone(&fs) as _);
102106
Ok(fs)
103107
}
104108
}

benchmarks/datafusion-bench/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,10 @@ async fn register_v2_tables<B: Benchmark + ?Sized>(
304304
.runtime_env()
305305
.object_store(table_url.object_store())?;
306306

307-
let fs: vortex::io::filesystem::FileSystemRef =
308-
Arc::new(ObjectStoreFileSystem::new(Arc::clone(&store), SESSION.handle()));
307+
let fs: vortex::io::filesystem::FileSystemRef = Arc::new(ObjectStoreFileSystem::new(
308+
Arc::clone(&store),
309+
SESSION.handle(),
310+
));
309311
let base_prefix = benchmark_base.path().trim_start_matches('/').to_string();
310312
let fs = fs.with_prefix(base_prefix);
311313

benchmarks/lance-bench/src/compress.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use std::fs;
55
use std::fs::File;
66
use std::path::Path;
7+
use std::sync::Arc;
78
use std::time::Duration;
89
use std::time::Instant;
910

@@ -22,7 +23,6 @@ use vortex_bench::compress::Compressor;
2223

2324
use crate::convert::convert_utf8view_batch;
2425
use crate::convert::convert_utf8view_schema;
25-
use std::sync::Arc;
2626

2727
/// Read a Lance dataset and decompress it back into RecordBatches.
2828
pub async fn lance_decompress_read(path: &str) -> anyhow::Result<usize> {
@@ -93,7 +93,7 @@ impl Compressor for LanceCompressor {
9393
// Read the input parquet file
9494
let file = File::open(parquet_path)?;
9595
let builder = ParquetRecordBatchReaderBuilder::try_new(file)?;
96-
let schema = Arc::clone(&builder.schema());
96+
let schema = Arc::clone(builder.schema());
9797
let reader = builder.build()?;
9898
let batches: Vec<RecordBatch> = reader.collect::<Result<Vec<_>, _>>()?;
9999

@@ -132,7 +132,7 @@ impl Compressor for LanceCompressor {
132132
// First compress to get the Lance dataset
133133
let file = File::open(parquet_path)?;
134134
let builder = ParquetRecordBatchReaderBuilder::try_new(file)?;
135-
let schema = Arc::clone(&builder.schema());
135+
let schema = Arc::clone(builder.schema());
136136
let reader = builder.build()?;
137137
let batches: Vec<RecordBatch> = reader.collect::<Result<Vec<_>, _>>()?;
138138

benchmarks/lance-bench/src/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub async fn convert_parquet_to_lance<'p>(
161161
// Get schema from the first Parquet file
162162
let first_file = File::open(&parquet_files[0])?;
163163
let first_builder = ParquetRecordBatchReaderBuilder::try_new(first_file)?;
164-
let schema = Arc::clone(&first_builder.schema());
164+
let schema = Arc::clone(first_builder.schema());
165165

166166
// Create a streaming iterator that reads from all Parquet files
167167
let batch_iter = ParquetFilesIterator::new(parquet_files, schema)?;
@@ -237,7 +237,7 @@ pub fn convert_utf8view_batch(batch: RecordBatch) -> anyhow::Result<RecordBatch>
237237
// Cast Utf8View to Utf8.
238238
cast(column, &DataType::Utf8)?
239239
} else {
240-
Arc::clone(&column)
240+
Arc::clone(column)
241241
};
242242
new_columns.push(new_column);
243243
}

encodings/alp/src/alp/array.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ impl ALPArray {
459459
fn make_slots(encoded: &ArrayRef, patches: &Option<Patches>) -> Vec<Option<ArrayRef>> {
460460
let (patch_indices, patch_values, patch_chunk_offsets) = match patches {
461461
Some(p) => (
462-
Some(Arc::clone(&p.indices())),
463-
Some(Arc::clone(&p.values())),
462+
Some(Arc::clone(p.indices())),
463+
Some(Arc::clone(p.values())),
464464
p.chunk_offsets().clone(),
465465
),
466466
None => (None, None, None),
467467
};
468468
vec![
469-
Some(Arc::clone(&encoded)),
469+
Some(Arc::clone(encoded)),
470470
patch_indices,
471471
patch_values,
472472
patch_chunk_offsets,
@@ -501,8 +501,8 @@ impl ALPArray {
501501
Patches::new_unchecked(
502502
self.encoded().len(),
503503
patch_offset,
504-
Arc::clone(&indices),
505-
Arc::clone(&values),
504+
Arc::clone(indices),
505+
Arc::clone(values),
506506
self.slots[PATCH_CHUNK_OFFSETS_SLOT].clone(),
507507
self.patch_offset_within_chunk,
508508
)
@@ -836,15 +836,15 @@ mod tests {
836836
let patches_without_chunk_offsets = Patches::new(
837837
original_patches.array_len(),
838838
original_patches.offset(),
839-
Arc::clone(&original_patches.indices()),
840-
Arc::clone(&original_patches.values()),
839+
Arc::clone(original_patches.indices()),
840+
Arc::clone(original_patches.values()),
841841
None, // NO chunk_offsets - this triggers the bug!
842842
)
843843
.unwrap();
844844

845845
// Build a new ALPArray with the same encoded data but patches without chunk_offsets.
846846
let alp_without_chunk_offsets = ALPArray::new(
847-
Arc::clone(&normally_encoded.encoded()),
847+
Arc::clone(normally_encoded.encoded()),
848848
normally_encoded.exponents(),
849849
Some(patches_without_chunk_offsets),
850850
);

encodings/alp/src/alp/compute/between.rs

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

44
use std::fmt::Debug;
5+
use std::sync::Arc;
56

67
use vortex_array::ArrayRef;
78
use vortex_array::IntoArray;
@@ -20,7 +21,6 @@ use crate::ALP;
2021
use crate::ALPArray;
2122
use crate::ALPFloat;
2223
use crate::match_each_alp_float_ptype;
23-
use std::sync::Arc;
2424

2525
impl BetweenReduce for ALP {
2626
fn between(
@@ -85,7 +85,7 @@ where
8585
upper_strict,
8686
};
8787

88-
Arc::clone(&array.encoded()).between(
88+
Arc::clone(array.encoded()).between(
8989
ConstantArray::new(Scalar::primitive(lower_enc, nullability), array.len()).into_array(),
9090
ConstantArray::new(Scalar::primitive(upper_enc, nullability), array.len()).into_array(),
9191
options,

encodings/alp/src/alp/compute/cast.rs

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

4+
use std::sync::Arc;
5+
46
use vortex_array::ArrayRef;
57
use vortex_array::IntoArray;
68
use vortex_array::builtins::ArrayBuiltins;
@@ -11,7 +13,6 @@ use vortex_error::VortexResult;
1113

1214
use crate::alp::ALP;
1315
use crate::alp::ALPArray;
14-
use std::sync::Arc;
1516

1617
impl CastReduce for ALP {
1718
fn cast(array: &ALPArray, dtype: &DType) -> VortexResult<Option<ArrayRef>> {
@@ -35,7 +36,7 @@ impl CastReduce for ALP {
3536
Patches::new(
3637
p.array_len(),
3738
p.offset(),
38-
Arc::clone(&p.indices()),
39+
Arc::clone(p.indices()),
3940
p.values().cast(dtype.clone())?,
4041
p.chunk_offsets().clone(),
4142
)

0 commit comments

Comments
 (0)