MCPcopy Create free account
hub / github.com/apache/datafusion / apply_logic_op

Function apply_logic_op

datafusion/physical-expr/src/expressions/binary.rs:2771–2788  ·  view source on GitHub ↗
(
        schema: &SchemaRef,
        left: &ArrayRef,
        right: &ArrayRef,
        op: Operator,
        expected: BooleanArray,
    )

Source from the content-addressed store, hash-verified

2769 }
2770
2771 fn apply_logic_op(
2772 schema: &SchemaRef,
2773 left: &ArrayRef,
2774 right: &ArrayRef,
2775 op: Operator,
2776 expected: BooleanArray,
2777 ) -> Result<()> {
2778 let op = binary_op(col("a", schema)?, op, col("b", schema)?, schema)?;
2779 let data: Vec<ArrayRef> = vec![Arc::clone(left), Arc::clone(right)];
2780 let batch = RecordBatch::try_new(Arc::clone(schema), data)?;
2781 let result = op
2782 .evaluate(&batch)?
2783 .into_array(batch.num_rows())
2784 .expect("Failed to convert to array");
2785
2786 assert_eq!(result.as_ref(), &expected);
2787 Ok(())
2788 }
2789
2790 // Test `scalar <op> arr` produces expected
2791 fn apply_logic_op_scalar_arr(

Callers 13

and_with_nulls_opFunction · 0.85
regex_with_nullsFunction · 0.85
or_with_nulls_opFunction · 0.85
eq_op_boolFunction · 0.85
neq_op_boolFunction · 0.85
lt_op_boolFunction · 0.85
lt_eq_op_boolFunction · 0.85
gt_op_boolFunction · 0.85
gt_eq_op_boolFunction · 0.85
is_distinct_from_op_boolFunction · 0.85

Calls 4

binary_opFunction · 0.85
colFunction · 0.70
into_arrayMethod · 0.45
evaluateMethod · 0.45

Tested by 13

and_with_nulls_opFunction · 0.68
regex_with_nullsFunction · 0.68
or_with_nulls_opFunction · 0.68
eq_op_boolFunction · 0.68
neq_op_boolFunction · 0.68
lt_op_boolFunction · 0.68
lt_eq_op_boolFunction · 0.68
gt_op_boolFunction · 0.68
gt_eq_op_boolFunction · 0.68
is_distinct_from_op_boolFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…