[ 
https://issues.apache.org/jira/browse/SPARK-33958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhang Jianguo updated SPARK-33958:
----------------------------------
    Description: 
spark version: 2.3.2
{code:java}
create table test_zjg(a double);
insert into test_zjg values(-1.0);
select a*0 from test_zjg
{code}
 After select operation, *{color:#de350b}we will get -0.0 which expected as 
0.0:{color}*

\+------------------------\+

\|(a * CAST(0 AS DOUBLE))\|

\+------------------------\+

\|-0.0                               \|

\+------------------------\+

 

 

  was:
spark version: 2.3.2
{code:java}
create table test_zjg(a double);
insert into test_zjg values(-1.0);
select a*0 from test_zjg
{code}
 After select operation, *{color:#de350b}we will get -0.0 which expected as 
0.0:{color}*

+------------------------+

|(a * CAST(0 AS DOUBLE))|

+------------------------+

|-0.0                               |

+------------------------+

 

 


> 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: 2.3.2, 2.4.5, 3.0.0
>            Reporter: Zhang Jianguo
>            Priority: Minor
>
> spark version: 2.3.2
> {code:java}
> create table test_zjg(a double);
> insert into test_zjg values(-1.0);
> select a*0 from test_zjg
> {code}
>  After select operation, *{color:#de350b}we will get -0.0 which expected as 
> 0.0:{color}*
> \+------------------------\+
> \|(a * CAST(0 AS DOUBLE))\|
> \+------------------------\+
> \|-0.0                               \|
> \+------------------------\+
>  
>  



--
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