pitrou commented on a change in pull request #9164:
URL: https://github.com/apache/arrow/pull/9164#discussion_r555961225
##########
File path: cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
##########
@@ -36,53 +36,59 @@ namespace {
template <typename Type>
struct SetLookupState : public KernelState {
- explicit SetLookupState(MemoryPool* pool)
- : lookup_table(pool, 0), lookup_null_count(0) {}
+ explicit SetLookupState(const SetLookupOptions& options, MemoryPool* pool)
+ : options(options), lookup_table(pool, 0) {}
- Status Init(const SetLookupOptions& options) {
+ Status Init() {
+ if (options.value_set.kind() == Datum::ARRAY) {
+ RETURN_NOT_OK(AddArrayValueSet(*options.value_set.array()));
+ } else if (options.value_set.kind() == Datum::CHUNKED_ARRAY) {
+ const ChunkedArray& value_set = *options.value_set.chunked_array();
+ for (const std::shared_ptr<Array>& chunk : value_set.chunks()) {
Review comment:
If we're not too bothered by the cost of a temporary vector then it may
be nice indeed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]