Github user wangyum commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18833#discussion_r131566961
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathExpressionsSuite.scala
 ---
    @@ -403,11 +403,13 @@ class MathExpressionsSuite extends SparkFunSuite with 
ExpressionEvalHelper {
     
       test("sqrt") {
         testUnary(Sqrt, math.sqrt, (0 to 20).map(_ * 0.1))
    -    testUnary(Sqrt, math.sqrt, (-5 to -1).map(_ * 1.0), expectNaN = true)
    +    testUnary(Sqrt, math.sqrt, (-5 to -1).map(_ * 1.0), expectNull = true)
    --- End diff --
    
    Users always use `is not null` filter invalid value, but spark sql breaks:
    ```
             > create table spark_21625 as select 10 as c1, sqrt(-10) as c2;
    spark-sql> select * from spark_21625;
    10      NaN                                                                 
    
    spark-sql> select * from spark_21625 where c2 is not null;
    10  NaN
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to