diff --git a/rust/arrow/src/compute/kernels/take.rs b/rust/arrow/src/compute/kernels/take.rs index c8a2a02241e..85567ad8cee 100644 --- a/rust/arrow/src/compute/kernels/take.rs +++ b/rust/arrow/src/compute/kernels/take.rs @@ -76,12 +76,16 @@ macro_rules! downcast_dict_take { /// # Ok(()) /// # } /// ``` -pub fn take( +pub fn take( values: &Array, - indices: &UInt32Array, + indices: &PrimitiveArray, options: Option, -) -> Result { - take_impl::(values, indices, options) +) -> Result +where + IndexType: ArrowNumericType, + IndexType::Native: ToPrimitive, +{ + take_impl(values, indices, options) } fn take_impl( diff --git a/rust/datafusion/src/physical_plan/hash_join.rs b/rust/datafusion/src/physical_plan/hash_join.rs index 8a3ee4b09ba..ea3b9b00398 100644 --- a/rust/datafusion/src/physical_plan/hash_join.rs +++ b/rust/datafusion/src/physical_plan/hash_join.rs @@ -287,7 +287,8 @@ fn build_batch_from_indices( // 2. based on the pick, `take` items from the different recordBatches let mut columns: Vec> = Vec::with_capacity(schema.fields().len()); - let right_indices = indices.iter().map(|(_, join_index)| join_index).collect(); + let right_indices: UInt32Array = + indices.iter().map(|(_, join_index)| join_index).collect(); for field in schema.fields() { // pick the column (left or right) based on the field name.