@@ -32,8 +32,9 @@ use arrow::compute::kernels::comparison::{
3232 eq_scalar, gt_eq_scalar, gt_scalar, lt_eq_scalar, lt_scalar, neq_scalar,
3333} ;
3434use arrow:: compute:: kernels:: comparison:: {
35- eq_utf8, gt_eq_utf8, gt_utf8, like_utf8, like_utf8_scalar, lt_eq_utf8, lt_utf8,
36- neq_utf8, nlike_utf8, nlike_utf8_scalar,
35+ eq_utf8, gt_eq_utf8, gt_utf8, ilike_utf8, ilike_utf8_scalar, like_utf8,
36+ like_utf8_scalar, lt_eq_utf8, lt_utf8, neq_utf8, nilike_utf8, nilike_utf8_scalar,
37+ nlike_utf8, nlike_utf8_scalar,
3738} ;
3839use arrow:: compute:: kernels:: comparison:: {
3940 eq_utf8_scalar, gt_eq_utf8_scalar, gt_utf8_scalar, lt_eq_utf8_scalar, lt_utf8_scalar,
@@ -503,7 +504,9 @@ fn common_binary_type(
503504 // logical equality operators have their own rules, and always return a boolean
504505 Operator :: Eq | Operator :: NotEq => eq_coercion ( lhs_type, rhs_type) ,
505506 // "like" operators operate on strings and always return a boolean
506- Operator :: Like | Operator :: NotLike => string_coercion ( lhs_type, rhs_type) ,
507+ Operator :: Like | Operator :: NotLike | Operator :: ILike | Operator :: NotILike => {
508+ string_coercion ( lhs_type, rhs_type)
509+ }
507510 // order-comparison operators have their own rules
508511 Operator :: Lt | Operator :: Gt | Operator :: GtEq | Operator :: LtEq => {
509512 order_coercion ( lhs_type, rhs_type)
@@ -552,6 +555,8 @@ pub fn binary_operator_data_type(
552555 | Operator :: Or
553556 | Operator :: Like
554557 | Operator :: NotLike
558+ | Operator :: ILike
559+ | Operator :: NotILike
555560 | Operator :: Lt
556561 | Operator :: Gt
557562 | Operator :: GtEq
@@ -618,6 +623,12 @@ impl PhysicalExpr for BinaryExpr {
618623 Operator :: NotLike => {
619624 binary_string_array_op_scalar ! ( array, scalar. clone( ) , nlike)
620625 }
626+ Operator :: ILike => {
627+ binary_string_array_op_scalar ! ( array, scalar. clone( ) , ilike)
628+ }
629+ Operator :: NotILike => {
630+ binary_string_array_op_scalar ! ( array, scalar. clone( ) , nilike)
631+ }
621632 Operator :: Divide => {
622633 binary_primitive_array_op_scalar ! ( array, scalar. clone( ) , divide)
623634 }
@@ -685,6 +696,8 @@ impl PhysicalExpr for BinaryExpr {
685696 let result: Result < ArrayRef > = match & self . op {
686697 Operator :: Like => binary_string_array_op ! ( left, right, like) ,
687698 Operator :: NotLike => binary_string_array_op ! ( left, right, nlike) ,
699+ Operator :: ILike => binary_string_array_op ! ( left, right, ilike) ,
700+ Operator :: NotILike => binary_string_array_op ! ( left, right, nilike) ,
688701 Operator :: Lt => binary_array_op ! ( left, right, lt) ,
689702 Operator :: LtEq => binary_array_op ! ( left, right, lt_eq) ,
690703 Operator :: Gt => binary_array_op ! ( left, right, gt) ,
0 commit comments