Skip to content

Commit

Permalink
Fix bug where averages of strings are turned into sums of strings. Re…
Browse files Browse the repository at this point in the history
…move a blank line.
  • Loading branch information
marmbrus committed Feb 5, 2014
1 parent b4be6a5 commit ccdb07a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/catalyst/analysis/HiveTypeCoercion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ trait HiveTypeCoercion {
case Sum(e) if e.dataType == StringType =>
Sum(Cast(e, DoubleType))
case Average(e) if e.dataType == StringType =>
Sum(Cast(e, DoubleType))
Average(Cast(e, DoubleType))
}
}

Expand Down Expand Up @@ -252,7 +252,6 @@ trait HiveTypeCoercion {
case s @ Sum(e @ DecimalType()) => s // Decimal is already the biggest.
case Sum(e @ IntegralType()) if e.dataType != LongType => Sum(Cast(e, LongType))
case Sum(e @ FractionalType()) if e.dataType != DoubleType => Sum(Cast(e, DoubleType))

}
}
}

0 comments on commit ccdb07a

Please sign in to comment.