[ https://issues.apache.org/jira/browse/IMPALA-10400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17252964#comment-17252964 ]
Tim Armstrong commented on IMPALA-10400: ---------------------------------------- There's no real right answer here. I don't think we want to revert the change cause it would just cause more problems going forward. It's an option to add a compatibility flag I guess, but I don't know how much complexity that would add. For the two-argument versions, having the type depend on the value of the second argument like some of the examples I think is a bad idea and leads to problems like IMPALA-7613 that we have for decimal. > Floor/Ceil/Trunc should return BIGINT instead of DOUBLE > ------------------------------------------------------- > > Key: IMPALA-10400 > URL: https://issues.apache.org/jira/browse/IMPALA-10400 > Project: IMPALA > Issue Type: Improvement > Reporter: Sheng Wang > Priority: Major > > Floor/Ceil/Trunc returns BIGINT in version 2.12.0, but change to DOUBLE in > IMPALA-6230. I think these functions should use BIGINT as return value type > instead of DOUBLE. We compared severals systems: > *mysql*: > floor(num): BIGINT > ceil(num): BIGINT > truncate(num, d): d>0 DOUBLE,d=0 BIGINT,d<0 0 > *hive 2.1.1*: > floor(num): BIGINT > ceil(num): BIGINT > trunc(date, format): truncate date > *clickhouse*: > floor(num): BIGINT > ceil(num): BIGINT > truncate(num, [d]),d>0 DOUBLE,d=0 BIGINT,d<0 0 > *greenplum*: > floor(num): BIGINT > ceil(num): BIGINT > truncate(num, [d]),d>0 DOUBLE,d=0 BIGINT,d<0 0 > *spark*: > floor(num): BIGINT > ceil(num): BIGINT > trunc(date, format): truncate date -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org For additional commands, e-mail: issues-all-h...@impala.apache.org