-
Notifications
You must be signed in to change notification settings - Fork 234
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 non-UTC timezone for casting from date type to timestamp type [databricks] #11462
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,7 +13,7 @@ | |||||
# limitations under the License. | ||||||
|
||||||
import pytest | ||||||
from asserts import assert_gpu_and_cpu_are_equal_collect, assert_gpu_fallback_collect, assert_gpu_and_cpu_error | ||||||
from asserts import assert_gpu_and_cpu_are_equal_collect, assert_gpu_fallback_collect, assert_gpu_and_cpu_error, assert_gpu_and_cpu_are_equal_sql | ||||||
from conftest import is_utc, is_supported_time_zone, get_test_tz | ||||||
from data_gen import * | ||||||
from datetime import date, datetime, timezone | ||||||
|
@@ -671,3 +671,14 @@ def test_timestamp_millis_long_overflow(): | |||||
def test_timestamp_micros(data_gen): | ||||||
assert_gpu_and_cpu_are_equal_collect( | ||||||
lambda spark : unary_op_df(spark, data_gen).selectExpr("timestamp_micros(a)")) | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize('parser_policy', ["LEGACY", "CORRECTED", "EXCEPTION"], ids=idfn) | ||||||
def test_date_to_timestamp(parser_policy): | ||||||
assert_gpu_and_cpu_are_equal_sql( | ||||||
lambda spark : unary_op_df(spark, date_gen), | ||||||
"tab", | ||||||
"SELECT cast(a as timestamp) from tab", | ||||||
conf = { | ||||||
"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. format redundant?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
"spark.rapids.sql.incompatibleDateFormats.enabled": True}) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems we only need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
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.
Any reason to use different quote marks?
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