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

TimeAdd supports DayTimeIntervalType #3507

Merged
merged 3 commits into from
Sep 17, 2021
Merged

Conversation

wbo4958
Copy link
Collaborator

@wbo4958 wbo4958 commented Sep 16, 2021

This PR is to fix #3502 by adding DayTimeIntervalType support for TimeAdd.

Tested date_time_test.py against spark 3.2.0, and pass

BTW, This RP didn't add DayTimeIntervalType support for TimeSub since it has been deleted from Spark 3.1

Signed-off-by: Bobby Wang <wbo4958@gmail.com>
@wbo4958
Copy link
Collaborator Author

wbo4958 commented Sep 16, 2021

build

revans2
revans2 previously approved these changes Sep 16, 2021
case class GpuTimeAdd(start: Expression,
interval: Expression,
timeZoneId: Option[String] = None)
extends GpuTimeMath(start, interval, timeZoneId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: It is a little odd to use GpuTimeMath here when we override essentially all of it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@sameerz sameerz added this to the Sep 13 - Sep 24 milestone Sep 16, 2021
@wbo4958
Copy link
Collaborator Author

wbo4958 commented Sep 16, 2021

build

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this file has . in the name of it change to directories

Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Just a few nits, but looks good enough to merge either way.

override def left: Expression = start
override def right: Expression = interval

override def toString: String = s"$left - $right"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: This is probably a bug in GpuTimeAdd for the older code too, but this should be a + not a -. This goes for sql too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thx @revans2 , I'd like to merge this PR first, and file a following PR for this, since this PR is blocking my following Range window PR.

@wbo4958 wbo4958 merged commit 1e519f2 into NVIDIA:branch-21.10 Sep 17, 2021
@wbo4958 wbo4958 deleted the timeadd branch September 17, 2021 22:15
@tgravescs
Copy link
Collaborator

tgravescs commented Sep 17, 2021

@wbo4958 my comment wa snot addressed, please put up PR to fix file name

main/301until320-all/scala/org/apache/spark/sql/rapids.shims.v2/datetimeExpressions.scala

@wbo4958
Copy link
Collaborator Author

wbo4958 commented Sep 17, 2021

@wbo4958 my comment wa snot addressed, please put up PR to fix file name

main/301until320-all/scala/org/apache/spark/sql/rapids.shims.v2/datetimeExpressions.scala

Thx Tom, My bad. really sorry for that. I just had a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Spark 3.2.0 TimeAdd/TimeSub fail due to new DayTimeIntervalType
4 participants