Skip to content

Commit bfff5ac

Browse files
committed
u
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 11e3db8 commit bfff5ac

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

vortex-array/src/arrow/datum.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

6266
impl ArrowDatum for Datum {

vortex-array/src/compute/like.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)?,

0 commit comments

Comments
 (0)