Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions rust/arrow/src/compute/kernels/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,16 @@ macro_rules! downcast_dict_take {
/// # Ok(())
/// # }
/// ```
pub fn take(
pub fn take<IndexType>(
values: &Array,
indices: &UInt32Array,
indices: &PrimitiveArray<IndexType>,
options: Option<TakeOptions>,
) -> Result<ArrayRef> {
take_impl::<UInt32Type>(values, indices, options)
) -> Result<ArrayRef>
where
IndexType: ArrowNumericType,
IndexType::Native: ToPrimitive,
{
take_impl(values, indices, options)
}

fn take_impl<IndexType>(
Expand Down
3 changes: 2 additions & 1 deletion rust/datafusion/src/physical_plan/hash_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ fn build_batch_from_indices(
// 2. based on the pick, `take` items from the different recordBatches
let mut columns: Vec<Arc<dyn Array>> = 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.
Expand Down