You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Zhang Jianguo (Jira)" <ji...@apache.org> on 2021/01/02 09:06:00 UTC

[jira] [Created] (SPARK-33958) spark sql DoubleType(0 * (-1)) return "-0.0"

Zhang Jianguo created SPARK-33958:
-------------------------------------

             Summary: spark sql DoubleType(0 * (-1))  return "-0.0"
                 Key: SPARK-33958
                 URL: https://issues.apache.org/jira/browse/SPARK-33958
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.0.0, 2.4.5, 2.3.2
            Reporter: Zhang Jianguo


spark version: 2.3.2

 

```sql

create table test_zjg(a double);

insert into test_zjg values(-1.0);

select a*0 from test_zjg

```

 

After select operation, we will get -0.0 which expected as 0.0:

+--------------------------+
| (a * CAST(0 AS DOUBLE)) |
+--------------------------+
| -0.0 |
+--------------------------+

 

 



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

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