alamb commented on code in PR #6366:
URL: https://github.com/apache/arrow-datafusion/pull/6366#discussion_r1196984754
##########
datafusion/core/src/datasource/file_format/parquet.rs:
##########
@@ -151,12 +152,12 @@ impl FileFormat for ParquetFormat {
store: &Arc<dyn ObjectStore>,
objects: &[ObjectMeta],
) -> Result<SchemaRef> {
- let mut schemas = Vec::with_capacity(objects.len());
- for object in objects {
- let schema =
- fetch_schema(store.as_ref(), object,
self.metadata_size_hint).await?;
- schemas.push(schema)
- }
+ let schemas: Vec<_> = futures::stream::iter(objects)
+ .map(|object| fetch_schema(store.as_ref(), object,
self.metadata_size_hint))
+ .boxed() // Workaround
https://github.com/rust-lang/rust/issues/64552
+ .buffered(32)
Review Comment:
I think the `32` should at least be a named constant so it is more
discoverable
What do you think about potentially using the same value as in
https://github.com/apache/arrow-datafusion/pull/6183:
```
const CONCURRENCY_LIMIT: usize = 100;
```
(I sort of imagine some day someone will want to make that a configuration
knob rather than a constant so using the same constant in the code will make it
easier to find where they are used)
--
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]