Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24696 )

Change subject: IMPALA-15264: DFLOOR returns wrong datatype.
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/24696/1/common/function-registry/impala_functions.py
File common/function-registry/impala_functions.py:

http://gerrit.cloudera.org:8080/#/c/24696/1/common/function-registry/impala_functions.py@482
PS1, Line 482:   [['round','dround'], 'DECIMAL', ['DECIMAL'], 
'impala::DecimalFunctions::Round'],
             :   # The reason why we declare the following function several 
times (instead of simply
             :   # setting the second argument to BIGINT and relying on 
implicit casting is because
             :   # we don't know if the first Decimal argument needs to be cast 
to double, or the second
             :   # argument needs to be cast to a BIGINT.
             :   [['round','dround'], 'DECIMAL', ['DECIMAL', 'TINYINT'], 
'impala::DecimalFunctions::RoundTo'],
             :   [['round','dround'], 'DECIMAL', ['DECIMAL', 'SMALLINT'], 
'impala::DecimalFunctions::RoundTo'],
             :   [['round','dround'], 'DECIMAL', ['DECIMAL', 'INT'], 
'impala::DecimalFunctions::RoundTo'],
             :   [['round','dround'], 'DECIMAL', ['DECIMAL', 'BIGINT'], 
'impala::DecimalFunctions::RoundTo'],
             :   [['truncate','dtrunc','trunc'], 'DECIMAL', ['DECIMAL'], 
'impala::DecimalFunctions::Truncate'],
             :   [['truncate','dtrunc','trunc'], 'DECIMAL', ['DECIMAL', 
'TINYINT'],
             :       'impala::DecimalFunctions::TruncateTo'],
             :   [['truncate','dtrunc','trunc'], 'DECIMAL', ['DECIMAL', 
'SMALLINT'],
             :       'impala::DecimalFunctions::TruncateTo'],
             :   [['truncate','dtrunc','trunc'], 'DECIMAL', ['DECIMAL', 'INT'],
             :       'impala::DecimalFunctions::TruncateTo'],
             :   [['truncate','dtrunc','trunc'], 'DECIMAL', ['DECIMAL', 
'BIGINT'],
             :       'impala::DecimalFunctions::TruncateTo'],
> Are DFLOOR/DCEIL really just aliases for FLOOR/CEIL? I haven't seem the nam
Most systems don't have dfloor/dceil/dround/dtrunc.

It looks like Netezza uses different data types for floor vs dfloor and ceil vs 
dceil (but not round or trunc): 
https://www.ibm.com/docs/en/netezza?topic=npsse-math-functions
I'm not sure if there are other older systems that had that.

StarRocks/Doris treats them as an alias. I think that may be what we intended.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I42be103dcf206c5af467fc2bd08cfdd5c62fe7c2
Gerrit-Change-Number: 24696
Gerrit-PatchSet: 1
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Comment-Date: Wed, 19 Aug 2026 19:57:31 +0000
Gerrit-HasComments: Yes

Reply via email to