Skip to content

Commit fb8814f

Browse files
committed
fix_test_failures_review_comments
1 parent 3f7940a commit fb8814f

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,10 +1160,10 @@ fn cast_array(
11601160

11611161
fn cast_boolean_to_decimal(array: &ArrayRef, precision: u8, scale: i8) -> SparkResult<ArrayRef> {
11621162
let bool_array = array.as_boolean();
1163-
let scale_factor = 10_i128.pow(scale as u32);
1163+
let scaled_value = 10_i128.pow(scale as u32);
11641164
let result: Decimal128Array = bool_array
11651165
.iter()
1166-
.map(|v| v.map(|b| if b { scale_factor } else { 0 }))
1166+
.map(|v| v.map(|b| if b { scaled_value } else { 0 }))
11671167
.collect();
11681168
Ok(Arc::new(result.with_precision_and_scale(precision, scale)?))
11691169
}

spark/src/main/scala/org/apache/comet/expressions/CometCast.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,6 @@ object CometCast extends CometExpressionSerde[Cast] with CometExprShim {
354354
case _ => Unsupported(Some(s"Cast from DecimalType to $toType is not supported"))
355355
}
356356

357-
private def canCastToBinary(fromType: DataType): SupportLevel = fromType match {
358-
case DataTypes.ByteType | DataTypes.ShortType | DataTypes.IntegerType | DataTypes.LongType =>
359-
Compatible()
360-
case _ => Unsupported(Some(s"Cast from BinaryType to $fromType is not supported"))
361-
}
362-
363357
private def unsupported(fromType: DataType, toType: DataType): Unsupported = {
364358
Unsupported(Some(s"Cast from $fromType to $toType is not supported"))
365359
}

0 commit comments

Comments
 (0)