tustvold commented on code in PR #5423: URL: https://github.com/apache/arrow-rs/pull/5423#discussion_r1501306029
########## arrow-ord/src/cmp.rs: ########## @@ -210,17 +210,19 @@ fn compare_op(op: Op, lhs: &dyn Datum, rhs: &dyn Datum) -> Result<BooleanArray, assert_eq!(l.num_columns(), r.num_columns()); match op { Op::Equal => { - let mut res = BooleanArray::from(vec![true; len]); - for i in 0..l.num_columns() { - let col_l = l.column(i); - let col_r = r.column(i); - let eq_rows = compare_op(op, col_l, col_r)?; - - let nulls = NullBuffer::union(res.nulls(), eq_rows.nulls()); - let vals = res.values() & eq_rows.values(); - res = BooleanArray::new(vals, nulls); - } - return Ok(res); + return (0..l.num_columns()).fold( + Ok(BooleanArray::from(vec![true; len])), Review Comment: ```suggestion Ok(BooleanArray::new(BooleanBuffer::new_set(len), None)), ``` This will be significantly faster -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org