-
Notifications
You must be signed in to change notification settings - Fork 237
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
Fall back to the CPU for non-zero scale on Ceil or Floor functions [databricks] #4971
Conversation
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
build |
@gerashegalov @jlowe what do you guys think about adding utility classes, like |
I think it depends on what is being shimmed. If there's only one shim that needs the different behavior than the rest, then it can be nice to drop a new class in one of the large footprint directories, like 301until330-all, and cover a lot of shims all at once. If most shims need slightly different behavior then maybe the SparkShims approach makes more sense. There are base classes for SparkShim implementations that make this very similar to the separate class in terms of reuse, so it's more of a judgement call than a clear recommendation, IMO, unless we want to eventually eliminate SparkShims completely over time and only use purpose-built shim classes. |
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
build |
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.
Just some nits and a question. Looks good.
.../src/main/301until330-all/scala/org/apache/spark/sql/rapids/shims/RapidsFloorCeilUtils.scala
Outdated
Show resolved
Hide resolved
.../src/main/301until330-all/scala/org/apache/spark/sql/rapids/shims/RapidsFloorCeilUtils.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
build |
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
build |
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
Upmerged and updated code as 301 shim was removed recently. |
build |
CI failed due to databricks test failure. Fix is in #4998. Thanks @razajafri. Will upmerge once that PR is merged. |
build |
This fixes #4913.
Apache Spark has added scale parameter for Ceil/Floor functions in Spark-3.3 #4910. When ceil/floor functions are called with scale parameter, the physical plan changes compared to earlier. It adds
RoundCeil
/RoundFloor
and the result type is decimal type.In this PR, we have added support to RoundCeil and RoundFloor if the scale is
0
. i.e we call GpuCeil if ceil is called with scale 0. For scale values other than0
, we fallback to CPU.