dttung2905 commented on code in PR #475:
URL: https://github.com/apache/iceberg-go/pull/475#discussion_r2220419887


##########
cmd/iceberg/utils.go:
##########
@@ -0,0 +1,128 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package main
+
+import (
+       "fmt"
+       "strings"
+
+       "github.com/apache/iceberg-go"
+       "github.com/apache/iceberg-go/table"
+)
+
+func parseProperties(propStr string) (iceberg.Properties, error) {
+       if propStr == "" {
+               return iceberg.Properties{}, nil
+       }
+       props := make(iceberg.Properties)
+       pairs := strings.Split(propStr, ",")
+
+       for _, pair := range pairs {
+               parts := strings.SplitN(strings.TrimSpace(pair), "=", 2)
+               if len(parts) != 2 {
+                       return nil, fmt.Errorf("invalid property pair: %s 
(expected key=value)", pair)
+               }
+               key := strings.TrimSpace(parts[0])
+               value := strings.TrimSpace(parts[1])
+               if key == "" {
+                       return nil, fmt.Errorf("property key cannot be empty 
in: %s", pair)
+               }
+               props[key] = value
+       }
+
+       return props, nil
+}
+
+func parsePartitionSpec(specStr string) (*iceberg.PartitionSpec, error) {
+       if specStr == "" {
+               return iceberg.UnpartitionedSpec, nil
+       }
+
+       fields := strings.Split(specStr, ",")
+       var partitionFields []iceberg.PartitionField
+
+       for i, field := range fields {
+               field = strings.TrimSpace(field)
+               if field == "" {
+                       continue
+               }
+
+               partitionFields = append(partitionFields, 
iceberg.PartitionField{
+                       SourceID:  i + 1,
+                       FieldID:   i + 100,
+                       Name:      field,
+                       Transform: iceberg.IdentityTransform{},

Review Comment:
   Thanks @kevinjqliu I have added support for custom null-order and short 
paragraph in the cli doc to highlight this



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