-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIG-40455] fix arrow batch int64 to ntz/ltz #151
Conversation
converter.go
Outdated
} else if col.DataType().ID() == arrow.INT64 { | ||
for i, t := range col.(*array.Int64).Int64Values() { | ||
if !col.IsNull(i) { | ||
val := time.Unix(0, t*int64(math.Pow10(9-int(srcColumnMeta.Scale)))).UTC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other calls to time.Unix
under case timestampLtzType
aren't followed by .UTC()
, is this deviation intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
It's copy and paste mistake. I should follow line 1049.
@@ -941,6 +941,29 @@ func TestArrowToRecord(t *testing.T) { | |||
return -1 | |||
}, | |||
}, | |||
{ | |||
logical: "timestamp_ntz", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test for this case with timestmap_ltz
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this earlier. Follow up in #152
Fix https://sigma-computing.sentry.io/issues/4369020647
panic: interface conversion: arrow.Array is *array.Int64, not *array.Timestamp
sometimes snowflake sends us int64 array and we want to interpret as timestamp.
underlying array.Timestamp is just int64.