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

[Spark 4.0] Address test failures in cast_test.py [databricks] #11559

Merged
merged 14 commits into from
Oct 9, 2024

Conversation

mythrocks
Copy link
Collaborator

@mythrocks mythrocks commented Oct 2, 2024

Fixes #11009 and #11530.

This commit addresses the test failures in cast_test.py, on Spark 4.0.
These generally have to do with changes in behaviour of Spark when
ANSI mode is enabled. In these cases, the tests have been split out into ANSI=on and ANSI=off.

The bugs uncovered from the tests have been spun into their own issues; fixing all of them was beyond the scope of this change.

Fixes NVIDIA#11009.

This commit addresses the test failures in cast_test.py, on Spark 4.0.
These generally have to do with changes in behaviour of Spark when
ANSI mode is enabled.

This commit specifically addresses `test_cast_date_integral_and_fp`,
`test_cast_decimal_to`, and `test_cast_decimal_to_decimal`.
@mythrocks mythrocks self-assigned this Oct 2, 2024
Signed-off-by: MithunR <mithunr@nvidia.com>
@mythrocks mythrocks changed the title [Spark 4.0] Address test failures in cast_test.py [Spark 4.0] Address test failures in cast_test.py [databricks] Oct 7, 2024
@mythrocks
Copy link
Collaborator Author

Build

@mythrocks
Copy link
Collaborator Author

Build

@mythrocks
Copy link
Collaborator Author

Build

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

LGTM

"""
This tests that STRING->DATE conversion is run on CPU, via a fallback.
The point of this test is to exercise the fallback, and not to examine any errors in casting.
There is no change in behaviour between Apache Spark and the plugin, since they're both
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpicking but what if the fallback does not happen in the ANSI-enabled mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once the plugin adds support for string->date casting, we will have to modify this test. At a minimum, there won't be a fallback. I don't foresee a case where we might support ANSI=on and not ANSI=off, but that's hard to predict.

I'd postpone any further futzing with this until the plugin's behaviour changes.

@mythrocks mythrocks merged commit e8b78c0 into NVIDIA:branch-24.12 Oct 9, 2024
44 of 45 checks passed
@mythrocks
Copy link
Collaborator Author

I've merged this change. Thank you for the review, @gerashegalov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix tests failures in cast_test.py
2 participants