zeroshade commented on code in PR #889:
URL: https://github.com/apache/arrow-adbc/pull/889#discussion_r1257326853


##########
go/adbc/driver/snowflake/record_reader.go:
##########
@@ -174,13 +175,19 @@ func getTransformer(sc *arrow.Schema, ld 
gosnowflake.ArrowStreamLoader) (*arrow.
 
                                                q := int64(t) / 
int64(math.Pow10(int(srcMeta.Scale)))
                                                r := int64(t) % 
int64(math.Pow10(int(srcMeta.Scale)))
-                                               
tb.Append(arrow.Timestamp(time.Unix(q, r).UnixNano()))
+                                               v, err := 
arrow.TimestampFromTime(time.Unix(q, r), dt.Unit)
+                                               if err != nil {
+                                                       return nil, err
+                                               }
+                                               tb.Append(v)
                                        }
                                }
                                return tb.NewArray(), nil
                        }
                case "TIMESTAMP_TZ":
-                       dt := &arrow.TimestampType{Unit: arrow.Nanosecond}
+                       // we convert each value to UTC since we have timezone 
information
+                       // with the data that lets us do so.
+                       dt := &arrow.TimestampType{TimeZone: "UTC", Unit: 
arrow.TimeUnit(srcMeta.Scale / 3)}

Review Comment:
   as far as I can tell from testing and the docs on the data types, it seems 
so.



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

Reply via email to