Dan Hecht has posted comments on this change. Change subject: IMPALA-2020: Add rounding when casting from decimal to int ......................................................................
Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/5951/3/be/src/runtime/decimal-value.inline.h File be/src/runtime/decimal-value.inline.h: Line 84: auto divisor = DecimalUtil::GetScaleMultiplier<T>(scale); doesn't round, of course. Line 88: return RESULT_T::null(); how about sticking with the convention used in the rest of this file where the caller decides what to do with overflow by returning via *overflow? The reason is because in the not to distant future, we'll want to raise an error on overflow rather than silently convert to null. -- To view, visit http://gerrit.cloudera.org:8080/5951 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2daf186b4770a022f9cb349d512067a1dd624810 Gerrit-PatchSet: 3 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zach Amsden <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Zach Amsden <[email protected]> Gerrit-HasComments: Yes
