cloud-fan commented on a change in pull request #29798:
URL: https://github.com/apache/spark/pull/29798#discussion_r491801731
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
##########
@@ -318,7 +321,6 @@ trait Unevaluable extends Expression {
*/
trait RuntimeReplaceable extends UnaryExpression with Unevaluable {
override def nullable: Boolean = child.nullable
- override def foldable: Boolean = child.foldable
Review comment:
This change is noop in practice, because we replace `RuntimeReplaceable`
at the beginning of the optimizer, so foldable or not doesn't really matter.
Semantically, it might be clearer to just make `RuntimeReplaceable` a pure
delegator like `Alias`, but it complicates the expression tree. Anyway, this is
out of the scope of this PR.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -327,7 +327,6 @@ case class InSubquery(values: Seq[Expression], query:
ListQuery)
override def children: Seq[Expression] = values :+ query
override def nullable: Boolean = children.exists(_.nullable)
- override def foldable: Boolean = children.forall(_.foldable)
Review comment:
seems there was no specific reason:
https://github.com/apache/spark/pull/21403 . We just followed `In` at that time.
It's obviously not foldable as it needs to evaluate a subquery.
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
##########
@@ -365,14 +360,6 @@ abstract class OffsetWindowFunction
override def children: Seq[Expression] = Seq(input, offset, default)
- /*
Review comment:
+1
----------------------------------------------------------------
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]