David Ribeiro Alves has uploaded a new change for review. http://gerrit.cloudera.org:8080/5965
Change subject: [timestamp] Add a new TimestampValue class to support the TIMESTAMP type ...................................................................... [timestamp] Add a new TimestampValue class to support the TIMESTAMP type This patch adds a new TimestampValue class that will be used both by the client and the server to represent an instance of the new TIMESTAMP type. The type mimics Impala's TIMESTAMP and is supposed to be memory-format compatible - Meaning one type can be cast to the other and no conversion is required. TimestampValue is very strict about the ranges that it accepts, both when building from "seconds + nanos offset since the unix epoch" and from the "date + time" representations. This to make sure that we don't go into unknown territory when using boost's/libc's time conversion functions. A test is provided that provides good coverage of these edge cases. Future patched will wire this class into the client and the tablet server. Although the format is similar to Impala's it does require that a couple of changes are made in the Impala side to be exacly compatible: - TimestampValue is packed so that it occupies only the stricly required space (12 vs. 16 bytes). Impala's TimestampValue will also have to be packed. - TimestampValue has the 'date_' component first as to make sure that the most significant bits come first. Impala's TimestampValue has the fields reversed. While not a bit deal it makes sense to fix it there since the other TIMESTAMP class (in the udf module) shares kudu's TimestampValue field order. Change-Id: I5a0763d3a28501b7f9fb0b94552e3227bd5b38cc --- M src/kudu/client/CMakeLists.txt M src/kudu/common/CMakeLists.txt A src/kudu/common/timestamp_value-test.cc A src/kudu/common/timestamp_value.cc A src/kudu/common/timestamp_value.h 5 files changed, 625 insertions(+), 0 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/65/5965/1 -- To view, visit http://gerrit.cloudera.org:8080/5965 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a0763d3a28501b7f9fb0b94552e3227bd5b38cc Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>