@@ -928,9 +928,6 @@ fn coerce_numeric_type_to_decimal(numeric_type: &DataType) -> Option<DataType> {
928928 Int16 | UInt16 => Some ( Decimal128 ( 5 , 0 ) ) ,
929929 Int32 | UInt32 => Some ( Decimal128 ( 10 , 0 ) ) ,
930930 Int64 | UInt64 => Some ( Decimal128 ( 20 , 0 ) ) ,
931- // TODO if we convert the floating-point data to the decimal type, it maybe overflow.
932- Float32 => Some ( Decimal128 ( 14 , 7 ) ) ,
933- Float64 => Some ( Decimal128 ( 30 , 15 ) ) ,
934931 _ => None ,
935932 }
936933}
@@ -946,9 +943,6 @@ fn coerce_numeric_type_to_decimal256(numeric_type: &DataType) -> Option<DataType
946943 Int16 | UInt16 => Some ( Decimal256 ( 5 , 0 ) ) ,
947944 Int32 | UInt32 => Some ( Decimal256 ( 10 , 0 ) ) ,
948945 Int64 | UInt64 => Some ( Decimal256 ( 20 , 0 ) ) ,
949- // TODO if we convert the floating-point data to the decimal type, it maybe overflow.
950- Float32 => Some ( Decimal256 ( 14 , 7 ) ) ,
951- Float64 => Some ( Decimal256 ( 30 , 15 ) ) ,
952946 _ => None ,
953947 }
954948}
@@ -1494,8 +1488,8 @@ mod tests {
14941488 DataType :: Decimal128 ( 20 , 3 ) ,
14951489 DataType :: Decimal128 ( 20 , 3 ) ,
14961490 DataType :: Decimal128 ( 23 , 3 ) ,
1497- DataType :: Decimal128 ( 24 , 7 ) ,
1498- DataType :: Decimal128 ( 32 , 15 ) ,
1491+ DataType :: Float32 ,
1492+ DataType :: Float64 ,
14991493 DataType :: Decimal128 ( 38 , 10 ) ,
15001494 DataType :: Decimal128 ( 25 , 8 ) ,
15011495 DataType :: Decimal128 ( 20 , 3 ) ,
@@ -1541,14 +1535,8 @@ mod tests {
15411535 coerce_numeric_type_to_decimal( & DataType :: Int64 ) . unwrap( ) ,
15421536 DataType :: Decimal128 ( 20 , 0 )
15431537 ) ;
1544- assert_eq ! (
1545- coerce_numeric_type_to_decimal( & DataType :: Float32 ) . unwrap( ) ,
1546- DataType :: Decimal128 ( 14 , 7 )
1547- ) ;
1548- assert_eq ! (
1549- coerce_numeric_type_to_decimal( & DataType :: Float64 ) . unwrap( ) ,
1550- DataType :: Decimal128 ( 30 , 15 )
1551- ) ;
1538+ assert_eq ! ( coerce_numeric_type_to_decimal( & DataType :: Float32 ) , None ) ;
1539+ assert_eq ! ( coerce_numeric_type_to_decimal( & DataType :: Float64 ) , None ) ;
15521540 }
15531541
15541542 #[ test]
@@ -2013,7 +2001,7 @@ mod tests {
20132001 DataType :: Float64 ,
20142002 DataType :: Decimal128 ( 10 , 3 ) ,
20152003 Operator :: Gt ,
2016- DataType :: Decimal128 ( 30 , 15 )
2004+ DataType :: Float64
20172005 ) ;
20182006 test_coercion_binary_rule ! (
20192007 DataType :: Int64 ,
0 commit comments