-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-6276: [C++] Add operator[] for some arrow classes #11694
ARROW-6276: [C++] Add operator[] for some arrow classes #11694
Conversation
I think this should be consistent with our iterators, and they return a |
659eb03
to
32f8388
Compare
@pitrou Please have a look now. I have tried to use the aliases from the classes but that doesn't work as of now. |
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 better now but can you add some tests?
The related test files are array_test.cc
, arrow_binary_test.cc
, etc. inside arrow/array
.
32f8388
to
b4040a9
Compare
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.
Thanks for the update! Here are some comments, and an answer to your question.
90cf838
to
75faa3e
Compare
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.
Thanks for the update. Some more comments.
#11694 (comment) hehe, yes, sorry. #11694 (comment) noted |
The following classes have now an additional operator[](int64_t) overload that fetches ith element. - BooleanArray - NumericArray - DayTimeIntervalArray - MonthDayNanoIntervalArray - BaseBinaryArray - FixedSizeBinaryArray Authored-by: Pradeep Garigipati <pradeep.garigipati@gmail.com> Signed-off-by: Pradeep Garigipati <pradeep.garigipati@gmail.com>
Signed-off-by: Pradeep Garigipati <pradeep.garigipati@gmail.com>
75faa3e
to
8341628
Compare
cpp/src/arrow/array/array_test.cc
Outdated
|
||
typedef ::testing::Types<PBoolean, PUInt8, PUInt16, PUInt32, PUInt64, PInt8, PInt16, | ||
PInt32, PInt64, PFloat, PDouble> | ||
NumericPrimitives; |
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.
Is it possible to also make it work for MonthIntervalType
/ MonthIntervalArray
? See arrow/type_fwd.h
for their definitions.
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.
Well, I was referring to that itself in the first sentence of my earlier comment when I said two kinds of vectors are needed: 1) Array of scalars for all numeric types 2) Array of tuples is needed for IntervalArray types.
I tried and failed with one approach earlier. But I think current one(about to push) works fine. Please have a look.
Signed-off-by: Pradeep Garigipati <pradeep.garigipati@gmail.com>
Signed-off-by: Pradeep Garigipati <pradeep.garigipati@gmail.com>
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.
I've pushed a small change and will merge. Thanks @9prady9 !
Benchmark runs are scheduled for baseline = 0ee3449 and contender = 0962957. 0962957 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
The following classes have now an additional operator[](int64_t) overload that fetches ith element. - BooleanArray - NumericArray - DayTimeIntervalArray - MonthDayNanoIntervalArray - BaseBinaryArray - FixedSizeBinaryArray Closes apache#11694 from 9prady9/ARROW-6276-Add-operator-to-some-concrete-Array-impl Lead-authored-by: Pradeep Garigipati <pradeep.garigipati@gmail.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
The following classes have now an additional operator
overload that fetches ith element.