ARROW-3871: [R] Replace usages of C++ GetValuesSafely with new methods on ArrayData#3103
ARROW-3871: [R] Replace usages of C++ GetValuesSafely with new methods on ArrayData#3103romainfrancois wants to merge 4 commits intoapache:masterfrom
Conversation
cpp/src/arrow/array.h
Outdated
| // Access a buffer's data as a typed C pointer | ||
| template <typename T> | ||
| inline const T* GetValues(int i) const { | ||
| inline const T* GetValues(int i, int64_t offset_) const { |
There was a problem hiding this comment.
The foo_ naming is reserved for class members
There was a problem hiding this comment.
@pitrou since this function can be used to access any of the buffers, the "GetValues" name could be misleading. Perhaps GetBufferAs<T>(i) or something?
There was a problem hiding this comment.
Perhaps GetBufferValues? But that's starting to feel a bit verbose, especially the mutable version :-)
There was a problem hiding this comment.
(personally I'm fine with GetValues, btw)
There was a problem hiding this comment.
Yeah, I think it's OK, especially as this is an internal developer API
cpp/src/arrow/array.h
Outdated
| // Access a buffer's data as a typed C pointer | ||
| template <typename T> | ||
| inline T* GetMutableValues(int i) { | ||
| inline T* GetMutableValues(int i, int64_t offset_) { |
|
Now the |
Codecov Report
@@ Coverage Diff @@
## master #3103 +/- ##
==========================================
+ Coverage 87.04% 88.15% +1.11%
==========================================
Files 492 434 -58
Lines 69104 65343 -3761
==========================================
- Hits 60153 57605 -2548
+ Misses 8850 7738 -1112
+ Partials 101 0 -101
Continue to review full report at Codecov.
|
To get rid of
GetValuesSafelyI've had to add variants ofArrayData.GetValues<>that take andoffsetas a parameter, this is useful e.g. for boolean arrays or string arrays.