Csaba Ringhofer has uploaded a new change for review. http://gerrit.cloudera.org:8080/8051
Change subject: IMPALA-5668: Fix cast(X as timestamp) for negative subsecond Decimals ...................................................................... IMPALA-5668: Fix cast(X as timestamp) for negative subsecond Decimals The timestamp conversion from negative fractional Decimal types (interpreted as unix timestamp) was wrong - the whole part was rounded toward zero, and fractional part was being added instead of being subtracted. Example for the wrong behaivour: +-------------------------------------------------+ | cast(cast(-0.1 as decimal(20,10)) as timestamp) | +-------------------------------------------------+ | 1970-01-01 00:00:00.100000000 | +-------------------------------------------------+ while casting to double works correctly: +-----------------------------------------+ | cast(cast(-0.1 as double) as timestamp) | +-----------------------------------------+ | 1969-12-31 23:59:59.900000000 | +-----------------------------------------+ Change-Id: I8216f4c0f100c1bd68891cd6048236bfe4c205f0 --- M be/src/exprs/decimal-operators-ir.cc 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/8051/1 -- To view, visit http://gerrit.cloudera.org:8080/8051 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8216f4c0f100c1bd68891cd6048236bfe4c205f0 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Csaba Ringhofer <csringho...@cloudera.com>