(
schema: &SchemaRef,
left: &ArrayRef,
right: &ArrayRef,
op: Operator,
expected: BooleanArray,
)
| 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( |
searching dependent graphs…