pub(crate) fn compare_element_to_list(
list_array_row: &dyn Array,
element_array: &dyn Array,
row_index: usize,
eq: bool,
) -> Result<BooleanArray>Expand description
Computes a BooleanArray indicating equality or inequality between elements in a list array and a specified element array.
§Arguments
-
list_array_row- A reference to a trait object implementing the ArrowArraytrait. It represents the list array for which the equality or inequality will be compared. -
element_array- A reference to a trait object implementing the ArrowArraytrait. It represents the array with which each element in thelist_array_rowwill be compared. -
row_index- The index of the row in theelement_arrayandlist_arrayto use for the comparison. -
eq- A boolean flag. Iftrue, the function computes equality; iffalse, it computes inequality.
§Returns
Returns a Result<BooleanArray> representing the comparison results. The result may contain an error if there are issues with the computation.
§Example
compare_element_to_list(
[1, 2, 3], [1, 2, 3], 0, true => [true, false, false]
[1, 2, 3, 3, 2, 1], [1, 2, 3], 1, true => [false, true, false, false, true, false]
[[1, 2, 3], [2, 3, 4], [3, 4, 5]], [[1, 2, 3], [2, 3, 4], [3, 4, 5]], 0, true => [true, false, false]
[[1, 2, 3], [2, 3, 4], [2, 3, 4]], [[1, 2, 3], [2, 3, 4], [3, 4, 5]], 1, false => [true, false, false]
)