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

Improve strict schema string match with smarter matching #621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyl-db
Copy link
Collaborator

@andyl-db andyl-db commented Dec 19, 2024

This PR improves the strict schema string match with smarter matching i.e. subset matching

Added unit test

Tested against DBR:
image

@andyl-db andyl-db force-pushed the tolerate-schema-subset branch 2 times, most recently from bb68ecb to ef53c76 Compare January 6, 2025 23:19
@andyl-db andyl-db force-pushed the tolerate-schema-subset branch 2 times, most recently from 781b9c3 to 0384302 Compare January 10, 2025 19:04
@andyl-db andyl-db requested a review from zsxwing January 10, 2025 19:11
throw new SparkException(
s"""The schema or partition columns of your Delta table has changed since your
|DataFrame was created. Please redefine your DataFrame""")
val newSchema = DataType.fromJson(newMetadata.schemaString).asInstanceOf[StructType]
Copy link
Collaborator

Choose a reason for hiding this comment

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

So we are using org.apache.spark.sql.types.DataType instead of a delta class (where we discussed to use a class reflection) to perform the comparison, is that good enough?

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