petern48 commented on code in PR #294:
URL: https://github.com/apache/sedona-db/pull/294#discussion_r2508384379
##########
rust/sedona-geoparquet/src/format.rs:
##########
@@ -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();
Review Comment:
`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
--
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]