Skip to content

Commit 23147f0

Browse files
authored
Merge branch 'main' into perf/hash-join-integer-prefilter
2 parents 7f8e203 + 5c0e73f commit 23147f0

22 files changed

Lines changed: 1191 additions & 266 deletions

File tree

‎AGENTS.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44

55
- [Quick Start Setup](docs/source/contributor-guide/development_environment.md#quick-start)
66
- [Testing Quick Start](docs/source/contributor-guide/testing.md#testing-quick-start)
7+
- [Open Contribution and Assigning tickets](docs/source/contributor-guide/index.md#open-contribution-and-assigning-tickets)
78
- [Choosing What Kind of Test to Write](docs/source/contributor-guide/testing.md#choosing-what-kind-of-test-to-write)
89
- [Before Submitting a PR](docs/source/contributor-guide/index.md#before-submitting-a-pr)
910
- [Reviewing Pull Requests](docs/source/contributor-guide/pr_review.md)
1011
- [Contributor Guide](docs/source/contributor-guide/index.md)
1112
- [Architecture Guide](docs/source/contributor-guide/architecture.md)
1213

14+
## Before Starting Work
15+
16+
Before you start work on an issue, you MUST follow the instructions in
17+
[Open Contribution and Assigning tickets](docs/source/contributor-guide/index.md#open-contribution-and-assigning-tickets). You must ensure duplicate work is not being created.
18+
Do not create multiple PRs if this is your first time contributing.
19+
1320
## Before Committing
1421

1522
Before committing any changes, you MUST follow the instructions in

‎datafusion/common/benches/with_hashes.rs‎

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
//! Benchmarks for `with_hashes` function
1919
2020
use arrow::array::{
21-
Array, ArrayRef, ArrowPrimitiveType, DictionaryArray, GenericStringArray, Int32Array,
22-
Int64Array, ListArray, MapArray, NullBufferBuilder, OffsetSizeTrait, PrimitiveArray,
23-
RunArray, StringViewArray, StructArray, UnionArray, make_array,
21+
Array, ArrayRef, ArrowPrimitiveType, DictionaryArray, FixedSizeListArray,
22+
GenericStringArray, Int32Array, Int64Array, ListArray, ListViewArray, MapArray,
23+
NullArray, NullBufferBuilder, OffsetSizeTrait, PrimitiveArray, RunArray,
24+
StringViewArray, StructArray, UnionArray, make_array,
2425
};
2526
use arrow::buffer::{NullBuffer, OffsetBuffer, ScalarBuffer};
2627
use arrow::datatypes::{
@@ -127,6 +128,21 @@ fn criterion_benchmark(c: &mut Criterion) {
127128
array: create_run_array::<Int32Type>(BATCH_SIZE),
128129
supports_nulls: true,
129130
},
131+
BenchData {
132+
name: "null",
133+
array: Arc::new(NullArray::new(BATCH_SIZE)),
134+
supports_nulls: false,
135+
},
136+
BenchData {
137+
name: "list_view_array",
138+
array: list_view_array(BATCH_SIZE),
139+
supports_nulls: true,
140+
},
141+
BenchData {
142+
name: "fixed_size_list_array",
143+
array: fixed_size_list_array(BATCH_SIZE),
144+
supports_nulls: true,
145+
},
130146
];
131147

132148
for BenchData {
@@ -603,5 +619,49 @@ where
603619
)
604620
}
605621

606-
criterion_group!(benches, criterion_benchmark, sliced_array_benchmark);
622+
fn list_view_array(num_rows: usize) -> ArrayRef {
623+
let elements_per_row = 5;
624+
let values = primitive_array::<Int64Type>(num_rows * elements_per_row);
625+
let offsets: ScalarBuffer<i32> = (0..num_rows)
626+
.map(|i| (i * elements_per_row) as i32)
627+
.collect();
628+
let sizes: ScalarBuffer<i32> =
629+
(0..num_rows).map(|_| elements_per_row as i32).collect();
630+
Arc::new(ListViewArray::new(
631+
Arc::new(Field::new("item", DataType::Int64, true)),
632+
offsets,
633+
sizes,
634+
values,
635+
None,
636+
))
637+
}
638+
639+
fn fixed_size_list_array(num_rows: usize) -> ArrayRef {
640+
let list_size = 4;
641+
Arc::new(FixedSizeListArray::new(
642+
Arc::new(Field::new("item", DataType::Int64, true)),
643+
list_size as i32,
644+
primitive_array::<Int64Type>(num_rows * list_size),
645+
None,
646+
))
647+
}
648+
649+
/// Heterogeneous key columns
650+
fn mixed_columns_benchmark(c: &mut Criterion) {
651+
let pool = StringPool::new(100, 64);
652+
let int64 = primitive_array::<Int64Type>(BATCH_SIZE);
653+
let utf8 = pool.string_array::<i32>(BATCH_SIZE);
654+
let utf8_view = pool.string_view_array(BATCH_SIZE);
655+
let arrays = vec![int64, utf8, utf8_view];
656+
c.bench_function("mixed: 3 columns (int64, utf8, utf8_view)", |b| {
657+
do_hash_test(b, &arrays)
658+
});
659+
}
660+
661+
criterion_group!(
662+
benches,
663+
criterion_benchmark,
664+
sliced_array_benchmark,
665+
mixed_columns_benchmark
666+
);
607667
criterion_main!(benches);

0 commit comments

Comments
 (0)