Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster Null Path Selection in ArrayData Equality #2676

Merged
merged 2 commits into from Sep 7, 2022

Conversation

dhruv9vats
Copy link
Contributor

Which issue does this PR close?

Closes #2188.

Rationale for this change

What changes are included in this PR?

For the operations that only need to know if there are any nulls to select a more optimized code path, we instead of counting nulls in both lhs and rhs null masks:

  • Replace count_nulls with contains_nulls to not have to traverse the whole bitmap once a null is found.
  • Only check for nulls in lhs ArrayData's null mask, as at these points in execution, the null masks have already been compared.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 7, 2022
arrow/src/array/equal/decimal.rs Outdated Show resolved Hide resolved
arrow/src/array/equal/decimal.rs Show resolved Hide resolved
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think a comment explaining that the null masks have already been checked would be a good addition

arrow/src/array/equal/decimal.rs Show resolved Hide resolved
arrow/src/array/equal/decimal.rs Outdated Show resolved Hide resolved
@dhruv9vats
Copy link
Contributor Author

Skipping this one as we do use the null_count here:

let lhs_null_count = count_nulls(lhs.null_buffer(), lhs_start + lhs.offset(), len);
let rhs_null_count = count_nulls(rhs.null_buffer(), rhs_start + rhs.offset(), len);
if lhs_null_count != rhs_null_count {
return false;
}
if lhs_null_count == 0 && rhs_null_count == 0 {

@tustvold tustvold merged commit c25d16e into apache:master Sep 7, 2022
@ursabot
Copy link

ursabot commented Sep 7, 2022

Benchmark runs are scheduled for baseline = b36bc88 and contender = c25d16e. c25d16e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@dhruv9vats dhruv9vats deleted the faster-null-path-selection branch September 7, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Faster Null Path Selection in ArrayData Equality
3 participants