You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ddl-gabrielhaim (via GitHub)" <gi...@apache.org> on 2023/05/25 19:30:21 UTC

[GitHub] [arrow] ddl-gabrielhaim opened a new issue, #35770: TimestampType zero value default to seconds unit instead of nanoseconds

ddl-gabrielhaim opened a new issue, #35770:
URL: https://github.com/apache/arrow/issues/35770

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   The godoc mentions the zero value of `arrow.TimestampType` should be nanosecond UTC  (see https://github.com/apache/arrow/blob/main/go/arrow/datatype_fixedwidth.go#L340) but the `arrow.TimeUnit` seems to default to seconds (https://github.com/apache/arrow/blob/main/go/arrow/datatype_fixedwidth.go#L327)
   
   ```golang
   package main
   
   import (
   	"fmt"
   
   	"github.com/apache/arrow/go/v13/arrow"
   )
   
   func main() {
   	t1 := arrow.TimestampType{Unit: 3}
   	t2 := arrow.TimestampType{}
   
   	fmt.Printf("Timestamp Unit 3: %s\n", t1.Unit)
   	fmt.Printf("Timestamp Unit default: %s\n", t2.Unit)
   }
   ```
   
   output:
   ```
   Timestamp Unit 3: ns
   Timestamp Unit default: s
   ```
   
   
   ### Component(s)
   
   Go


-- 
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-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] zeroshade closed issue #35770: [Go] TimestampType zero value default to seconds unit instead of nanoseconds

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #35770: [Go] TimestampType zero value default to seconds unit instead of nanoseconds
URL: https://github.com/apache/arrow/issues/35770


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] zeroshade commented on issue #35770: [Go] TimestampType zero value default to seconds unit instead of nanoseconds

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #35770:
URL: https://github.com/apache/arrow/issues/35770#issuecomment-1568755022

   @ddl-gabrielhaim good catch. A bunch of the math and shortcuts are based on the fact that the enum value of `Seconds` is 0 (to make life easier), so we should probably update the documentation/comment to clarify that the zero value is Seconds not Nanoseconds. Would you be willing to create a PR for it?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org