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

Fix databrick Shim to support Ansi mode when casting from string to date [databricks] #5494

Merged

Conversation

res-life
Copy link
Collaborator

@res-life res-life commented May 16, 2022

Fixes #5482
Fixes #5481

Db312 supports Ansi casting from string to data unlike Spark312
See this comment: #5482 (comment)

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

@res-life
Copy link
Collaborator Author

Deadlock with #5484

Signed-off-by: sperlingxx <lovedreamf@gmail.com>
@res-life
Copy link
Collaborator Author

build

@pxLi pxLi added the bug Something isn't working label May 16, 2022
@res-life
Copy link
Collaborator Author

I cherry-picked #5484 PR to make the pre-merge pass.

@@ -83,15 +83,36 @@ def test_cast_string_date_valid_format():
]
values_string_to_data = invalid_values_string_to_date + valid_values_string_to_date

# test Spark Spark versions < 3.2.0, ANSI mode
@pytest.mark.skipif(not is_before_spark_320(), reason="ansi cast(string as date) throws exception only in 3.2.0+")
# Spark 320+ and db312+ support Ansi mode when casting string to date
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit 312db instead of db312


# test db312+, ANSI mode, valid values
@pytest.mark.skipif(not is_databricks91_or_later(), reason="Spark versions(< 320) not support Ansi mode when casting string to date")
def test_cast_string_date_valid_ansi_dbs():
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, instead of dbs put databricks since here if just looking at the test name dbs might get confused with like database

@res-life
Copy link
Collaborator Author

build

@res-life
Copy link
Collaborator Author

build

@res-life res-life merged commit 80761f8 into NVIDIA:branch-22.06 May 17, 2022
@res-life res-life deleted the db312-cast-string-to-date-ansi-mode branch May 17, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants