Skip to content

Commit 3135a8b

Browse files
committed
SortOrder should not be foldable.
1 parent 9c589cf commit 3135a8b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SortOrder.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ case object Descending extends SortDirection
3232
*/
3333
case class SortOrder(child: Expression, direction: SortDirection) extends UnaryExpression {
3434

35+
/** Sort order is not foldable because we don't have an eval for it. */
36+
override def foldable: Boolean = false
37+
3538
override def dataType: DataType = child.dataType
3639
override def nullable: Boolean = child.nullable
3740

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,4 @@ case class Explode(child: Expression) extends UnaryExpression with Generator {
127127
else inputMap.map { case (k, v) => InternalRow(k, v) }
128128
}
129129
}
130-
131-
override def toString: String = s"explode($child)"
132130
}

0 commit comments

Comments
 (0)