Skip to content

Commit b81419f

Browse files
committed
Collapse function creation for Integral, Date, and Timestamp types
1 parent 2044aed commit b81419f

File tree

1 file changed

+1
-3
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,8 @@ case class SortPrefix(child: SortOrder) extends UnaryExpression {
151151
private lazy val calcPrefix: Any => Long = child.child.dataType match {
152152
case BooleanType => (raw) =>
153153
if (raw.asInstanceOf[Boolean]) 1 else 0
154-
case _: IntegralType => (raw) =>
154+
case DateType | TimestampType | _: IntegralType => (raw) =>
155155
raw.asInstanceOf[java.lang.Number].longValue()
156-
case DateType | TimestampType =>
157-
_.asInstanceOf[java.lang.Number].longValue()
158156
case FloatType | DoubleType => (raw) => {
159157
val dVal = raw.asInstanceOf[java.lang.Number].doubleValue()
160158
DoublePrefixComparator.computePrefix(dVal)

0 commit comments

Comments
 (0)