Skip to content

Commit

Permalink
[CARMEL-4270] UpdateCommand and DeleteCommand should skip to optimize…
Browse files Browse the repository at this point in the history
… subquery in their condition (delta-io#16)
  • Loading branch information
LantaoJin authored and GitHub Enterprise committed Dec 11, 2020
1 parent a13db3d commit 933235e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ packageBin in Compile := spPackage.value

sparkComponents := Seq("sql")

publishArtifact in Test := true

/********************
* Release settings *
********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.apache.spark.sql.{Column, Dataset, Row, SparkSession}
import org.apache.spark.sql.catalyst.analysis.EliminateSubqueryAliases
import org.apache.spark.sql.catalyst.expressions.{EqualNullSafe, Expression, InputFileName, Literal, Not}
import org.apache.spark.sql.catalyst.plans.QueryPlan
import org.apache.spark.sql.catalyst.plans.logical.{DeltaDelete, LogicalPlan}
import org.apache.spark.sql.catalyst.plans.logical.{DeltaDelete, LogicalPlan, SkipOptimizingSubquery}
import org.apache.spark.sql.execution.SQLExecution
import org.apache.spark.sql.execution.command.RunnableCommand
import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics}
Expand All @@ -47,7 +47,7 @@ case class DeleteCommand(
tahoeFileIndex: TahoeFileIndex,
target: LogicalPlan,
condition: Option[Expression])
extends RunnableCommand with DeltaCommand {
extends RunnableCommand with DeltaCommand with SkipOptimizingSubquery {

override def innerChildren: Seq[QueryPlan[_]] = Seq(target)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.spark.SparkContext
import org.apache.spark.sql.{Column, Dataset, Row, SparkSession}
import org.apache.spark.sql.catalyst.expressions.{Alias, Expression, If, Literal}
import org.apache.spark.sql.catalyst.plans.QueryPlan
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, SupportsSubquery}
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, SkipOptimizingSubquery, SupportsSubquery}
import org.apache.spark.sql.execution.SQLExecution
import org.apache.spark.sql.execution.command.RunnableCommand
import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics}
Expand All @@ -46,7 +46,7 @@ case class UpdateCommand(
target: LogicalPlan,
updateExpressions: Seq[Expression],
condition: Option[Expression])
extends RunnableCommand with DeltaCommand with SupportsSubquery {
extends RunnableCommand with DeltaCommand with SupportsSubquery with SkipOptimizingSubquery {

override def innerChildren: Seq[QueryPlan[_]] = Seq(target)

Expand Down

0 comments on commit 933235e

Please sign in to comment.