dwilson1988 commented on PR #176:
URL: https://github.com/apache/iceberg-go/pull/176#issuecomment-2418127366

   Okay, played around a bit and here's where my head is at.
   
   The main reason I'd like to isolated the creation of a `*blob.Bucket` is 
I've found that the particular implementation of bucket access can get tricky 
and rather than support it in this package for all situations, support the most 
common usage in `io.LoadFS/inferFileIOFromSchema` and change 
`io.CreateBlobFileIO` to accept a `*url.URL` and a `*blob.Bucket`. This enables 
a user to open a bucket with whatever implementation they so choose (GCS, 
Azure, S3, MinIO, Mem, FileSystem, etc) and there's less code here to maintain.
   
   What I came up with is changing `CreateBlobFileIO` to:
   
   ```go
   // CreateBlobFileIO creates a new BlobFileIO instance
   func CreateBlobFileIO(parsed *url.URL, bucket *blob.Bucket) (*BlobFileIO, 
error) {
        ctx := context.Background()
        return &BlobFileIO{Bucket: bucket, ctx: ctx, opts: 
&blob.ReaderOptions{}, prefix: parsed.Host + parsed.Path}, nil
   }
   ```
   
   The URL is still critical there, but now we don't have to concern ourselves 
with credentials to open the bucket except for in `LoadFS`.
   
   Thoughts on this?
   
   


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