zeroshade commented on code in PR #59:
URL: https://github.com/apache/iceberg-go/pull/59#discussion_r1503476723


##########
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:
   are these specific to glue? 
   
   And wouldn't generating the uuid and version etc. be something that should 
be in the table package rather than in here?



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