Open zuyu opened 5 days ago
I would say just align them. Adding kNotSet
will make the thing unnecessarily complicated.
@Yuhta How about TimestampUnit::kSecond
, remove it or add TimestampPrecision::kSecond
? I prefer to removing it, as it equals to that nanos
is 0
.
@zuyu We can remove it if neither Presto or Spark support it
Bug description
https://github.com/facebookincubator/velox/blob/473902a63ed6a8bac85a2f598b360de739f3bfe4/velox/type/Timestamp.h#L33-L37
https://github.com/facebookincubator/velox/blob/473902a63ed6a8bac85a2f598b360de739f3bfe4/velox/vector/arrow/Bridge.h#L28-L33
TimestampUnit::kSecond
does not have a match inTimestampPrecision
TimestampPrecision::kMilliseconds
used in read vsTimestampUnit::kNano
used in write; most importantly, unit tests (i.e., timestamp int96) does not set the values.Proposed Fixes
kNotSet
as the default value, and requires setting bothTimestampPrecision
andTimestampUnit
if reading / writing a timestamp column. Otherwise, an assertionVELOX_UNREACHABLE()
would trigger.TimestampPrecision
andTimestampUnit
.