You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/02 11:45:28 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #30570: [SPARK-33544][SQL][FOLLOW-UP] Rename NoSideEffect to NoThrow and clarify the documentation more

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org