westonpace commented on issue #11224:
URL: https://github.com/apache/arrow/issues/11224#issuecomment-926841797


   I didn't realize you had also asked here and I left a comment on your 
StackOverflow question but it is possible to have more of a discussion here.  
It's hard to answer this question without a better idea of what you want to do 
with the data.  For example, you can grab a specific column and cast if you 
know the data type:
   
   ```
   std::shared_ptr<ChunkedArray> column = table->column(0);
   for (int i = 0; i < column->num_chunks(); i++) {
     std::shared_ptr<Array> chunk = column->chunk(i);
     std::shared_ptr<StringArray> str_chunk = 
std::dynamic_pointer_cast<StringArray>(chunk);
     for (int j = 0; j < str_chunk->length(); j++) {
       // Note, there are various ways to access an item in StringArray and 
GetString is probably
       // the least efficient but simple for demos
       std::cout << str_chunk->GetString(j) << std::endl;
     }
   }
   ```


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