MCPcopy Create free account
hub / github.com/apache/arrow-rs / equal_dense

Function equal_dense

arrow-data/src/equal/union.rs:24–60  ·  view source on GitHub ↗
(
    lhs: &ArrayData,
    rhs: &ArrayData,
    lhs_type_ids: &[i8],
    rhs_type_ids: &[i8],
    lhs_offsets: &[i32],
    rhs_offsets: &[i32],
    lhs_fields: &UnionFields,
    rhs_fields: &UnionFiel

Source from the content-addressed store, hash-verified

22
23#[allow(clippy::too_many_arguments)]
24fn equal_dense(
25 lhs: &ArrayData,
26 rhs: &ArrayData,
27 lhs_type_ids: &[i8],
28 rhs_type_ids: &[i8],
29 lhs_offsets: &[i32],
30 rhs_offsets: &[i32],
31 lhs_fields: &UnionFields,
32 rhs_fields: &UnionFields,
33) -> bool {
34 let offsets = lhs_offsets.iter().zip(rhs_offsets.iter());
35
36 lhs_type_ids
37 .iter()
38 .zip(rhs_type_ids.iter())
39 .zip(offsets)
40 .all(|((l_type_id, r_type_id), (l_offset, r_offset))| {
41 let lhs_child_index = lhs_fields
42 .iter()
43 .position(|(r, _)| r == *l_type_id)
44 .unwrap();
45 let rhs_child_index = rhs_fields
46 .iter()
47 .position(|(r, _)| r == *r_type_id)
48 .unwrap();
49 let lhs_values = &lhs.child_data()[lhs_child_index];
50 let rhs_values = &rhs.child_data()[rhs_child_index];
51
52 equal_range(
53 lhs_values,
54 rhs_values,
55 *l_offset as usize,
56 *r_offset as usize,
57 1,
58 )
59 })
60}
61
62fn equal_sparse(
63 lhs: &ArrayData,

Callers 1

union_equalFunction · 0.85

Calls 6

equal_rangeFunction · 0.85
zipMethod · 0.80
allMethod · 0.80
positionMethod · 0.80
child_dataMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected