Skip to content

Commit

Permalink
[CARMEL-1463][FOLLOWUP] Fix a bug of delete command type casting (del…
Browse files Browse the repository at this point in the history
  • Loading branch information
LantaoJin authored and GitHub Enterprise committed Nov 6, 2019
1 parent 2f49adf commit 56f4c3b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ trait DeltaTableOperations extends AnalysisHelper { self: DeltaTable =>
subqueryNotSupportedCheck(condition, "DELETE")

val qe = sparkSession.sessionState.executePlan(delete)
val resolvedDelete = qe.analyzed.asInstanceOf[Delete]
val deleteCommand = DeleteCommand(resolvedDelete)
val deleteCommand = qe.analyzed match {
case command: DeleteCommand =>
command
case _ =>
val resolvedDelete = qe.analyzed.asInstanceOf[Delete]
DeleteCommand(resolvedDelete)
}
deleteCommand.run(sparkSession)
}

Expand Down

0 comments on commit 56f4c3b

Please sign in to comment.