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

[jira] [Created] (SPARK-35265) abs return negative

liuzhenjie created SPARK-35265:
----------------------------------

             Summary: abs return negative
                 Key: SPARK-35265
                 URL: https://issues.apache.org/jira/browse/SPARK-35265
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.0.1
            Reporter: liuzhenjie


from pyspark.sql.functions import lit, abs, concat, hash,col

df = df.withColumn('partition_id', lit(-2147483648))
df = df.withColumn('abs_id', abs(col('partition_id')))
df.select('abs_id','partition_id').show()

 

when the number is  -2147483648,method abs return negative 

 

 



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