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

Takeshi Yamamuro updated SPARK-28028:
-------------------------------------
    Parent Issue: SPARK-30375  (was: SPARK-27764)

> Cast numeric to integral type need round
> ----------------------------------------
>
>                 Key: SPARK-28028
>                 URL: https://issues.apache.org/jira/browse/SPARK-28028
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> For example
>  Case 1:
> {code:sql}
> select cast(-1.5 as smallint);
> {code}
> Spark SQL returns {{-1}}, but PostgreSQL returns {{-2}}.
>  
> Case 2:
> {code:sql}
> SELECT smallint(float('32767.6'))
> {code}
> Spark SQL returns {{32767}}, but PostgreSQL throws {{ERROR: smallint out of 
> range}}.



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