blackmwk commented on code in PR #2247:
URL: https://github.com/apache/iceberg-rust/pull/2247#discussion_r2972489604


##########
crates/iceberg/src/io/storage/mod.rs:
##########
@@ -128,6 +129,19 @@ pub trait Storage: Debug + Send + Sync {
 /// ```
 #[typetag::serde(tag = "type")]
 pub trait StorageFactory: Debug + Send + Sync {
+    /// Create a new factory instance enriched with table metadata.
+    ///
+    /// This allows storage factories to incorporate table-level metadata
+    /// (e.g., table properties) into the storage initialization.
+    ///
+    /// Implementations that don't need table metadata should return
+    /// a clone of themselves: `Ok(Arc::new(self.clone()))`.
+    ///
+    /// # Arguments
+    ///
+    /// * `metadata` - The table metadata to incorporate
+    fn with_metadata(&self, metadata: &TableMetadata) -> Result<Arc<dyn 
StorageFactory>>;

Review Comment:
   I'm not convinced, as a pub trait, providing two not compatible entrance 
method makes both the caller and callee difficult. As a caller, when should I 
call which method? What's the contract should we follow? As a callee, why I 
need to implement two incompatible methods?
   
   As with storing table metadata, in fact it's caused by the optimization of 
building storage lazily. We need to choose to sacrifice at one of them, e.g. 
pay for storing table metadata or building storage eargly.



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