Skip to content

Commit e9834b4

Browse files
committed
Remove byte and short types for number literal.
1 parent 1bd1825 commit e9834b4

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ class SqlParser extends AbstractSparkSQLParser {
343343
val bigIntValue = BigDecimal(value)
344344

345345
bigIntValue match {
346-
case v if bigIntValue.isValidByte => v.toByteExact
347-
case v if bigIntValue.isValidShort => v.toShortExact
348346
case v if bigIntValue.isValidInt => v.toIntExact
349347
case v if bigIntValue.isValidLong => v.toLongExact
350348
case v => v

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,6 @@ trait HiveTypeCoercion {
460460
// Skip nodes who's children have not been resolved yet.
461461
case e if !e.childrenResolved => e
462462

463-
case g @ GetItem(c, o @ IntegralType()) if o.dataType != IntegerType =>
464-
GetItem(c, Cast(o, IntegerType))
465-
466-
case s @ Substring(r, p @ IntegralType(), l @ IntegralType()) =>
467-
Substring(r,
468-
{ if (p.dataType != IntegerType) Cast(p, IntegerType) else p },
469-
{ if (l.dataType != IntegerType) Cast(l, IntegerType) else l }
470-
)
471-
472463
case a @ CreateArray(children) if !a.resolved =>
473464
val commonType = a.childTypes.reduce(
474465
(a,b) =>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ object Literal {
4747
object IntegerLiteral {
4848
def unapply(a: Any): Option[Int] = a match {
4949
case Literal(a: Int, IntegerType) => Some(a)
50-
case Literal(a: Byte, ByteType) => Some(a.toInt)
51-
case Literal(a: Short, ShortType) => Some(a.toInt)
5250
case _ => None
5351
}
5452
}

0 commit comments

Comments
 (0)