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

Wenchen Fan commented on SPARK-33428:
-------------------------------------

AFAIK this function is from MySQL and it's better to follow the MySQL behavior. 
MySQL returns the max unsigned long if the input string is too big, and Spark 
should follow it.

However, seems Spark has different behavior in two cases:
 # MySQL allows leading spaces but Spark does not.
 # If the input string is way too long, Spark fails with 
ArrayIndexOutOfBoundException

[~angerszhu] would you like to look into it?

> conv UDF returns incorrect value
> --------------------------------
>
>                 Key: SPARK-33428
>                 URL: https://issues.apache.org/jira/browse/SPARK-33428
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> How to reproduce this issue:
> {noformat}
> spark-sql> select java_method('scala.math.BigInt', 'apply', 
> 'c8dcdfb41711fc9a1f17928001d7fd61', 16);
> 266992441711411603393340504520074460513
> spark-sql> select conv('c8dcdfb41711fc9a1f17928001d7fd61', 16, 10);
> 18446744073709551615
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to