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


##########
catalog/catalog.go:
##########
@@ -195,3 +200,36 @@ func TableNameFromIdent(ident table.Identifier) string {
 func NamespaceFromIdent(ident table.Identifier) table.Identifier {
        return ident[:len(ident)-1]
 }
+
+type createTableOpt func(*createTableCfg)
+
+type createTableCfg struct {
+       location      string
+       partitionSpec *iceberg.PartitionSpec
+       sortOrder     table.SortOrder
+       properties    iceberg.Properties
+}
+
+func WithLocation(location string) createTableOpt {
+       return func(cfg *createTableCfg) {
+               cfg.location = strings.TrimRight(location, "/")
+       }
+}
+
+func WithPartitionSpec(spec *iceberg.PartitionSpec) createTableOpt {
+       return func(cfg *createTableCfg) {
+               cfg.partitionSpec = spec
+       }
+}
+
+func WithSortOrder(order table.SortOrder) createTableOpt {

Review Comment:
   With small enough objects, I tend to prefer to use values instead of 
pointers where possible. It reduces pressure on the GC and often allows 
compiler optimizations by avoiding heap allocations.



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