File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff 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(
You can’t perform that action at this time.
0 commit comments