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'], Did we consider the other direction: Add a dceil() that works on decimals? Our documentation implies that dceil should work on decimals: https://impala.apache.org/docs/build/plain-html/topics/impala_math_functions.html#math_functions__ceil We have dround and dtrunc for decimals, and our documentation lists those as applying to decimals: https://impala.apache.org/docs/build/plain-html/topics/impala_math_functions.html#math_functions__round Maybe the semantic is that dX is an alias for X rather than a separate thing with its own semantic? -- 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 18:57:20 +0000 Gerrit-HasComments: Yes
