[Spark] Only enable a single legacy feature with legacy metadata properties #3657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which Delta project/connector is this regarding?
Description
Currently enabling legacy features on legacy protocols with metadata properties results to enabling all preceding legacy features. For example, enabling enableChangeDataFeed results to protocol (1, 4). This is inconsistent with the rest protocol operations. In this PR, we fix this inconsistency by always enabling only the requested feature. This is a behavioral change.
How was this patch tested?
Existing and new unit tests.
Does this PR introduce any user-facing changes?
Yes. When enabling a feature using a table property, e.g. by setting
delta.enableChangeDataFeed
totrue
, then in the previous situation you would typically get protocol(1, 4)
. Now you would get(1, 7, changeDataFeed)
. The user can get(1, 4)
by also asking fordelta.minWriterVersion = 4
. This change is OK now because (a) enabling fewer features is safer than enabling more features, and (b) Deletion Vectors requires table features support, and it is very popular to implement, so many clients have added support table features, (c) users can easily get back to the legacy protocol by ALTERing the protocol and asking fordelta.minWriterVersion = 4
.