alamb commented on code in PR #14126:
URL: https://github.com/apache/datafusion/pull/14126#discussion_r1916864288


##########
datafusion/expr-common/src/interval_arithmetic.rs:
##########
@@ -76,6 +76,14 @@ macro_rules! get_extreme_value {
             DataType::Interval(IntervalUnit::MonthDayNano) => {
                 
ScalarValue::IntervalMonthDayNano(Some(IntervalMonthDayNano::$extreme))
             }
+            DataType::Decimal128(precision, scale) => {
+                ScalarValue::Decimal128(Some(i128::$extreme), *precision, 
*scale)

Review Comment:
   I dug around in arrow a bit and I think these are the min/max values for 
each decimal precision
   
   
https://docs.rs/arrow/latest/arrow/datatypes/constant.MIN_DECIMAL_FOR_EACH_PRECISION.html
   
https://docs.rs/arrow/latest/arrow/datatypes/constant.MAX_DECIMAL_FOR_EACH_PRECISION.html
   



##########
datafusion/expr-common/src/interval_arithmetic.rs:
##########
@@ -76,6 +76,14 @@ macro_rules! get_extreme_value {
             DataType::Interval(IntervalUnit::MonthDayNano) => {
                 
ScalarValue::IntervalMonthDayNano(Some(IntervalMonthDayNano::$extreme))
             }
+            DataType::Decimal128(precision, scale) => {
+                ScalarValue::Decimal128(Some(i128::$extreme), *precision, 
*scale)

Review Comment:
   Is this correct for min/max of i128? It seems like the minimum value of 
Decimal128(precision, scale) would be the minimum value for the precision and 
scale separately rather than the min value of the overall i128 🤔 



-- 
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