-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21016][core]Improve code fault tolerance for converting string to number #18238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
If a string has a leading or trailing space, it's expected it cannot be converted to a number. |
|
But it can be converted to double. |
|
It would be good to do the same thing for |
|
I think it will be more persuasive if there are some cases where users mistakenly write wrong values for both numbers and booleans. Personally, I haven't got any errors about this before (more than two years in production / development). |
|
@HyukjinKwon I agree with you ,but i think if add |
|
Although it is not a common user error, it does not hurt to add an extra |
|
ok to test |
|
Test build #77917 has started for PR 18238 at commit |
|
Test build #77921 has finished for PR 18238 at commit
|
|
I'm neutral. Accepting bad input isn't usually a great idea, though in this case, I can't see much harm. It's not ambiguous. |
|
Test build #77930 has finished for PR 18238 at commit
|
|
retest this please |
|
Test build #77944 has finished for PR 18238 at commit
|
|
Test build #77966 has started for PR 18238 at commit |
|
Jenkins, retest this please |
|
Test build #77982 has finished for PR 18238 at commit
|
|
Thanks! Merging to master. |
…g to number ## What changes were proposed in this pull request? When converting `string` to `number`(int, long or double), if the string has a space before or after,will lead to unnecessary mistakes. ## How was this patch tested? unit test Author: liuxian <liu.xian3@zte.com.cn> Closes apache#18238 from 10110346/lx-wip-0608.
What changes were proposed in this pull request?
When converting
stringtonumber(int, long or double), if the string has a space before or after,will lead to unnecessary mistakes.How was this patch tested?
unit test