-
Notifications
You must be signed in to change notification settings - Fork 839
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
Implement size_hint
and ExactSizedIterator
for DecimalArray
#1506
Conversation
size_hint
and ExactSizedIterator
for DecimalArray
Codecov Report
@@ Coverage Diff @@
## master #1506 +/- ##
=======================================
Coverage 82.73% 82.74%
=======================================
Files 188 188
Lines 54354 54370 +16
=======================================
+ Hits 44970 44987 +17
+ Misses 9384 9383 -1
Continue to review full report at Codecov.
|
arrow/src/array/array_binary.rs
Outdated
} | ||
|
||
/// iterator has have known size. | ||
impl<'a> std::iter::ExactSizeIterator for DecimalIter<'a> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have it in iterator.rs
? I see other ExactSizeIterator
s implementations located there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 that is a good idea. I can certainly move it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me.
Thanks for the review @viirya ! |
Co-authored-by: Liang-Chi Hsieh <[email protected]>
lgtm. thanks @alamb ! |
Which issue does this PR close?
Closes #1505
Rationale for this change
I was doing some small cleanups in DataFusion apache/datafusion#2107 and noticed that the DecimalArray iterators do not report their exact size. The exact size is used in several places for optimizations in Arrow
What changes are included in this PR?
Are there any user-facing changes?
Can use DecimalArray::iter() in more situations