cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868770083
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -43,6 +44,9 @@ import org.apache.spark.unsafe.types.UTF8String
* equivalent [[Literal]] values.
*/
object ConstantFolding extends Rule[LogicalPlan] {
+ // This tag is for avoid repeatedly evaluating expression inside conditional
expression
+ // which has already failed to evaluate before.
+ private val FAILED_TO_EVALUATE = TreeNodeTag[Boolean]("FAILED_TO_EVALUATE")
Review Comment:
```suggestion
private val FAILED_TO_EVALUATE = TreeNodeTag[Unit]("FAILED_TO_EVALUATE")
```
We only need to check if the tag exists or not, no need to read its value.
--
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]