File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,13 @@ case class SortPrefix(child: SortOrder) extends UnaryExpression {
163163 BinaryPrefixComparator .computePrefix(raw.asInstanceOf [Array [Byte ]])
164164 case dt : DecimalType if dt.precision <= Decimal .MAX_LONG_DIGITS =>
165165 _.asInstanceOf [Decimal ].toUnscaledLong
166- case dt : DecimalType if dt.precision - dt.scale <= Decimal .MAX_LONG_DIGITS => (raw) => {
167- val value = raw.asInstanceOf [Decimal ]
166+ case dt : DecimalType if dt.precision - dt.scale <= Decimal .MAX_LONG_DIGITS =>
168167 val p = Decimal .MAX_LONG_DIGITS
169168 val s = p - (dt.precision - dt.scale)
170- if (value.changePrecision(p, s)) value.toUnscaledLong else Long .MinValue
171- }
169+ (raw) => {
170+ val value = raw.asInstanceOf [Decimal ]
171+ if (value.changePrecision(p, s)) value.toUnscaledLong else Long .MinValue
172+ }
172173 case dt : DecimalType => (raw) =>
173174 DoublePrefixComparator .computePrefix(raw.asInstanceOf [Decimal ].toDouble)
174175 case _ => (Any ) => 0L
You can’t perform that action at this time.
0 commit comments