File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl Datum {
4141 } )
4242 }
4343
44- pub fn with_target_datatype (
44+ pub fn try_new_with_target_datatype (
4545 array : & dyn Array ,
4646 target_datatype : & DataType ,
4747 ) -> VortexResult < Self > {
@@ -57,6 +57,10 @@ impl Datum {
5757 } )
5858 }
5959 }
60+
61+ pub fn data_type ( & self ) -> & DataType {
62+ self . array . data_type ( )
63+ }
6064}
6165
6266impl ArrowDatum for Datum {
Original file line number Diff line number Diff line change @@ -192,8 +192,9 @@ pub(crate) fn arrow_like(
192192 "Arrow Like: length mismatch for {}" ,
193193 array. encoding_id( )
194194 ) ;
195+ // convert the pattern to the preferred array datatype
195196 let lhs = Datum :: try_new ( array) ?;
196- let rhs = Datum :: try_new ( pattern) ?;
197+ let rhs = Datum :: try_new_with_target_datatype ( pattern, lhs . data_type ( ) ) ?;
197198
198199 let result = match ( options. negated , options. case_insensitive ) {
199200 ( false , false ) => arrow_string:: like:: like ( & lhs, & rhs) ?,
You can’t perform that action at this time.
0 commit comments