-
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
Support non-UTC timezone for casting from date type to timestamp type [databricks] #11462
Conversation
Signed-off-by: Chong Gao <[email protected]>
build |
non-DST timezonepassed:
For DST timezone:Report not supporting prompt:
|
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.
Looks good to me but a NIT.
|
||
@pytest.mark.parametrize('parser_policy', ["LEGACY", "CORRECTED", "EXCEPTION"], ids=idfn) | ||
def test_date_to_timestamp(parser_policy): | ||
parser_policy_dic = {"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy)} |
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.
NIT
parser_policy_dic = {"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy)} | |
all_confs = { | |
"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy), | |
"spark.rapids.sql.incompatibleDateFormats.enabled": True} |
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
build |
premerge failed |
"SELECT cast(a as timestamp) from tab", | ||
conf = { | ||
"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy), | ||
"spark.rapids.sql.incompatibleDateFormats.enabled": True}) |
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.
Seems we only need spark.rapids.sql.incompatibleDateFormats.enabled
being true for LEGACY
policy?
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.
Yes.
build |
@@ -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) |
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?
@pytest.mark.parametrize('parser_policy', ["LEGACY", "CORRECTED", "EXCEPTION"], ids=idfn) | |
@pytest.mark.parametrize('parser_policy', ['LEGACY', 'CORRECTED', 'EXCEPTION'], ids=idfn) |
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
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
format redundant?
"spark.sql.legacy.timeParserPolicy": "{}".format(parser_policy), | |
"spark.sql.legacy.timeParserPolicy": parser_policy, |
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.
Spark 400 building failure is related to #11479 |
build |
build |
b49390f
build |
closes #11461
Only support non-DST(daylight saving time) time zones.
Signed-off-by: Chong Gao [email protected]