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

[GitHub] [arrow] yevgenypats opened a new issue, #35686: [Go][TimestampBuilder] Add AppendTime

yevgenypats opened a new issue, #35686:
URL: https://github.com/apache/arrow/issues/35686

   ### Describe the enhancement requested
   
   Right now before appending the Go `time.Time` to a `TimestampBuilder` we need to switch case the builder.type to see what is the precision. I suggest having a native `AppendTime` method.
   
   ```
   func (b *TimestampBuilder) AppendTime(t time.Time) {
   	switch b.dtype.Unit {
   	case arrow.Nanosecond:
   		b.Append(arrow.Timestamp(t.UnixNano()))
   	case arrow.Microsecond:
   		b.Append(arrow.Timestamp(t.UnixMicro()))
   	case arrow.Millisecond:
   		b.Append(arrow.Timestamp(t.UnixMilli()))
   	case arrow.Second:
   		b.Append(arrow.Timestamp(t.Unix()))
   	default:
   		panic("arrow: invalid timestamp unit")
   	}
   }
   ```
   
   ### 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 #35686: [Go][TimestampBuilder] Add AppendTime

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #35686: [Go][TimestampBuilder] Add AppendTime
URL: https://github.com/apache/arrow/issues/35686


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