Skip to content

Commit 8c3b9cd

Browse files
author
Bhargava Vadlamani
committed
integral_types_decimal_cast_native_support
1 parent 0f3764a commit 8c3b9cd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • native/spark-expr/src/conversion_funcs

native/spark-expr/src/conversion_funcs/cast.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,22 @@ fn is_datafusion_spark_compatible(
11471147
| DataType::Float64
11481148
| DataType::Utf8
11491149
),
1150+
DataType::Int8 | DataType::Int16 | DataType::Int32 | DataType::Int64 => {
1151+
// note that the cast from Int32/Int64 -> Decimal128 here is actually
1152+
// not compatible with Spark (no overflow checks) but we have tests that
1153+
// rely on this cast working, so we have to leave it here for now
1154+
matches!(
1155+
to_type,
1156+
DataType::Boolean
1157+
| DataType::Int8
1158+
| DataType::Int16
1159+
| DataType::Int32
1160+
| DataType::Int64
1161+
| DataType::Float32
1162+
| DataType::Float64
1163+
| DataType::Utf8
1164+
)
1165+
}
11501166
DataType::Float32 | DataType::Float64 => matches!(
11511167
to_type,
11521168
DataType::Boolean

0 commit comments

Comments
 (0)