lidavidm edited a comment on pull request #12509:
URL: https://github.com/apache/arrow/pull/12509#issuecomment-1050175988
@ericl would you be able to build this and ensure it fixes your case too?
I tested with the following:
```diff
diff --git a/cpp/src/arrow/dataset/file_parquet.cc
b/cpp/src/arrow/dataset/file_parquet.cc
index cdee1f006..52de0ea11 100644
--- a/cpp/src/arrow/dataset/file_parquet.cc
+++ b/cpp/src/arrow/dataset/file_parquet.cc
@@ -17,6 +17,8 @@
#include "arrow/dataset/file_parquet.h"
+#include <chrono>
+#include <thread>
#include <memory>
#include <mutex>
#include <unordered_map>
@@ -561,6 +563,7 @@ Status
ParquetFileFragment::EnsureCompleteMetadata(parquet::arrow::FileReader* r
return EnsureCompleteMetadata(reader.get());
}
+ std::this_thread::sleep_for(std::chrono::seconds(1));
std::shared_ptr<Schema> schema;
RETURN_NOT_OK(reader->GetSchema(&schema));
if (physical_schema_ && !physical_schema_->Equals(*schema)) {
```
and
```python
from concurrent.futures import ThreadPoolExecutor
import time
import pyarrow as pa
import pyarrow.parquet as pq
dataset = pq.ParquetDataset([
"/home/lidavidm/Documents/ursa-labs-taxi-data/2009/03/data.parquet",
"/home/lidavidm/Documents/ursa-labs-taxi-data/2009/04/data.parquet",
], use_legacy_dataset=False)
print(dataset.fragments)
pool = ThreadPoolExecutor()
start = time.monotonic()
for x in pool.map(lambda x: x.metadata, dataset.fragments):
print(x)
end = time.monotonic()
print(end - start)
```
--
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]