You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2021/07/28 16:20:00 UTC

[jira] [Resolved] (SPARK-36229) conv() inconsistently handles invalid strings with > 64 invalid characters

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

Wenchen Fan resolved SPARK-36229.
---------------------------------
    Fix Version/s: 3.2.0
       Resolution: Fixed

Issue resolved by pull request 33459
[https://github.com/apache/spark/pull/33459]

> conv() inconsistently handles invalid strings with > 64 invalid characters
> --------------------------------------------------------------------------
>
>                 Key: SPARK-36229
>                 URL: https://issues.apache.org/jira/browse/SPARK-36229
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Tim Armstrong
>            Assignee: dgd_contributor
>            Priority: Major
>             Fix For: 3.2.0
>
>
> 1/ SPARK-33428 fixed ArrayIndexOutofBoundsException but introduced a new inconsistency in behaviour where the returned value is different above the 64 char threshold.
>  
> {noformat}
> scala> spark.sql("select conv(repeat('?', 64), 10, 16)").show
> +---------------------------+
> |conv(repeat(?, 64), 10, 16)|
> +---------------------------+
> |                          0|
> +---------------------------+
> scala> spark.sql("select conv(repeat('?', 65), 10, 16)").show
> +---------------------------+
> |conv(repeat(?, 65), 10, 16)|
> +---------------------------+
> |           FFFFFFFFFFFFFFFF|
> +---------------------------+
> scala> spark.sql("select conv(repeat('?', 65), 10, -16)").show
> +----------------------------+
> |conv(repeat(?, 65), 10, -16)|
> +----------------------------+
> |                          -1|
> +----------------------------+
> scala> spark.sql("select conv(repeat('?', 64), 10, -16)").show
> +----------------------------+
> |conv(repeat(?, 64), 10, -16)|
> +----------------------------+
> |                           0|
> +----------------------------+{noformat}
>  
> 2/ conv should return result equal to max unsigned long value in base toBase when there is overflow
> {code:java}
> scala> spark.sql(select conv('aaaaaaa0aaaaaaa0a', 16, 10)).show 
> // which should be 18446744073709551615
> +-------------------------------+
> |conv(aaaaaaa0aaaaaaa0a, 16, 10)|
> +-------------------------------+
> |           12297828695278266890|
> +-------------------------------+
> {code}



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