You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2026/04/27 04:09:25 UTC
Re: [PR] fix: rescale decimal results in floor and ceil to scale 0 [datafusion]
Jefffrey commented on code in PR #20793:
URL: https://github.com/apache/datafusion/pull/20793#discussion_r3144826417
##########
datafusion/functions/src/math/decimal.rs:
##########
@@ -41,14 +41,15 @@ where
let factor = decimal_scale_factor::<T>(scale, fn_name)?;
let decimal = array.as_primitive::<T>();
- let data_type = array.data_type().clone();
+ let data_type = T::TYPE_CONSTRUCTOR(precision, 0);
Review Comment:
If we decide to go with this approach we should probably rename `apply_decimal_op` since it makes it very specific to floor/ceil (even though those are currently its only usages)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org