Skip to content

Commit a79aff5

Browse files
committed
Fix DF53 upgrade CI failures
1 parent d77b761 commit a79aff5

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

datafusion/common/src/hash_utils.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
use ahash::RandomState;
2121
use arrow::array::types::{IntervalDayTime, IntervalMonthDayNano};
2222
use arrow::array::*;
23+
#[cfg(not(feature = "force_hash_collisions"))]
2324
use arrow::compute::take;
2425
use arrow::datatypes::*;
2526
#[cfg(not(feature = "force_hash_collisions"))]
2627
use arrow::{downcast_dictionary_array, downcast_primitive_array};
28+
#[cfg(not(feature = "force_hash_collisions"))]
2729
use itertools::Itertools;
30+
#[cfg(not(feature = "force_hash_collisions"))]
2831
use std::collections::HashMap;
2932

3033
#[cfg(not(feature = "force_hash_collisions"))]
@@ -1033,9 +1036,9 @@ fn hash_single_array<S: BuildHasher>(
10331036

10341037
/// Test version of `hash_single_array` that forces all hashes to collide to zero.
10351038
#[cfg(feature = "force_hash_collisions")]
1036-
fn hash_single_array(
1039+
fn hash_single_array<S: BuildHasher>(
10371040
_array: &dyn Array,
1038-
_random_state: &RandomState,
1041+
_hash_builder: &S,
10391042
hashes_buffer: &mut [u64],
10401043
_rehash: bool,
10411044
) -> Result<()> {
@@ -1167,8 +1170,12 @@ mod tests {
11671170
let array: ArrayRef = Arc::new(Int32Array::from(vec![1, 2, 3]));
11681171
let mut custom_hashes = vec![0; array.len()];
11691172
let hash_builder = BuildHasherDefault::<TestHasher>::default();
1170-
create_hashes_with_hasher([array.clone()], &hash_builder, &mut custom_hashes)
1171-
.unwrap();
1173+
create_hashes_with_hasher(
1174+
[Arc::<dyn Array>::clone(&array)],
1175+
&hash_builder,
1176+
&mut custom_hashes,
1177+
)
1178+
.unwrap();
11721179

11731180
let random_state = RandomState::with_seeds(0, 0, 0, 0);
11741181
let mut ahash_hashes = vec![0; array.len()];

datafusion/sqllogictest/test_files/order.slt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,9 @@ query TT
16051605
EXPLAIN SELECT named_struct('a', a, 'b', b) AS s FROM ordered ORDER BY s['a'];
16061606
----
16071607
physical_plan
1608-
01)SortExec: expr=[get_field(s@0, a) ASC NULLS LAST], preserve_partitioning=[false]
1609-
02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/data/composite_order.csv]]}, projection=[named_struct(a, a@0, b, b@1) as s], file_type=csv, has_header=true
1608+
01)ProjectionExec: expr=[s@0 as s]
1609+
02)--SortExec: expr=[__datafusion_extracted_1@1 ASC NULLS LAST], preserve_partitioning=[false]
1610+
03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/data/composite_order.csv]]}, projection=[named_struct(a, a@0, b, b@1) as s, get_field(named_struct(a, a@0, b, b@1), a) as __datafusion_extracted_1], file_type=csv, has_header=true
16101611

16111612
# Simple column ordering tests using a table ordered by (a)
16121613
statement ok
@@ -1630,8 +1631,9 @@ query TT
16301631
EXPLAIN SELECT named_struct('a', a, 'b', b) AS s FROM ordered_by_a ORDER BY s['b'];
16311632
----
16321633
physical_plan
1633-
01)SortExec: expr=[get_field(s@0, b) ASC NULLS LAST], preserve_partitioning=[false]
1634-
02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/data/composite_order.csv]]}, projection=[named_struct(a, a@0, b, b@1) as s], file_type=csv, has_header=true
1634+
01)ProjectionExec: expr=[s@0 as s]
1635+
02)--SortExec: expr=[__datafusion_extracted_1@1 ASC NULLS LAST], preserve_partitioning=[false]
1636+
03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/data/composite_order.csv]]}, projection=[named_struct(a, a@0, b, b@1) as s, get_field(named_struct(a, a@0, b, b@1), b) as __datafusion_extracted_1], file_type=csv, has_header=true
16351637

16361638
# Mixed projection: top-level column alongside struct, order by struct field
16371639
query TT

0 commit comments

Comments
 (0)