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] Protocol version downgrade in the presence of table features #2841

Merged

Conversation

andreaschat-db
Copy link
Contributor

@andreaschat-db andreaschat-db commented Apr 3, 2024

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

This PR adds support for protocol versions downgrade when table features exist in the protocol. The downgraded protocol versions should be the minimum required to support all available table features. For example, Protocol(3, 7, DeletionVectors, RowTracking) can be downgraded to Protocol(1, 7, RowTracking) after removing the DV feature.

How was this patch tested?

Added new UTs in DeltaProtocolVersionSuite. Furthermore, existing UTs cover a significant part of the functionality. These these are the following:

  • Downgrade protocol version on table created with (3, 7).
  • Downgrade protocol version on table created with (1, 7).
  • Protocol version downgrade on a table with table features and added legacy feature.
  • Protocol version is not downgraded when writer features exist.
  • Protocol version is not downgraded when reader+writer features exist.
  • Protocol version is not downgraded when multiple reader+writer features exist.

Does this PR introduce any user-facing changes?

Yes. Dropping a table feature from a table with multiple features may now result to a Protocol versions downgrade. For example, Protocol(3, 7, DeletionVectors, RowTracking) can now be downgraded to Protocol(1, 7, RowTracking).

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!

Copy link
Contributor

@larsk-db larsk-db left a comment

Choose a reason for hiding this comment

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

LGTM

@felipepessoto
Copy link
Contributor

Is the description correct? Reader v1 doesn’t support DV

@larsk-db
Copy link
Contributor

larsk-db commented Apr 8, 2024

Is the description correct? Reader v1 doesn’t support DV

I think the intent of "can be downgraded" was an implicit "after removing the DV feature".

@andreaschat-db andreaschat-db force-pushed the downgradeMinTableFeatureVersion branch from d9d7845 to 3a4db9e Compare May 9, 2024 17:20
Copy link
Collaborator

@bart-samwel bart-samwel left a comment

Choose a reason for hiding this comment

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

One final nit. Let's ship it!

@vkorukanti vkorukanti merged commit 4ee7f4d into delta-io:master May 13, 2024
10 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.

6 participants