Dan Hecht has posted comments on this change.

Change subject: IMPALA-3163: Fix Decimal to Timestamp casting
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/3154/1/be/src/exprs/decimal-operators-ir.cc
File be/src/exprs/decimal-operators-ir.cc:

Line 574: *
> can't these integer multiplies overflow?  is there a reason that can't happ
oh, i guess what's happening here is that we always have either mult==1 or 
div==1, depending on whether we have more fractional digits in the decimal than 
nanoseconds or not. is that right?  if so, I think this would be clearer 
structured as:

if (scale > TIMESTAMP_SCALE) {
  ... /* Divide to convert to nanos. */
} else {
  ... /* Multiply to convert to nanos. */
}

where we only do either the multiple or divide to convert to nanoseconds.


-- 
To view, visit http://gerrit.cloudera.org:8080/3154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iabeea9f4ab4880b2f814408add63c77916e2dba9
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-2.6.0_5.8.0
Gerrit-Owner: Taras Bobrovytsky <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Taras Bobrovytsky <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-HasComments: Yes

Reply via email to