knoguchi opened a new issue, #324:
URL: https://github.com/apache/iceberg-go/issues/324

   ### Apache Iceberg version
   
   None
   
   ### Please describe the bug 🐞
   
   Does this really work? 
   
https://github.com/apache/iceberg-go/blob/ba883bdb1d26cc8ea0505e3910ffee0f9c74f315/cmd/iceberg/main.go#L412C1-L428C2
   
   The intention seems to be copying values from fileConf to resConfig.  
However it copies values only when the resConfig fields are empty.   However 
doctopt sets the default value, hence the values read from file are ignored 
when default value exists.
   
   For example I set Output "json" in my config yaml, but the value has no 
effect because resConfig.Output has a default value "text".
   
   Is the below better?  But which one has precedence when command line args 
and file config both exist?
   
   func mergeConf(fileConf *config.CatalogConfig, resConfig *Config) {
        if len(fileConf.CatalogType) > 0 {
                resConfig.Catalog = fileConf.CatalogType
        }
        if len(fileConf.URI) > 0 {
                resConfig.URI = fileConf.URI
        }
        if len(fileConf.Output) > 0 {
                resConfig.Output = fileConf.Output
        }
        if len(fileConf.Credential) > 0 {
                resConfig.Cred = fileConf.Credential
        }
        if len(fileConf.Warehouse) > 0 {
                resConfig.Warehouse = fileConf.Warehouse
        }
   }


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