rouault commented on issue #41321:
URL: https://github.com/apache/arrow/issues/41321#issuecomment-2069205619

   > I guess the problem is in PyArrow wrapper
   
   no, it is not PyArrow specific. It can also be reproduced using plain C++ 
Parquet Arrow API ``arrow::RecordBatchReader::NextBatch()``, as done in GDAL.
   
   Pseudo-code:
   ```c++
   std::unique_ptr<parquet::arrow::FileReader> arrow_reader;
   auto poMemoryPool = 
std::shared_ptr<arrow::MemoryPool>(arrow::MemoryPool::CreateDefault().release());
   parquet::arrow::OpenFile(std::move(infile),  poMemoryPool.get(), 
&arrow_reader);
   const int nNumGroups = arrow_reader->num_row_groups();
   for (int i = 0; i < nNumGroups; ++i)
       anRowGroups.push_back(i);
   std::shared_ptr<arrow::RecordBatchReader> poRecordBatchReader;
   arrow_reader->GetRecordBatchReader(anRowGroups, &poRecordBatchReader);
   std::shared_ptr<arrow::RecordBatch> poBatch;
   while (true)
   {
       poRecordBatchReader->ReadNext(&poBatch);
       if (!poBatch)
             break;
   }
   ```


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