Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.0.0
-
None
-
None
Description
test("SPARK-28620") { withJdbcStatement { statement => val rs = statement.executeQuery( "SELECT CAST('1.2345678901234e+20' AS FLOAT), CAST('4.56' AS FLOAT)") rs.next() assert(rs.getObject(1).isInstanceOf[java.lang.Double]) assert(rs.getObject(2).isInstanceOf[java.lang.Double]) } }
This inconsistent with spark-shell and spark-sql:
0: jdbc:hive2://localhost:10000> SELECT CAST('1.2345678901234e+20' AS FLOAT), CAST('4.56' AS FLOAT); +-------------------------------------+----------------------+ | CAST(1.2345678901234e+20 AS FLOAT) | CAST(4.56 AS FLOAT) | +-------------------------------------+----------------------+ | 1.2345679000000001E20 | 4.56 | +-------------------------------------+----------------------+ 1 row selected (0.268 seconds)
spark-sql> SELECT CAST('1.2345678901234e+20' AS FLOAT), CAST('4.56' AS FLOAT); 1.2345679E20 4.56 scala> spark.sql("SELECT CAST('1.2345678901234e+20' AS FLOAT), CAST('4.56' AS FLOAT)").show +----------------------------------+-------------------+ |CAST(1.2345678901234e+20 AS FLOAT)|CAST(4.56 AS FLOAT)| +----------------------------------+-------------------+ | 1.2345679E20| 4.56| +----------------------------------+-------------------+
Attachments
Issue Links
- is related to
-
SPARK-24829 In Spark Thrift Server, CAST AS FLOAT inconsistent with spark-shell or spark-sql
- Resolved
-
HIVE-11832 HIVE-11802 breaks compilation in JDK 8
- Closed
- relates to
-
SPARK-28527 Build a Test Framework for Thriftserver
- Resolved