You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apache Spark has a bug where MERGE's INSERT/UPDATE * expansion and resolution by Apache Spark is done by column position, not by name. This can lead to incorrect source columns be assigned to the target columns by star.
Delta should not have been affected by this bug because it tries to skip the OSS MERGE resolution to perform its own resolution with potentially schema evolution enabled. The logic to skip the resolution is based on whether the target table is a DataSourceV2Relation that supports its own schema resolution. However, this logic breaks when there is a View on top of the DataSourceV2Relation, thus causing the Apache spark's resolution to kick and do incorrect star expansion. Until the bug in this logic is fixed in Apache Spark, this cannot be fixed in OSS Delta.
This affects the following versions
Delta 0.7.0 on Spark 3.0.x
Delta 0.8.0 on Spark 3.1.x
Workarounds
Remove the view.
Use Scala/Python APIs.
The text was updated successfully, but these errors were encountered:
tdas
changed the title
Incorrect results with MERGE INSERT * / UPDATE * when applied on a view on the target Delta table
Incorrect results with SQL MERGE INSERT * / UPDATE * when applied on a view on the target Delta table
Mar 11, 2021
This PR adds a test so that we can detect #618
Author: Tathagata Das <tathagata.das1565@gmail.com>
GitOrigin-RevId: 1af03b03f64c607c8f61b41eef678f3a72355ad7
Apache Spark has a bug where MERGE's INSERT/UPDATE * expansion and resolution by Apache Spark is done by column position, not by name. This can lead to incorrect source columns be assigned to the target columns by star.
Delta should not have been affected by this bug because it tries to skip the OSS MERGE resolution to perform its own resolution with potentially schema evolution enabled. The logic to skip the resolution is based on whether the target table is a DataSourceV2Relation that supports its own schema resolution. However, this logic breaks when there is a View on top of the DataSourceV2Relation, thus causing the Apache spark's resolution to kick and do incorrect star expansion. Until the bug in this logic is fixed in Apache Spark, this cannot be fixed in OSS Delta.
This affects the following versions
Workarounds
The text was updated successfully, but these errors were encountered: