Skip to content

Commit

Permalink
use TypeCollection to specify wanted input and implicit cast
Browse files Browse the repository at this point in the history
  • Loading branch information
yjshen committed Jul 14, 2015
1 parent c3b9839 commit d10be4a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,10 @@ case class Round(child: Expression, scale: Expression) extends Expression with E
case t => t
}

override def inputTypes: Seq[AbstractDataType] = Seq(NumericType, IntegralType)
override def inputTypes: Seq[AbstractDataType] = Seq(
//rely on precedence to implicit cast String into Double
TypeCollection(DoubleType, FloatType, LongType, IntegerType, ShortType, ByteType),
TypeCollection(LongType, IntegerType, ShortType, ByteType))

override def checkInputDataTypes(): TypeCheckResult = {
child.dataType match {
Expand Down

0 comments on commit d10be4a

Please sign in to comment.