From 988b630448ba6ed5673900ba495a0cbef3bf2887 Mon Sep 17 00:00:00 2001 From: Tal Neiman <33829179+talIguaz@users.noreply.github.com> Date: Wed, 25 Sep 2019 14:25:58 +0300 Subject: [PATCH] fix timestamp default value (#290) --- column.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/column.go b/column.go index a025a9c5..ade6a95a 100644 --- a/column.go +++ b/column.go @@ -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)