alamb commented on code in PR #12253:
URL: https://github.com/apache/arrow-rs/pull/12253#discussion_r4590612734
##########
arrow-string/src/binary_like.rs:
##########
@@ -53,6 +53,17 @@ pub(crate) fn binary_apply<'a, T: BinaryArrayType<'a> + 'a>(
r_v: Option<&'a dyn AnyDictionaryArray>,
) -> Result<BooleanArray, ArrowError> {
let l_len = l_v.map_or_else(|| l.len(), |l| l.len());
+ // A valid dictionary without values can only contain null keys.
+ if l_v.is_some_and(|dict| dict.values().is_empty())
+ || r_v.is_some_and(|dict| dict.values().is_empty())
+ {
+ let len = if l_s {
+ r_v.map_or_else(|| r.len(), |r| r.len())
Review Comment:
i found the definition of r confusing here -- did it mean to be l.len() ?
##########
arrow-string/src/like.rs:
##########
@@ -424,6 +416,17 @@ fn string_apply<'a, T: StringArrayType<'a> + 'a>(
r_v: Option<&'a dyn AnyDictionaryArray>,
) -> Result<BooleanArray, ArrowError> {
let l_len = l_v.map_or_else(|| l.len(), |l| l.len());
+ // A valid dictionary without values can only contain null keys.
+ if l_v.is_some_and(|dict| dict.values().is_empty())
+ || r_v.is_some_and(|dict| dict.values().is_empty())
+ {
+ let len = if l_s {
+ r_v.map_or_else(|| r.len(), |r| r.len())
Review Comment:
same r vs l here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]