nastra commented on code in PR #173:
URL: https://github.com/apache/iceberg-go/pull/173#discussion_r1804182610
##########
catalog/glue.go:
##########
@@ -180,8 +267,155 @@ func (c *GlueCatalog) ListNamespaces(ctx context.Context,
parent table.Identifie
return icebergNamespaces, nil
}
+// CreateNamespace creates a new Iceberg namespace in the Glue catalog.
+func (c *GlueCatalog) CreateNamespace(ctx context.Context, namespace
table.Identifier, props iceberg.Properties) error {
+ database, err := identifierToGlueDatabase(namespace)
+ if err != nil {
+ return err
+ }
+
+ databaseParameters := map[string]string{
+ databaseTypePropsKey: glueTypeIceberg,
+ }
+
+ description := props[descriptionPropsKey]
+ locationURI := props[locationPropsKey]
+
+ if description != "" {
+ databaseParameters[descriptionPropsKey] = description
+ }
+ if locationURI != "" {
+ databaseParameters[locationPropsKey] = locationURI
+ }
+
+ databaseInput := &types.DatabaseInput{
+ Name: aws.String(database),
+ Parameters: databaseParameters,
+ }
+
+ params := &glue.CreateDatabaseInput{DatabaseInput: databaseInput}
+ _, err = c.glueSvc.CreateDatabase(ctx, params)
Review Comment:
this is also missing a glue catalog id
--
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]