liurenjie1024 commented on issue #246:
URL: https://github.com/apache/iceberg-rust/issues/246#issuecomment-1991256797

   Hi, @a-agmon 
   
   I think both method could be provided and the second version could be 
implemented as a simple wrapper as the first one.
   
   What I want to add is that instead of implement it directly on `Table`, I 
want to add a new struct `StaticTable` as following:
   
   ```rust
   pub struct StaticTable(Table);
   
   impl StaticTable {
    pub async fn from_metadata(metadata_file_location: &str, file_io: FileIO) 
-> anyhow::Result<Self> {
      ...
    }
   
      pub fn scan(&self) -> TableScanBuilder<'_> {
           TableScanBuilder::new(self.0)
       }
   
      pub fn metadata(&self) -> TableMetadataRef {...}
   }
   ```
   
   The reason we need a `StaticTable` is that it's readoly and mainly used for 
scan. With this approach we can forbid applying transaction on `StaticTable` in 
a type safe approach. What do you think?


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to