SChakravorti21 commented on issue #34535:
URL: https://github.com/apache/arrow/issues/34535#issuecomment-1971570218

   Hey @felipecrv! Sorry I have been unresponsive the last few days, was busy 
with work and couldn't find much free time outside of work.
   
   Everything you have said makes sense to me. I took a look at 
https://github.com/apache/arrow/pull/40281 and the changes there look great to 
me.
   
   > We can bring most of `chunked_internal.h` to here (or a different header 
that includes `chunk_resolver.h`) but improve on the design as it will now 
become public.
   
   So just to clarify, is the plan to move _both_ `ChunkResolver` and 
`ChunkedArrayResolver` into the public namespace? I think this would make sense 
- people can use `ChunkResolver` if they want low-level access to chunk 
locations, or they can use `ChunkedArrayResolver` if they want easy random 
access to values by logical index.
   
   The `ChunkedArrayResolver` changes look really nice for applications that 
need to apply some row-wise business logic to `ChunkedArray`s (which is the 
use-case I was targeting):
   
   ```cpp
   std::shared_ptr<arrow::Table> table;
   
   arrow::ChunkedArrayResolver resolver_a(table.GetColumnByName("a"));
   arrow::ChunkedArrayResolver resolver_b(table.GetColumnByName("b"));
   
   for (int i = 0; i < table->num_rows(); ++i)
   {
     std::int64_t a = resolver_a.Resolve(i).Value<arrow::Int64Type>();
     std::string_view b = resolver_b.Resolve(i).Value<arrow::StringType>();
     do_business_logic(a, b);
   }
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to