bersprockets commented on PR #42075:
URL: https://github.com/apache/spark/pull/42075#issuecomment-1676417784

   Super late review:
   
   I think `boundGenerator` needs to be initialized somewhere around 
[here](https://github.com/apache/spark/blob/7070b3672d8426834ff936fff4543b10093042fc/sql/core/src/main/scala/org/apache/spark/sql/execution/GenerateExec.scala#L81).
   
   Otherwise, you end up with an error when whole-stage codegen is disabled:
   ```
   spark-sql (default)> set spark.sql.codegen.wholeStage=false;
   spark.sql.codegen.wholeStage false
   Time taken: 1.299 seconds, Fetched 1 row(s)
   spark-sql (default)> select explode(array(rand()));
   23/08/13 09:35:31 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
   java.lang.IllegalArgumentException: requirement failed: Nondeterministic 
expression org.apache.spark.sql.catalyst.expressions.Rand should be initialized 
before eval.
        at scala.Predef$.require(Predef.scala:281)
        at 
org.apache.spark.sql.catalyst.expressions.Nondeterministic.eval(Expression.scala:497)
        at 
org.apache.spark.sql.catalyst.expressions.Nondeterministic.eval$(Expression.scala:495)
        at 
org.apache.spark.sql.catalyst.expressions.RDG.eval(randomExpressions.scala:35)
   ...
   ```


-- 
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