[ https://issues.apache.org/jira/browse/SPARK-33958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257347#comment-17257347 ]
Yuming Wang commented on SPARK-33958: ------------------------------------- PostgreSQL also returns -0: {noformat} postgres=# create table test_zjg(a float8); CREATE TABLE postgres=# insert into test_zjg values(-1.0); INSERT 0 1 postgres=# select a*0 from test_zjg; ?column? ---------- -0 (1 row) {noformat} > 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