wolfeidau commented on code in PR #59: URL: https://github.com/apache/iceberg-go/pull/59#discussion_r1504979600
########## catalog/catalog.go: ########## @@ -185,3 +197,33 @@ func TableNameFromIdent(ident table.Identifier) string { func NamespaceFromIdent(ident table.Identifier) table.Identifier { return ident[:len(ident)-1] } + +func getMetadataPath(locationPath string, newVersion int) (string, error) { + if newVersion < 0 { + return "", fmt.Errorf("invalid table version: %d must be a non-negative integer", newVersion) + } + + metaDataPath, err := url.JoinPath(strings.TrimLeft(locationPath, "/"), "metadata", fmt.Sprintf("%05d-%s.metadata.json", newVersion, uuid.New().String())) + if err != nil { + return "", fmt.Errorf("failed to build metadata path: %w", err) + } + + return metaDataPath, nil +} Review Comment: Yeah I think there are a few couple of things like this that came out of me "using it in anger", I was interested in your thoughts but wasn't super stressed as it is private. Hopefully we can push some of this down to the table. -- 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