-
Notifications
You must be signed in to change notification settings - Fork 232
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 GPU version of ToPrettyString [databricks] #9221
Add GPU version of ToPrettyString [databricks] #9221
Conversation
Signed-off-by: Raza Jafri <rjafri@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.
I did a quick pass through much of the code and it feels like there is a lot of refactoring that I have a hard time seeing any value with. I understand ToStringBase so you can override how some functions are implemented, but everything else feels unnecessary.
sql-plugin/src/main/spark350/scala/com/nvidia/spark/rapids/shims/SparkShims.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/ToStringBase.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/GpuJsonToStructs.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/spark350/scala/com/nvidia/spark/rapids/shims/GpuToPrettyString.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/spark350/scala/com/nvidia/spark/rapids/shims/GpuToPrettyString.scala
Outdated
Show resolved
Hide resolved
tests/src/test/spark350/scala/com/nvidia/spark/rapids/ToPrettyStringSuite.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
@revans2 and @andygrove thank you for reviewing. I have addressed all of your comments I think. PTAL |
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuCast.scala
Outdated
Show resolved
Hide resolved
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.
The only non-nit I have left is what Andy showed about ANSI mode for cast.
val cast = meta.wrapped.asInstanceOf[UnaryExpression] | ||
val from = cast.child.dataType | ||
val to = StringType | ||
if (!gpuCanCast(from, to)) { |
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.
I don't think this is going to show up in the generated docs, even if we tried to build them with 3.5.0. We should at least have a follow on issue to figure that out.
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.
Wondering if there is a valid need to print ToPrettyString
as part of the supported_ops
. It is a sub set of what GpuCast
can do.
Signed-off-by: Raza Jafri <rjafri@nvidia.com>
…P-9171-toprettystring
…P-9171-toprettystring
@andygrove @revans2 PTAL. |
build |
tests/src/test/spark350/scala/com/nvidia/spark/rapids/ToPrettyStringSuite.scala
Outdated
Show resolved
Hide resolved
@revans2 @andygrove I have addressed your concerns. PTAL I have also converted this to draft until rapidsai/cudf#14205 is merged |
@@ -25,6 +25,7 @@ import org.scalatest.funsuite.AnyFunSuite | |||
import org.apache.spark.sql.Row |
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.
I had to make changes to this file because of the way InternalRow accesses Arrays, Maps and Structs when using BoundReference
@mimaomao @kevnzhao fyi, this PR is ready to go, but we are just waiting on rapidsai/cudf#14205 to be merged before we merge this one. |
build |
This PR adds a
GpuToPrettyString
so we don't fall back to the CPU whenshow()
is called in REPL.The PR was manually tested and unit tests were added
fixes #9065
fixes #9171
fixes #9220