Skip to content
Closed
Prev Previous commit
Next Next commit
Add examples for null as an argument
  • Loading branch information
HyukjinKwon committed Nov 4, 2016
commit a523302f7b5f70611f0ae15435e19ada2d88ec8d
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class RDG extends UnaryExpression with ExpectsInputTypes with Nondeterm
case Literal(s, IntegerType) => s.asInstanceOf[Int]
case Literal(s, LongType) => s.asInstanceOf[Long]
case _ => throw new AnalysisException(
s"Input argument to $prettyName must be an integer/long/NULL literal.")
s"Input argument to $prettyName must be an integer, long or null literal.")
}

override def nullable: Boolean = false
Expand All @@ -66,6 +66,8 @@ abstract class RDG extends UnaryExpression with ExpectsInputTypes with Nondeterm
0.9629742951434543
> SELECT _FUNC_(0);
0.8446490682263027
> SELECT _FUNC_(null);
0.8446490682263027
""")
// scalastyle:on line.size.limit
case class Rand(child: Expression) extends RDG {
Expand Down Expand Up @@ -99,6 +101,8 @@ object Rand {
-0.3254147983080288
> SELECT _FUNC_(0);
1.1164209726833079
> SELECT _FUNC_(null);
1.1164209726833079
""")
// scalastyle:on line.size.limit
case class Randn(child: Expression) extends RDG {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,6 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
}
}

<<<<<<< 5213bd60f4be0795e23362f555dcdcf1a1d060cd
private def verifyNullabilityInFilterExec(
df: DataFrame,
expr: String,
Expand Down