Skip to content
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

Add config for cast float to integral types #1413

Merged
merged 7 commits into from
Dec 17, 2020

Conversation

andygrove
Copy link
Contributor

@andygrove andygrove commented Dec 16, 2020

Signed-off-by: Andy Grove andygrove@nvidia.com

As of Spark 3.1.0, we are no longer 100% compatible when casting floating point types to integral types due to changes in Spark. See docs in PR for more info.

Closes #1271

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

@andygrove andygrove self-assigned this Dec 16, 2020
@andygrove andygrove added this to the Dec 7 - Dec 18 milestone Dec 16, 2020
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

@revans2
Copy link
Collaborator

revans2 commented Dec 17, 2020

I am rather confused by this. The issue is only relevant for Spark 3.1+ and also appears to only show up for ANSI cast, not the regular cast.

If that is true can we make the config check only happen on Spark 3.1+ AnsiCast? I already moved AnsiCast to the shim layer for a similar issue so we should be able to subclass the meta to do this.

Also it would be great to document what we do support instead of just what Spark supports. That way an end user can know if it is OK to turn it on or not.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

Thanks @revans2 I have partially addressed this but have some questions. I moved the checks to the 310 shim but I did this by overriding CastExprMeta in place. Would it be better to extend the CastChecks instead?

Also, in this case it would be nice to be able to have the default setting differ depending on the Spark version being used but I don't think we have a mechanism for doing this. Do you think we should consider adding this?

@@ -286,7 +299,7 @@ The following formats/patterns are supported on the GPU. Timezone of UTC is assu
| `"tomorrow"` | Yes |
| `"yesterday"` | Yes |

## String to Timestamp
### String to Timestamp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated but I thought it was worth fixing while I was here.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@revans2
Copy link
Collaborator

revans2 commented Dec 17, 2020

Thanks @revans2 I have partially addressed this but have some questions. I moved the checks to the 310 shim but I did this by overriding CastExprMeta in place. Would it be better to extend the CastChecks instead?

Also, in this case it would be nice to be able to have the default setting differ depending on the Spark version being used but I don't think we have a mechanism for doing this. Do you think we should consider adding this?

I like the way this has been done. No need to change CastChecks.

I have not thought about configs that are dependent on the version of Spark being used at all. If we think we are going to run into more compatibility issues as time goes on that we cannot work around then it might be interesting to explore it, but for now I don't see a lot of value in it, assuming that we have explained clearly that a given config is only used if the version is ....

…later

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

@andygrove andygrove changed the title [WIP] Add config for cast float to integral types Add config for cast float to integral types Dec 17, 2020
@andygrove andygrove merged commit b6480e2 into NVIDIA:branch-0.4 Dec 17, 2020
@andygrove andygrove deleted the config-cast-float-to-int branch December 17, 2020 18:56
@sameerz sameerz added feature request New feature or request task Work required that improves the product but is not user facing and removed feature request New feature or request labels Jan 6, 2021
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
* add config for cast float to int

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* enable castFloatToIntegralTypes in nightly qa tests

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Move checks to 310 shim

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Improve docs

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* docs update

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* further clarification in the docs that this only apples to 3.1.0 and later

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Move Cast override to spark 300 shim for consistency

Signed-off-by: Andy Grove <andygrove@nvidia.com>
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
* add config for cast float to int

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* enable castFloatToIntegralTypes in nightly qa tests

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Move checks to 310 shim

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Improve docs

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* docs update

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* further clarification in the docs that this only apples to 3.1.0 and later

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Move Cast override to spark 300 shim for consistency

Signed-off-by: Andy Grove <andygrove@nvidia.com>
tgravescs pushed a commit to tgravescs/spark-rapids that referenced this pull request Nov 30, 2023
…IDIA#1413)

Signed-off-by: spark-rapids automation <70000568+nvauto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] CastOpSuite and AnsiCastOpSuite failing with ArithmeticException on Spark 3.1
3 participants