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] Nicer error when failing to read table due to type change not support… #3728

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

johanl-db
Copy link
Collaborator

Description

Delta 3.2/3.3 only supports a limited subset of type changes that will become available with Delta 4.0 / Spark 4.0.
This changes improves the error returned when reading a table with an unsupported type change to tell user to upgrade to Delta 4.0 in case the type change will be supported in that version.

How was this patch tested?

Added tests to cover the error path.

Does this PR introduce any user-facing changes?

Updates error thrown on unsupported type change when reading a table.

// Delta 3.2/3.3 doesn't support changing type from int->long, we manually commit that type
// change to simulate what Delta 4.0 could do.
deltaLog.withNewTransaction { txn =>
txn.commit(
Copy link
Contributor

Choose a reason for hiding this comment

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

Commit a new protocol with TypeWideningPreviewTableFeature supported?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Type widening is enabled automatically by default on all tables created in this test suite:

.set(DeltaConfigs.ENABLE_TYPE_WIDENING.defaultTablePropertyKey, "true")

This adds the preview table feature to the table

Is that what you were pointing out?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup.

Copy link
Contributor

@xupefei xupefei left a comment

Choose a reason for hiding this comment

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

LGTM!

@vkorukanti vkorukanti merged commit 440cc3e into delta-io:master Oct 1, 2024
16 of 19 checks passed
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.

3 participants