@@ -928,9 +928,6 @@ fn coerce_numeric_type_to_decimal(numeric_type: &DataType) -> Option<DataType> {
928
928
Int16 | UInt16 => Some ( Decimal128 ( 5 , 0 ) ) ,
929
929
Int32 | UInt32 => Some ( Decimal128 ( 10 , 0 ) ) ,
930
930
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 ) ) ,
934
931
_ => None ,
935
932
}
936
933
}
@@ -946,9 +943,6 @@ fn coerce_numeric_type_to_decimal256(numeric_type: &DataType) -> Option<DataType
946
943
Int16 | UInt16 => Some ( Decimal256 ( 5 , 0 ) ) ,
947
944
Int32 | UInt32 => Some ( Decimal256 ( 10 , 0 ) ) ,
948
945
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 ) ) ,
952
946
_ => None ,
953
947
}
954
948
}
@@ -1494,8 +1488,8 @@ mod tests {
1494
1488
DataType :: Decimal128 ( 20 , 3 ) ,
1495
1489
DataType :: Decimal128 ( 20 , 3 ) ,
1496
1490
DataType :: Decimal128 ( 23 , 3 ) ,
1497
- DataType :: Decimal128 ( 24 , 7 ) ,
1498
- DataType :: Decimal128 ( 32 , 15 ) ,
1491
+ DataType :: Float32 ,
1492
+ DataType :: Float64 ,
1499
1493
DataType :: Decimal128 ( 38 , 10 ) ,
1500
1494
DataType :: Decimal128 ( 25 , 8 ) ,
1501
1495
DataType :: Decimal128 ( 20 , 3 ) ,
@@ -1541,14 +1535,8 @@ mod tests {
1541
1535
coerce_numeric_type_to_decimal( & DataType :: Int64 ) . unwrap( ) ,
1542
1536
DataType :: Decimal128 ( 20 , 0 )
1543
1537
) ;
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 ) ;
1552
1540
}
1553
1541
1554
1542
#[ test]
@@ -2013,7 +2001,7 @@ mod tests {
2013
2001
DataType :: Float64 ,
2014
2002
DataType :: Decimal128 ( 10 , 3 ) ,
2015
2003
Operator :: Gt ,
2016
- DataType :: Decimal128 ( 30 , 15 )
2004
+ DataType :: Float64
2017
2005
) ;
2018
2006
test_coercion_binary_rule ! (
2019
2007
DataType :: Int64 ,
0 commit comments