Skip to content

Commit c2ac1bb

Browse files
committed
Revert "[spark] Skip Paimon row-level rewrite rules on tables with SupportsRowLevelOperations"
This reverts commit 49c3110.
1 parent 49c3110 commit c2ac1bb

3 files changed

Lines changed: 4 additions & 21 deletions

File tree

paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonDeleteTable.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.paimon.spark.catalyst.analysis
2020

21-
import org.apache.paimon.spark.SparkTableWithRowLevelOps
2221
import org.apache.paimon.spark.commands.DeleteFromPaimonTableCommand
2322
import org.apache.paimon.table.FileStoreTable
2423

@@ -39,12 +38,8 @@ object PaimonDeleteTable extends Rule[LogicalPlan] with RowLevelHelper {
3938
// trip.
4039
AnalysisHelper.allowInvokingTransformsInAnalyzer {
4140
plan.transformDown {
42-
// Skip tables that expose SupportsRowLevelOperations: Spark's built-in RewriteDeleteFromTable
43-
// handles them via the V2 row-level path, and hijacking the plan here would force V1
44-
// fallback on configurations (e.g. row-tracking, data-evolution) that require V2 semantics.
4541
case d @ DeleteFromTable(PaimonRelation(table), condition)
46-
if d.resolved && !table.isInstanceOf[SparkTableWithRowLevelOps] &&
47-
shouldFallbackToV1Delete(table, condition) =>
42+
if d.resolved && shouldFallbackToV1Delete(table, condition) =>
4843
checkPaimonTable(table.getTable)
4944

5045
table.getTable match {

paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonMergeIntoBase.scala

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
package org.apache.paimon.spark.catalyst.analysis
2020

21-
import org.apache.paimon.spark.{SparkTable, SparkTableWithRowLevelOps}
21+
import org.apache.paimon.spark.SparkTable
2222
import org.apache.paimon.spark.catalyst.analysis.expressions.ExpressionHelper
2323
import org.apache.paimon.spark.commands.{MergeIntoPaimonDataEvolutionTable, MergeIntoPaimonTable}
2424

@@ -49,15 +49,8 @@ trait PaimonMergeIntoBase
4949
// trip.
5050
AnalysisHelper.allowInvokingTransformsInAnalyzer {
5151
plan.transformDown {
52-
// Skip tables that expose SupportsRowLevelOperations: Spark's built-in RewriteMergeIntoTable
53-
// handles them via the V2 row-level path, and hijacking the plan here would force V1
54-
// fallback on configurations (e.g. row-tracking, data-evolution) that require V2 semantics.
5552
case merge: MergeIntoTable
56-
if merge.resolved && PaimonRelation.isPaimonTable(merge.targetTable) &&
57-
!PaimonRelation
58-
.getPaimonRelation(merge.targetTable)
59-
.table
60-
.isInstanceOf[SparkTableWithRowLevelOps] =>
53+
if merge.resolved && PaimonRelation.isPaimonTable(merge.targetTable) =>
6154
val relation = PaimonRelation.getPaimonRelation(merge.targetTable)
6255
val v2Table = relation.table.asInstanceOf[SparkTable]
6356
val dataEvolutionEnabled = v2Table.coreOptions.dataEvolutionEnabled()

paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/analysis/PaimonUpdateTable.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.paimon.spark.catalyst.analysis
2020

21-
import org.apache.paimon.spark.SparkTableWithRowLevelOps
2221
import org.apache.paimon.spark.commands.UpdatePaimonTableCommand
2322
import org.apache.paimon.table.FileStoreTable
2423

@@ -45,11 +44,7 @@ object PaimonUpdateTable
4544
// trip. The pattern guard keeps the rewrite restricted to fully resolved plans.
4645
AnalysisHelper.allowInvokingTransformsInAnalyzer {
4746
plan.transformDown {
48-
// Skip tables that expose SupportsRowLevelOperations: Spark's built-in RewriteUpdateTable
49-
// handles them via the V2 row-level path, and hijacking the plan here would force V1
50-
// fallback on configurations (e.g. row-tracking, data-evolution) that require V2 semantics.
51-
case u @ UpdateTable(PaimonRelation(table), assignments, condition)
52-
if u.resolved && !table.isInstanceOf[SparkTableWithRowLevelOps] =>
47+
case u @ UpdateTable(PaimonRelation(table), assignments, condition) if u.resolved =>
5348
checkPaimonTable(table.getTable)
5449

5550
table.getTable match {

0 commit comments

Comments
 (0)