apache / iceberg-go

Apache Iceberg - Go
https://iceberg.apache.org/
Apache License 2.0
144 stars 35 forks source link

Config File Handling #62

Closed zeroshade closed 1 month ago

zeroshade commented 9 months ago

Feature Request / Improvement

Similar to pyiceberg's config file we should add handling for a config file to make it easier to manipulate the available options for the CLI and library usage.

alex-kar commented 2 months ago

@zeroshade What's the initial structure for configuration file would look like? Something similar to pyiceberg's config:

catalog:
  default:
    catalog: rest
    uri: http://localhost:8181/
    output: text
    credential: client-id:client-secret
    warehouse: catalog_name

  custom-catalog:
    catalog: rest
    uri: http://localhost:8181/
    output: text
    credential: client-id:client-secret
    warehouse: catalog_name

What about path? ~/iceberg-go.yaml?

I'd like to work on this, but I need a bit more clarity on the expected config structure.

zeroshade commented 2 months ago

Something similar or nearly identical to pyiceberg's config is pretty much what I was thinking, that way it makes it easier to utilize and swap between them.

As far as the path, we should follow pyiceberg's lead and make it a "dot file" by using a preceding . to hide it

e.g. ~/.iceberg-go.yaml

We could also potentially try to coordinate with pyiceberg / other iceberg implementations to standardize a config file name?