mkleen commented on code in PR #27580:
URL: https://github.com/apache/datafusion/pull/27580#discussion_r4684599191


##########
datafusion/datasource-parquet/src/metadata.rs:
##########
@@ -204,6 +212,31 @@ impl<'a> DFParquetMetadata<'a> {
         self
     }
 
+    /// Set the [`ObjectStoreUrl`] of the store this file is read from.
+    ///
+    /// Together with the file's location it forms the
+    /// [`FileMetadataCacheKey`], so that files with the same path in
+    /// different object stores do not share a cache entry. Without it the
+    /// [`FileMetadataCache`] is not used.
+    pub fn with_object_store_url(

Review Comment:
   Having with_file_metadata_cache and with_object_store_url separate is 
problematic, because they are depending on each other. If you set the cache but 
forget the url, caching just turns off silently. Every existing downstream 
caller using with_file_metadata_cache will still compile but doesn't work as 
expected.
   
   How about something like:
   
   ```rust
   pub fn with_file_metadata_cache(
       mut self,
       cache: Option<(Arc<FileMetadataCache>, ObjectStoreUrl)>,
   ) -> Self
   ```
   Then downstream code stops compiling instead of silently losing the cache, 
and the fix is obvious. Same for ParquetFileReader::with_metadata_cache.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to