Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions rust/sedona-geoparquet/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,16 @@ impl FileFormat for GeoParquetFormat {
// copy more ParquetFormat code. It may be that caching at the object
// store level is the way to go here.
let metadatas: Vec<_> = futures::stream::iter(objects)
.map(|object| async move {
DFParquetMetadata::new(store.as_ref(), object)
.with_metadata_size_hint(self.inner().metadata_size_hint())
.fetch_metadata()
.await
.map(|object| {
let file_metadata_cache =
state.runtime_env().cache_manager.get_file_metadata_cache();
Comment on lines +187 to +188
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with_file_metadata_cache() is called for each iteration of the loop (.map()), we need a clone for each separate iteration. get_file_metadata_cache() returns a cloned Arc, already, so no need to call another .clone().

https://github.com/apache/datafusion/blob/28755b1d7eb5222a8f5fb5417134dd6865ac1311/datafusion/execution/src/cache/cache_manager.rs#L174-L176

async move {
DFParquetMetadata::new(store.as_ref(), object)
.with_metadata_size_hint(self.inner().metadata_size_hint())
.with_file_metadata_cache(Some(file_metadata_cache))
.fetch_metadata()
.await
}
})
.boxed() // Workaround https://github.com/rust-lang/rust/issues/64552
.buffered(state.config_options().execution.meta_fetch_concurrency)
Expand Down