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] Ignore internal metadata when detecting schema changes in Delta source #3849

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

Conversation

johanl-db
Copy link
Collaborator

Description

When reading from a Delta streaming source with schema tracking enabled - by specifying schemaTrackingLocation - internal metadata in the table schema causes a schema change to be detected.

This is especially problematic for identity columns that track the current high-water mark for ids as metadata in the table schema and update it on every write, causing streams to repeatedly fail and requiring a restart.

This change addresses the issue by ignoring internal metadata fields when detecting schema changes.

A flag is added to revert to the old behavior if needed.

How was this patch tested?

Added test case covering problematic use case with both fix enabled and disabled.

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.

Nice fix!

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.

2 participants