Skip to content

Commit

Permalink
Fix Indentation and make the modification clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Nov 18, 2014
1 parent cf1a997 commit 1bd1825
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,18 +461,13 @@ trait HiveTypeCoercion {
case e if !e.childrenResolved => e

case g @ GetItem(c, o @ IntegralType()) if o.dataType != IntegerType =>
GetItem(c, Cast(o, IntegerType))
GetItem(c, Cast(o, IntegerType))

case s @ Substring(r, p @ IntegralType(), l @ IntegralType()) =>
var new_p = p
var new_l = l
if (p.dataType != IntegerType) {
new_p = Cast(p, IntegerType)
}
if (l.dataType != IntegerType) {
new_l = Cast(l, IntegerType)
}
Substring(r, new_p, new_l)
Substring(r,
{ if (p.dataType != IntegerType) Cast(p, IntegerType) else p },
{ if (l.dataType != IntegerType) Cast(l, IntegerType) else l }
)

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

0 comments on commit 1bd1825

Please sign in to comment.