linhongliu-db commented on code in PR #59881:
URL: https://github.com/apache/spark/pull/59881#discussion_r4449582860


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala:
##########
@@ -318,6 +318,11 @@ case class Uuid(randomSeed: Option[Long] = None) extends 
LeafExpression with Non
 
   override def stateful: Boolean = true
 
+  // Stateful fresh copies use this hook even for leaves. The default leaf 
hook returns this,
+  // which would share randomGenerator across evaluators; copy preserves the 
seed without
+  // sharing the initialized generator.
+  override def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): 
Expression = copy()

Review Comment:
   Addressed in f5dc5b8 and ade56ed, included in the current a2fadff head. Both 
generators evaluate the child expressions initialized by GenerateExec, and the 
Dataset/Hive regressions check their seeded per-partition UUID values. The 
subsequent review confirmed the P1 is resolved. The PR description also covers 
rand() and monotonically_increasing_id() arguments. CI passes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to