[Spark] Compatibility with schema evolution changes in Spark master#6319
Conversation
longvu-db
left a comment
There was a problem hiding this comment.
"Spark doesn't set delta's writer option mergeSchema anymore, which was used as workaround until a withSchemaEvolution was introduced on write plan nodes"
=> So this is a fact, and I think this PR is doing something with this fact, could we also mention what that action is (adding a rule to add the mergeSchema option) and why we are taking that action (just compatibility I guess?)
spark/src/main/scala/org/apache/spark/sql/delta/DeltaAnalysis.scala
Outdated
Show resolved
Hide resolved
I updated the PR description |
Description
Support for schema evolution in INSERT landed in Spark master: apache/spark#54488
A few changes are required to maintain compatibility in Delta:
withSchemaEvolutionand introduce a few methods to implement for schema evolution for V2Write commands (e.p.writePrivileges)withSchemaEvolutionwas introduced on write plan nodes. Instead, Spark now setswithSchemaEvolutiondirectly, and a pre-resolution rulePropagateSchemaEvolutionWriteOptionis added in Delta to set the writer optionmergeSchemawhenwithSchemaEvolution=trueif it's not already explicitly set by the user.How was this patch tested?
Existing tests
Does this PR introduce any user-facing changes?
No