-
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
Support to_utc_timestamp [databricks] #10144
Conversation
Signed-off-by: Haoyang Li <[email protected]>
Signed-off-by: Haoyang Li <[email protected]>
Signed-off-by: Haoyang Li <[email protected]>
Signed-off-by: Haoyang Li <[email protected]>
Signed-off-by: Haoyang Li <[email protected]>
|
||
@pytest.mark.parametrize('time_zone', ["Asia/Shanghai", "UTC", "UTC+0", "UTC-0", "GMT", "GMT+0", "GMT-0"], ids=idfn) | ||
@pytest.mark.parametrize('data_gen', [timestamp_gen], ids=idfn) | ||
@tz_sensitive_test |
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.
In my understanding it's not a tz_sensitive_test case because it will only run on gpu under utc timezone and fallback for all other timezones. We can add the timezones we want to test to the supported_timezones
list.
@allow_non_gpu(*non_utc_allow) | ||
def test_from_utc_timestamp_supported_timezones(data_gen, time_zone): |
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.
This case looks duplicated with test_from_utc_timestamp
so I combined them.
|
||
private[this] var timezoneId: ZoneId = null | ||
|
||
override def tagExprForGpu(): Unit = { |
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.
It looks like ToUTCTimestampExprMeta
has basically the same logic for whether it will run on the GPU as FromUTCTimestampExprMeta
. I think these 2 classes should be refactored to share this logic
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.
Done.
LGTM |
build |
Signed-off-by: Haoyang Li <[email protected]>
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.
LGTM
Closes #10145
This PR supports
to_utc_timestamp
and refactors some test cases fromfrom_utc_timestamp
.It's a simple wrap for kernel
fromTimestampToUtcTimestamp
, I implemented it to test some overlap and gap issues in TimeAdd. (It turns out thatto_utc_timestamp
has a slightly different way of handling overlap and gap thanTimeAdd
, I'll describe it in the TimeAdd PR later).Perf tests: