Skip to content

Commit d38492f

Browse files
committed
Now sqrt accepts boolean because type casting is handled by HiveTypeCoercion.
1 parent 297cc90 commit d38492f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionTypeCheckingSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ExpressionTypeCheckingSuite extends SparkFunSuite {
5555
test("check types for unary arithmetic") {
5656
assertError(UnaryMinus('stringField), "operator - accepts numeric type")
5757
assertSuccess(Sqrt('stringField)) // We will cast String to Double for sqrt
58-
assertError(Sqrt('booleanField), "function sqrt accepts numeric type")
58+
assertSuccess(Sqrt('booleanField)) // We will cast Boolean to Double for sqrt
5959
assertError(Abs('stringField), "function abs accepts numeric type")
6060
assertError(BitwiseNot('stringField), "operator ~ accepts integral type")
6161
}

0 commit comments

Comments
 (0)