impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Hecht (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-2020: Add rounding for decimal casts
Date Mon, 13 Feb 2017 18:23:29 GMT
Dan Hecht has posted comments on this change.

Change subject: IMPALA-2020: Add rounding for decimal casts

Patch Set 5:

File be/src/exprs/

PS5, Line 303: return to_type(dv.whole_part(scale)); 
any reason not to have ToInt<>() handle this case too by passing in 'round' (similar
to FromDouble())?
File be/src/exprs/

Line 185:         value_.decimal4_val = Decimal4Value::FromDouble(type, v, &overflow,
where is this used? will it break compatibility?
File be/src/runtime/decimal-value.h:

PS5, Line 54: bool* overflow,
            :       bool round
here and below, let's keep input parameters first, then output params.

PS5, Line 232:  bool& overflow
use 'bool* overflow'. we generally use pointers for output params to make it clearer at the

Line 232:   inline typename RESULT_T::underlying_type_t ToInt(int scale, bool& overflow)
add a function comment.
File be/src/runtime/decimal-value.inline.h:

Line 50:     if (abs(d) >= max_value) {
is this correct? 'd' is already scaled here.  please be sure to test the upper bounds.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I2daf186b4770a022f9cb349d512067a1dd624810
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Zach Amsden <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Zach Amsden <>
Gerrit-HasComments: Yes

View raw message