-
Notifications
You must be signed in to change notification settings - Fork 242
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
[FEA] Support TruncDate expression #11804
Comments
@kuhushukla So is it only 'MM' ('MONTH') that is needed? https://spark.apache.org/docs/latest/api/sql/index.html#date_trunc supports
DAY and below we should be able to support with existing CUDF operators. Beyond that it is probably best if we write a custom kernel for most of it. We could come up with a way to put together a string representation of the timestamp we need by extracting year, month, day, etc and parsing it back with CUDF, but that feels really wasteful. I would rather just do it in a kernel ourselves based on the same kind of logic. |
Currently I have only encountered month. I can update further in the next couple days, but MM would be a good start for the customer query in question. |
Fun facts:
I'm going to implement both functions, and support most formats for them except |
I changed my plan: will try to support all. This is a binary expression, and |
@ttnghia it is perfectly acceptable for us to only support a scalar In the type checks you can mark a type as spark-rapids/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala Lines 3352 to 3361 in 738c8e3
That makes it so we would fall back for anything that is not a literal value. Then you can use some pattern matching APIs to pull out the value. spark-rapids/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala Lines 582 to 587 in 738c8e3
|
That is fine. I've completed the implementation to support all, as it is fairly simple. |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Customer query shows this fallback, timezone is UTC and GMT
Describe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: