jacobmarble commented on code in PR #1081:
URL: https://github.com/apache/iceberg-go/pull/1081#discussion_r3250379699


##########
table/arrow_utils.go:
##########
@@ -342,10 +342,19 @@ func (c convertToIceberg) Primitive(dt arrow.DataType) 
(result iceberg.NestedFie
                        panic(fmt.Errorf("%w: unsupported arrow type for 
conversion - %s", iceberg.ErrInvalidSchema, dt))
                }
        case *arrow.TimestampType:
-               if dt.Unit == arrow.Nanosecond {
-                       if !c.downcastTimestamp {
-                               panic(fmt.Errorf("%w: 'ns' timestamp precision 
not supported", iceberg.ErrType))
+               if dt.Unit == arrow.Nanosecond && !c.downcastTimestamp {
+                       if slices.Contains(utcAliases, dt.TimeZone) {
+                               result.Type = 
iceberg.PrimitiveTypes.TimestampTzNs
+                       } else if dt.TimeZone == "" {
+                               result.Type = iceberg.PrimitiveTypes.TimestampNs
+                       } else {
+                               panic(fmt.Errorf("%w: unsupported arrow type 
for conversion - %s", iceberg.ErrInvalidSchema, dt))
                        }
+
+                       return result

Review Comment:
   b667a98



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

Reply via email to