-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix cast_string_to_float with trailing whitespaces for inf and nan string #2063
Conversation
Signed-off-by: fejiang <fejiang@nvidia.com>
…ni into branch-24.06
tb2.column("INFINITY ", "inf", "+inf ", " -INF "); | ||
|
||
Table.TestBuilder tb = new Table.TestBuilder(); | ||
tb.column(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test double type too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some negative tests would be nice. Some strings like INFINITY AND BEYOND
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INFINITY AND BEYOND
added.
with aother one test string INF
.
More test cases suggestions are appreciated.
Signed-off-by: fejiang <fejiang@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you for doing this work!
tb2.column("INFINITY ", "inf", "+inf ", " -INF "); | ||
|
||
Table.TestBuilder tb = new Table.TestBuilder(); | ||
tb.column(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some negative tests would be nice. Some strings like INFINITY AND BEYOND
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo fix, but I'm happy with this. Thanks for your work here!
Thank you for reviewing, appreciate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
build |
26f2a75
build |
1 similar comment
build |
Fix the issue listed in #10794.
In RapidsCastSuit of Spark UT, "Process Infinity, -Infinity, NaN in case insensitive manner" case would fail, the reason is that in jni's
cast_to_float.cu
, the functions for checking inf and nan were considering "inf"("infinity") and "nan" strings with additional characters as illegal. I added the logic for checking if the additional characters are whitespaces.