zeroshade commented on code in PR #927:
URL: https://github.com/apache/iceberg-go/pull/927#discussion_r3126716319
##########
cmd/iceberg/main.go:
##########
@@ -552,3 +580,53 @@ func mergeConf(fileConf *config.CatalogConfig, resConfig
*Config, explicitFlags
resConfig.Warehouse = fileConf.Warehouse
}
}
+
+func schemaFromFile(path string) (*iceberg.Schema, error) {
+ ext := strings.ToLower(filepath.Ext(path))
+
+ switch ext {
+ case ".parquet", ".parq":
+ return schemaFromParquetFile(path)
+ default:
+ return nil, fmt.Errorf("unsupported file format %q for %q: only
.parquet files are currently supported", ext, path)
Review Comment:
`%q` is for a single quoted character literal, not for strings. This should
probably be `%s` right? Also, if you're going to use the extension to validate
whether or not it's the right format you should include both `.parquet` and
`.parq` in the error message if those are the two extensions supported.
--
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]