File tree Expand file tree Collapse file tree
native/spark-expr/src/conversion_funcs
spark/src/test/scala/org/apache/comet Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1160,10 +1160,10 @@ fn cast_array(
11601160
11611161fn 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_val = 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_val } else { 0 } ) )
11671167 . collect ( ) ;
11681168 Ok ( Arc :: new ( result. with_precision_and_scale ( precision, scale) ?) )
11691169}
Original file line number Diff line number Diff line change @@ -1374,7 +1374,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
13741374
13751375 if (testTry) {
13761376 data.createOrReplaceTempView(" t" )
1377- // try_cast() should always return null for invalid inputs
1377+ // try_cast() should always return null for invalid inputs
13781378// not using spark DSL since it `try_cast` is only available from Spark 4x
13791379 val df2 =
13801380 spark.sql(s " select a, try_cast(a as ${toType.sql}) from t order by a " )
You can’t perform that action at this time.
0 commit comments