@@ -149,21 +149,21 @@ case class SortPrefix(child: SortOrder) extends UnaryExpression {
149149 }
150150
151151 private lazy val calcPrefix : Any => Long = child.child.dataType match {
152- case BooleanType => (raw : Any ) =>
152+ case BooleanType => (raw) =>
153153 if (raw.asInstanceOf [Boolean ]) 1 else 0
154- case _ : IntegralType =>
155- _ .asInstanceOf [java.lang.Number ].longValue()
154+ case _ : IntegralType => (raw) =>
155+ raw .asInstanceOf [java.lang.Number ].longValue()
156156 case DateType | TimestampType =>
157157 _.asInstanceOf [java.lang.Number ].longValue()
158- case FloatType | DoubleType => (raw : Any ) => {
158+ case FloatType | DoubleType => (raw) => {
159159 val dVal = raw.asInstanceOf [java.lang.Number ].doubleValue()
160160 DoublePrefixComparator .computePrefix(dVal)
161161 }
162- case StringType => (raw : Any ) =>
162+ case StringType => (raw) =>
163163 StringPrefixComparator .computePrefix(raw.asInstanceOf [UTF8String ])
164- case BinaryType => (raw : Any ) =>
164+ case BinaryType => (raw) =>
165165 BinaryPrefixComparator .computePrefix(raw.asInstanceOf [Array [Byte ]])
166- case dt : DecimalType if dt.precision - dt.scale <= Decimal .MAX_LONG_DIGITS => (raw : Any ) => {
166+ case dt : DecimalType if dt.precision - dt.scale <= Decimal .MAX_LONG_DIGITS => (raw) => {
167167 val value = raw.asInstanceOf [Decimal ]
168168 if (dt.precision <= Decimal .MAX_LONG_DIGITS ) {
169169 value.toUnscaledLong
@@ -173,9 +173,9 @@ case class SortPrefix(child: SortOrder) extends UnaryExpression {
173173 if (value.changePrecision(p, s)) value.toUnscaledLong else Long .MinValue
174174 }
175175 }
176- case dt : DecimalType => (raw : Any ) =>
176+ case dt : DecimalType => (raw) =>
177177 DoublePrefixComparator .computePrefix(raw.asInstanceOf [Decimal ].toDouble)
178- case dt => (Any ) => 0L
178+ case _ => (Any ) => 0L
179179 }
180180
181181 override def eval (input : InternalRow ): Any = {
0 commit comments