[ 
https://issues.apache.org/jira/browse/SPARK-44943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17758462#comment-17758462
 ] 

ASF GitHub Bot commented on SPARK-44943:
----------------------------------------

User 'gerashegalov' has created a pull request for this issue:
https://github.com/apache/spark/pull/42652

> CONV produces incorrect result near Long.MIN_VALUE, fails to detect overflow
> ----------------------------------------------------------------------------
>
>                 Key: SPARK-44943
>                 URL: https://issues.apache.org/jira/browse/SPARK-44943
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.4.1, 3.5.0, 4.0.0
>            Reporter: Gera Shegalov
>            Priority: Major
>
> Signed conversion does not detect overflow 
> {code:java}
> >>> spark.conf.set('spark.sql.ansi.enabled', True)
> >>> sql("SELECT conv('-9223372036854775809', 10, -10)").show(truncate=False)
> +-----------------------------------+
> |conv(-9223372036854775809, 10, -10)|
> +-----------------------------------+
> |-9223372036854775807               |
> +-----------------------------------+
> {code}
> Unsigned conversion produces -1 but does not throw in the ANSI mode
> {code}
> >>> sql("SELECT conv('-9223372036854775809', 10, 10)").show(truncate=False)
> +----------------------------------+
> |conv(-9223372036854775809, 10, 10)|
> +----------------------------------+
> |18446744073709551615              |
> +----------------------------------+
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to