File tree 2 files changed +5
-2
lines changed
spark/src/test/scala/org/apache/comet
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ impl RandExpr {
87
87
}
88
88
89
89
fn extract_init_state ( seed : ScalarValue ) -> Result < i64 > {
90
- if let ScalarValue :: Int64 ( Some ( init_seed ) ) = seed. cast_to ( & DataType :: Int64 ) ? {
91
- Ok ( init_seed )
90
+ if let ScalarValue :: Int64 ( seed_opt ) = seed. cast_to ( & DataType :: Int64 ) ? {
91
+ Ok ( seed_opt . unwrap_or ( 0 ) )
92
92
} else {
93
93
Err ( DataFusionError :: Internal (
94
94
"unexpected execution branch" . to_string ( ) ,
Original file line number Diff line number Diff line change @@ -2531,6 +2531,9 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
2531
2531
val dfWithOverflowSeed =
2532
2532
df.repartition(partitionsNumber).withColumn(" rnd" , rand(Long .MaxValue ))
2533
2533
checkSparkAnswer(dfWithOverflowSeed)
2534
+ val dfWithNullSeed =
2535
+ df.repartition(partitionsNumber).selectExpr(" _1" , " rand(null) as rnd" )
2536
+ checkSparkAnswer(dfWithNullSeed)
2534
2537
}
2535
2538
}
2536
2539
}
You can’t perform that action at this time.
0 commit comments