Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21980#discussion_r207441687
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/IncrementalExecution.scala
---
@@ -75,14 +75,15 @@ class IncrementalExecution(
* with the desired literal
*/
override lazy val optimizedPlan: LogicalPlan = {
- val random = new Random()
-
sparkSession.sessionState.optimizer.execute(withCachedData)
transformAllExpressions {
case ts @ CurrentBatchTimestamp(timestamp, _, _) =>
logInfo(s"Current batch timestamp = $timestamp")
ts.toLiteral
// SPARK-24896: Set the seed for random number generation in Uuid
expressions.
- case _: Uuid => Uuid(Some(random.nextLong()))
+ case _: Uuid => Uuid(Some(Utils.random.nextLong()))
--- End diff --
shall we create a trait `ExpressionWithRandomSeed` which has a
`withNewSeed` method for these expressions?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]