Chetan Bhat created SPARK-35632:
-----------------------------------

             Summary: SELECT rand(cast(3 / 7 AS int)) value gives different 
resultset in Spark 3.1 as compared to Spark 2.4.5
                 Key: SPARK-35632
                 URL: https://issues.apache.org/jira/browse/SPARK-35632
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.1.1
         Environment: Spark 3.1.1
            Reporter: Chetan Bhat


Issue - SELECT rand(cast(3 / 7 AS int)) value gives different resultset in 
Spark 3.1 as compared to Spark 2.4.5

Queries are executed in Spark beeline.

 

Output in Spark 3.1 
0: jdbc:hive2://10.20.253.239:23040/default> SELECT rand(cast(3 / 7 AS int));
+----------------------------------------------------+
| rand(CAST((CAST(3 AS DOUBLE) / CAST(7 AS DOUBLE)) AS INT)) |
+----------------------------------------------------+
| 0.7604953758285915 |
+----------------------------------------------------+
1 row selected (0.042 seconds)


Output in  Spark 2.4.5
0: jdbc:hive2://linux-63:22550/> SELECT rand(cast(3 / 7 AS int));
+-------------------------------------------------------------+
| rand(CAST((CAST(3 AS DOUBLE) / CAST(7 AS DOUBLE)) AS INT)) |
+-------------------------------------------------------------+
| 0.8446490682263027 |
+-------------------------------------------------------------+
1 row selected (6.358 seconds)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to