Skip to content

Commit

Permalink
Reduce repetition
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 21, 2023
1 parent 926d1f0 commit 7cde104
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datafusion/physical-expr/src/expressions/in_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ impl PhysicalExpr for InListExpr {
let r = match &self.static_filter {
Some(f) => f.contains(value.into_array(num_rows)?.as_ref(), self.negated)?,
None => {
let value = value.into_array(batch.num_rows())?;
let value = value.into_array(num_rows)?;
let found = self.list.iter().map(|expr| expr.evaluate(batch)).try_fold(
BooleanArray::new(BooleanBuffer::new_unset(batch.num_rows()), None),
BooleanArray::new(BooleanBuffer::new_unset(num_rows), None),
|result, expr| -> Result<BooleanArray> {
Ok(or_kleene(
&result,
&eq(&value, &expr?.into_array(batch.num_rows())?)?,
&eq(&value, &expr?.into_array(num_rows)?)?,
)?)
},
)?;
Expand Down

0 comments on commit 7cde104

Please sign in to comment.