Skip to content

Commit

Permalink
fix timestamp default value (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
talIguaz authored Sep 25, 2019
1 parent 08d5a63 commit 988b630
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion column.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,13 @@ func NewSliceColumn(name string, data interface{}) (Column, error) {
times := data.([]time.Time)
msg.Dtype = pb.DType_TIME
msg.Times = make([]int64, len(times))
nilTime := time.Time{}
for i, t := range times {
msg.Times[i] = t.UnixNano()
if t == nilTime {
msg.Times[i] = 0
} else {
msg.Times[i] = t.UnixNano()
}
}
default:
return nil, fmt.Errorf("unknown data type %T", data)
Expand Down

0 comments on commit 988b630

Please sign in to comment.