Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
  • Loading branch information
jayzhan211 committed Jul 20, 2023
1 parent 4242894 commit 10eca26
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions datafusion/physical-expr/src/array_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2267,63 +2267,6 @@ mod tests {
assert_eq!(result, &UInt64Array::from_value(2, 1));
}

#[test]
fn test_array_has_all() {
// array_has_all([1, 2, 3, 4], array_append([1, 2, 3, 4], 3)) = t
let first_array = return_array().into_array(1);
let second_array = array_append(&[
first_array.clone(),
Arc::new(Int64Array::from(vec![Some(3)])),
])
.expect("failed to initialize function array_has_all");

let arr = array_has_all(&[first_array.clone(), second_array])
.expect("failed to initialize function array_has_all");
let result = as_boolean_array(&arr);

assert_eq!(result, &BooleanArray::from(vec![true]));

// array_has_all([1, 2, 3, 4], array_append([1, 2, 3, 4], 5)) = f
let second_array = array_append(&[
first_array.clone(),
Arc::new(Int64Array::from(vec![Some(5)])),
])
.expect("failed to initialize function array_has_all");

let arr = array_has_all(&[first_array.clone(), second_array])
.expect("failed to initialize function array_has_all");
let result = as_boolean_array(&arr);

assert_eq!(result, &BooleanArray::from(vec![false]));
}

#[test]
fn test_nested_array_has_all() {
// array_has_all([[1, 2, 3, 4], [5, 6, 7, 8]], array_append([1, 2, 3, 4], 3)) = t
let first_array = return_nested_array().into_array(1);
let array = return_array().into_array(1);
let second_array =
array_append(&[array.clone(), Arc::new(Int64Array::from(vec![Some(3)]))])
.expect("failed to initialize function array_has_all");

let arr = array_has_all(&[first_array.clone(), second_array])
.expect("failed to initialize function array_has_all");
let result = as_boolean_array(&arr);

assert_eq!(result, &BooleanArray::from(vec![true]));

// array_has_all([[1, 2, 3, 4], [5, 6, 7, 8]], array_append([1, 2, 3, 4], 9)) = f
let second_array =
array_append(&[array.clone(), Arc::new(Int64Array::from(vec![Some(9)]))])
.expect("failed to initialize function array_has_all");

let arr = array_has_all(&[first_array.clone(), second_array])
.expect("failed to initialize function array_has_all");
let result = as_boolean_array(&arr);

assert_eq!(result, &BooleanArray::from(vec![false]));
}

fn return_array() -> ColumnarValue {
let args = [
ColumnarValue::Scalar(ScalarValue::Int64(Some(1))),
Expand Down

0 comments on commit 10eca26

Please sign in to comment.