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

[Kernel] Enable writing to tables at version 7 when no invariants are defined in the schema #4027

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qiyuandong-db
Copy link
Contributor

Which Delta project/connector is this regarding?

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

Description

Currently, Kernel doesn't support the invariants feature and could not write to tables on writer version 7 if their writerFeatures contains invariants.

With this change, Kernel will allow invariants to be present in the writerFeatures for tables on writer version 7, provided the schema does not define any invariants. This unblocks Kernel from writing to such tables.

How was this patch tested?

Tests are added in TableFeaturesSuite.scala. It also added a missing integration test in RowTrackingSuite.scala that was previously blocked by invariants.

Does this PR introduce any user-facing changes?

No.

@qiyuandong-db qiyuandong-db force-pushed the delta-kernel-allow-invariants-in-writer-version-7 branch from a2bd58e to e36297d Compare January 8, 2025 20:13
@qiyuandong-db qiyuandong-db changed the title [Kernel] Allow writing to tables at version 7 if no invariants are defined in the schema [Kernel] Enable writing to tables at version 7 when no invariants are defined in the schema Jan 9, 2025
Copy link
Collaborator

@johanl-db johanl-db left a comment

Choose a reason for hiding this comment

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

Nice, only very minor comments

)
}

test("validateWriteSupported: protocol 7 with invariants, schema contains invariants") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
test("validateWriteSupported: protocol 7 with invariants, schema contains invariants") {
test("validateWriteUnsupported: protocol 7 with invariants, schema contains invariants") {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was also thinking about the name. I found this test suite consistently uses test("validateWriteSupported: ...") even for unsupported cases. So I thought it might be better to follow the same convention.

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