NarekDW opened a new pull request, #40040:
URL: https://github.com/apache/spark/pull/40040
### What changes were proposed in this pull request?
This PR proposes to use `BigInt` instead of `Long` datatype for conversion
of numbers between different radixes, because of this we will get rid of
overflows.
This change allows to convert big numbers, like:
```
spark-sql> SELECT
CONV(SUBSTRING('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
3), 16, 10);
```
will give correct result:
`115792089237316195423570985008687907853269984665640564039457584007913129639935`
### Why are the changes needed?
Changes allow to convert big numbers among different radixes.
### Does this PR introduce _any_ user-facing change?
1. Users could convert big values by using `conv` function, without an
overflow.
2. Invalid number formats are not supported in `conv` function already.
### How was this patch tested?
By existing tests + an additional test cases were added to:
`sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathExpressionsSuite.scala`
`sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/NumberConverterSuite.scala`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]