Skip to content

Commit 1bd1825

Browse files
committed
Fix Indentation and make the modification clearer.
1 parent cf1a997 commit 1bd1825

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,13 @@ trait HiveTypeCoercion {
461461
case e if !e.childrenResolved => e
462462

463463
case g @ GetItem(c, o @ IntegralType()) if o.dataType != IntegerType =>
464-
GetItem(c, Cast(o, IntegerType))
464+
GetItem(c, Cast(o, IntegerType))
465465

466466
case s @ Substring(r, p @ IntegralType(), l @ IntegralType()) =>
467-
var new_p = p
468-
var new_l = l
469-
if (p.dataType != IntegerType) {
470-
new_p = Cast(p, IntegerType)
471-
}
472-
if (l.dataType != IntegerType) {
473-
new_l = Cast(l, IntegerType)
474-
}
475-
Substring(r, new_p, new_l)
467+
Substring(r,
468+
{ if (p.dataType != IntegerType) Cast(p, IntegerType) else p },
469+
{ if (l.dataType != IntegerType) Cast(l, IntegerType) else l }
470+
)
476471

477472
case a @ CreateArray(children) if !a.resolved =>
478473
val commonType = a.childTypes.reduce(

0 commit comments

Comments
 (0)