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

Reduce repetition in Decimal binary kernels, upgrade to arrow 11.1 #2107

Merged
merged 4 commits into from
Apr 6, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Mar 28, 2022

Rationale

I noticed some things that could be written "more nicely" while trolling through the code for other reasons and figured I would sneak in some coding (rather than review)

I think this also makes it easier to port this code to arrow-rs eventually: apache/arrow-rs#1200

Changes:

  1. Remove repetition in the code
  2. Upgrade to arrow-rs 11.1 as it requires Implement size_hint and ExactSizedIterator for DecimalArray arrow-rs#1506

}
}
Ok(bool_builder.finish())
compare_decimal_scalar(left, right, |left, right| left == right)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR simply refactors out the common iteration over inputs into compare_decimal and compare_decimal_scalar

@alamb
Copy link
Contributor Author

alamb commented Mar 28, 2022

FYI @liukun4515

@alamb alamb force-pushed the alamb/cleanup_binary branch from af284b0 to 45758eb Compare March 28, 2022 16:58
@alamb alamb marked this pull request as draft March 28, 2022 17:52
@alamb
Copy link
Contributor Author

alamb commented Mar 28, 2022

Draft until I can debug CI failure

@alamb
Copy link
Contributor Author

alamb commented Mar 29, 2022

Blocked by upstream issue in arrow-rs: apache/arrow-rs#1506

{
Ok(left
.iter()
.map(|left| left.map(|left| op(left, right)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this iter need sized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the call to collect() eventually needs the iterator to be sized (so it knows how large an array to allocate)

@alamb alamb force-pushed the alamb/cleanup_binary branch from 45758eb to 3c582d1 Compare April 5, 2022 19:49
@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Apr 5, 2022
@alamb alamb changed the title Minor: Reduce repetition in Decimal binary kernels Reduce repetition in Decimal binary kernels, upgrade to arrow 11.1 Apr 5, 2022
@alamb alamb marked this pull request as ready for review April 5, 2022 19:57
@yjshen yjshen merged commit 38498b7 into apache:master Apr 6, 2022
@alamb alamb deleted the alamb/cleanup_binary branch August 8, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants