Skip to content

Commit

Permalink
Support trunc and date_trunc SQL functions (#11833)
Browse files Browse the repository at this point in the history
* Implement GpuOverride

Signed-off-by: Nghia Truong <[email protected]>

* Implement `GpuTruncDateTime`

Signed-off-by: Nghia Truong <[email protected]>

* Do not fallback

Signed-off-by: Nghia Truong <[email protected]>

* All variant input will be converted to just one

Signed-off-by: Nghia Truong <[email protected]>

* Add generated docs

Signed-off-by: Nghia Truong <[email protected]>

* Add tests

Signed-off-by: Nghia Truong <[email protected]>

* Fix parameter types

Signed-off-by: Nghia Truong <[email protected]>

* Fix test

Signed-off-by: Nghia Truong <[email protected]>

* Change abstract class to trait

Signed-off-by: Nghia Truong <[email protected]>

* Fix expression order and implement `TimeZoneAwareExpression`

Signed-off-by: Nghia Truong <[email protected]>

* Update generated docs

Signed-off-by: Nghia Truong <[email protected]>

* Update generated docs

Signed-off-by: Nghia Truong <[email protected]>

* Add generated docs

Signed-off-by: Nghia Truong <[email protected]>

* Add generated docs

Signed-off-by: Nghia Truong <[email protected]>

* Allow non-utc timezone for timestamp tests

Signed-off-by: Nghia Truong <[email protected]>

* Adopt to JNI changes

Signed-off-by: Nghia Truong <[email protected]>

* Rewrite all classes

Signed-off-by: Nghia Truong <[email protected]>

* Rename variable

Signed-off-by: Nghia Truong <[email protected]>

---------

Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia authored Dec 14, 2024
1 parent ab3111a commit 33d97e8
Show file tree
Hide file tree
Showing 21 changed files with 702 additions and 242 deletions.
2 changes: 2 additions & 0 deletions docs/additional-functionality/advanced_configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ Name | SQL Function(s) | Description | Default Value | Notes
<a name="sql.expression.ToUnixTimestamp"></a>spark.rapids.sql.expression.ToUnixTimestamp|`to_unix_timestamp`|Returns the UNIX timestamp of the given time|true|None|
<a name="sql.expression.TransformKeys"></a>spark.rapids.sql.expression.TransformKeys|`transform_keys`|Transform keys in a map using a transform function|true|None|
<a name="sql.expression.TransformValues"></a>spark.rapids.sql.expression.TransformValues|`transform_values`|Transform values in a map using a transform function|true|None|
<a name="sql.expression.TruncDate"></a>spark.rapids.sql.expression.TruncDate|`trunc`|Truncate the date to the unit specified by the given string format|true|None|
<a name="sql.expression.TruncTimestamp"></a>spark.rapids.sql.expression.TruncTimestamp|`date_trunc`|Truncate the timestamp to the unit specified by the given string format|true|None|
<a name="sql.expression.UnaryMinus"></a>spark.rapids.sql.expression.UnaryMinus|`negative`|Negate a numeric value|true|None|
<a name="sql.expression.UnaryPositive"></a>spark.rapids.sql.expression.UnaryPositive|`positive`|A numeric value with a + in front of it|true|None|
<a name="sql.expression.UnboundedFollowing$"></a>spark.rapids.sql.expression.UnboundedFollowing$| |Special boundary for a window frame, indicating all rows preceding the current row|true|None|
Expand Down
Loading

0 comments on commit 33d97e8

Please sign in to comment.