FreakingMind commented on code in PR #7534:
URL: https://github.com/apache/datafusion-comet/pull/7534#discussion_r4535670032


##########
native/spark-expr/src/math_funcs/utils.rs:
##########
@@ -162,3 +143,486 @@ pub(crate) fn get_precision_scale(data_type: &DataType) 
-> (u8, i8) {
     };
     (*precision, *scale)
 }
+
+/// The rounding direction that distinguishes `ceil` from `floor`.
+///
+/// Implemented by marker types so that each direction is monomorphized into 
the element loop
+/// rather than dispatched for every value.
+pub(crate) trait RoundingMode {
+    const NAME: &'static str;
+
+    fn round_f32(x: f32) -> f32;
+    fn round_f64(x: f64) -> f64;
+    fn div_i64(x: i64, div: i64) -> i64;
+    fn div_i128(x: i128, div: i128) -> i128;

Review Comment:
   Thanks, done with const CEIL: bool, I ran the old and new builds alternately 
and the benches are almost the same



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to