Skip to content

Commit 184cc63

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/exact-hash-table-accounting-primitive
2 parents 3a4d084 + 4978b30 commit 184cc63

79 files changed

Lines changed: 4311 additions & 2055 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.

‎.github/workflows/rust.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,12 @@ jobs:
700700
rust-version: stable
701701
- name: Run sqllogictest
702702
# TODO: Right now several tests are failing in Substrait round-trip mode, so this
703-
# command cannot be run for all the .slt files. Run it for just one that works (limit.slt)
703+
# command cannot be run for all the .slt files. Run a supported subset
704704
# until most of the tickets in https://github.com/apache/datafusion/issues/16248 are addressed
705705
# and this command can be run without filters.
706-
run: cargo xtask ci step test substrait
706+
run: |
707+
cargo xtask ci step test substrait
708+
cargo xtask ci step test substrait-optimized
707709
708710
# Temporarily commenting out the Windows flow, the reason is enormously slow running build
709711
# Waiting for new Windows 2025 github runner

‎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);

‎datafusion/common/src/config.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,9 @@ config_namespace! {
18091809
/// rule. When set to false, any rules that produce errors will cause the query to fail
18101810
pub skip_failed_rules: bool, default = false
18111811

1812-
/// Number of times that the optimizer will attempt to optimize the plan
1812+
/// The logical optimizer applies rules in order for up to `max_passes` passes,
1813+
/// stopping early if a pass leaves the plan unchanged or repeats an earlier plan.
1814+
/// The physical optimizer always runs in one pass.
18131815
pub max_passes: usize, default = 3
18141816

18151817
/// When set to true, the physical plan optimizer will run a top down

‎datafusion/core/tests/fuzz_cases/join_fuzz.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,14 +1604,14 @@ fn pwmj_plan(
16041604
join_type: JoinType,
16051605
) -> Arc<dyn ExecutionPlan> {
16061606
// Matches `PiecewiseMergeJoinExec::required_input_ordering`: descending for `<`/`<=`,
1607-
// ascending for `>`/`>=`, NULLs first either way. Right existence joins require no
1607+
// ascending for `>`/`>=`, reversing NULL placement too. Right existence joins require no
16081608
// ordering at all -- they only read the buffered side's min/max -- so they are fed the
16091609
// left side unsorted, which is the input shape they will see in a real plan.
16101610
let buffered = match join_type {
16111611
JoinType::RightSemi | JoinType::RightAnti | JoinType::RightMark => left,
16121612
_ => {
16131613
let sort_options = match op {
1614-
Operator::Lt | Operator::LtEq => SortOptions::new(true, true),
1614+
Operator::Lt | Operator::LtEq => SortOptions::new(true, false),
16151615
Operator::Gt | Operator::GtEq => SortOptions::new(false, true),
16161616
other => panic!("not a range operator: {other:?}"),
16171617
};

0 commit comments

Comments
 (0)