Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21854#discussion_r206600818
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -1446,3 +1448,17 @@ object UpdateNullabilityInAttributeReferences
extends Rule[LogicalPlan] {
}
}
}
+
+/**
+ * Set the seed for random number generation in Uuid expressions for
streaming query.
+ */
+object ResolvedUuidExpressionsForStreaming extends Rule[LogicalPlan] {
+ private lazy val random = new Random()
+
+ override def apply(plan: LogicalPlan): LogicalPlan = plan.transformUp {
+ case p => p transformExpressionsUp {
+ case _: Uuid if p.isStreaming => Uuid(Some(random.nextLong()))
--- End diff --
+1. This rule is only needed for streaming queries.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]