cloud-fan commented on a change in pull request #30570:
URL: https://github.com/apache/spark/pull/30570#discussion_r534104632



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -42,10 +42,10 @@ import org.apache.spark.sql.types._
  */
 object ConstantFolding extends Rule[LogicalPlan] {
 
-  private def hasNoSideEffect(e: Expression): Boolean = e match {
+  private def cannotThrowException(e: Expression): Boolean = e match {
     case _: Attribute => true
     case _: Literal => true
-    case _: NoSideEffect => e.children.forall(hasNoSideEffect)
+    case _: NoThrow => e.children.forall(cannotThrowException)

Review comment:
       Since the naming is clear now, I'd suggest we add `if e.determinisitc` 
here, since `NoThrow` doesn't indicate that it's deterministic.




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

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