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

Add test cases for casting string to date in ANSI mode #5459

Merged
merged 2 commits into from
May 13, 2022

Conversation

res-life
Copy link
Collaborator

Closes #1557

Add test cases for casting string to date in ANSI mode
Already supported in #3396, this PR just adds test cases

Signed-off-by: Chong Gao res_life@163.com

Signed-off-by: Chong Gao <res_life@163.com>
@res-life
Copy link
Collaborator Author

build

@jlowe jlowe added the test Only impacts tests label May 11, 2022
@@ -65,6 +65,22 @@ def test_cast_string_date_valid_format():
lambda spark : unary_op_df(spark, StringGen('[0-9]{1,4}-[0-9]{1,2}-[0-9]{1,2}')).select(f.col('a').cast(DateType())),
conf = {'spark.rapids.sql.hasExtendedYearValues': 'false'})

@pytest.mark.skipif(is_before_spark_320(), reason="ansi cast(string as date) throws exception only in 3.2.0+")
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a test to verify we're doing the right thing on Spark versions < 3.2.0, i.e.: either producing a matching result or falling back to the CPU?

@res-life
Copy link
Collaborator Author

build

@jlowe
Copy link
Member

jlowe commented May 12, 2022

build

@res-life res-life merged commit 8d125b4 into NVIDIA:branch-22.06 May 13, 2022
@res-life res-life deleted the ansi-cast-string-to-date branch May 13, 2022 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Only impacts tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Enable ANSI mode for CAST string to date
2 participants