impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Ribeiro Alves (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] Make TimestampValue packed and change the field order
Date Fri, 17 Feb 2017 04:10:55 GMT
David Ribeiro Alves has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/6048

Change subject: Make TimestampValue packed and change the field order
......................................................................

Make TimestampValue packed and change the field order

Kudu has a similar struct to represent TIMESTAMP values. Making
the two types equivalent allows to cast Kudu's struct into impala's
and thus avoid having to convert. Kudu's struct is slightly different
from Impala's in that:
- It's packed (12 bytes vs 16)
- Has the date/time_duration field order swapped to have the most
  significant bits first.

This patch makes the same changes to the analogous impala
struct, TimestampValue, so that the two structs match exactly.

In addition to the changes to the struct itself this also
changes the codegen transformation to/from TimestampVal
and the static asserts on the type itself, as well as a
few comments that refer to the type as having 16 bytes (it's
now 12 bytes in size).

Note: This uses #pragma packed(4) instead of __attribute__((packed))
because the latter causes compilation failures as the inner fields
are non-POD.

Change-Id: I4d13ac9cf784ee3de1f862dbc6b167f0bdbe364a
---
M be/src/codegen/codegen-anyval.cc
M be/src/codegen/llvm-codegen.cc
M be/src/exec/hash-table.cc
M be/src/exec/old-hash-table.cc
M be/src/exprs/expr-test.cc
M be/src/exprs/literal.cc
M be/src/exprs/slot-ref.cc
M be/src/runtime/descriptors.cc
M be/src/runtime/timestamp-value.h
M be/src/runtime/types.h
M be/src/util/static-asserts.cc
M common/thrift/Exprs.thrift
M fe/src/main/java/org/apache/impala/analysis/TimestampLiteral.java
M fe/src/main/java/org/apache/impala/catalog/PrimitiveType.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzerTest.java
15 files changed, 115 insertions(+), 103 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/48/6048/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6048
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d13ac9cf784ee3de1f862dbc6b167f0bdbe364a
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dralves@apache.org>

Mime
View raw message