dtenedor opened a new pull request, #36861:
URL: https://github.com/apache/spark/pull/36861
### What changes were proposed in this pull request?
Update `to_number` and `try_to_number` functions to allow the `PR` format
token with input strings comprising positive numbers.
Before this bug fix, function calls like `to_number(' 123 ', '999PR')` would
fail. Now they succeed, which is helpful since `PR` should allow both positive
and negative numbers.
This satisfies the following specification:
```
to_number(expr, fmt)
fmt
{ ' [ MI | S ] [ L | $ ]
[ 0 | 9 | G | , ] [...]
[ . | D ]
[ 0 | 9 ] [...]
[ L | $ ] [ PR | MI | S ] ' }
```
### Why are the changes needed?
After reviewing the specification, this behavior makes the most sense.
### Does this PR introduce _any_ user-facing change?
Yes, a slight change in the behavior of the format string.
### How was this patch tested?
Existing and updated unit test coverage.
--
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]