urosstan-db commented on code in PR #53560:
URL: https://github.com/apache/spark/pull/53560#discussion_r2643146264
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala:
##########
@@ -360,6 +360,53 @@ class DataSourceV2Strategy(session: SparkSession) extends
Strategy with Predicat
throw SparkException.internalError("Unexpected table relation: " +
other)
}
+ case UpdateTable(relation, assignments, conditionOpt) =>
+ relation match {
+ case DataSourceV2ScanRelation(r, _, output, _, _) =>
+ val table = r.table
+ val condition = conditionOpt.getOrElse(TrueLiteral)
+ if (SubqueryExpression.hasSubquery(condition)) {
+ throw
QueryCompilationErrors.unsupportedUpdateByConditionWithSubqueryError(condition)
+ }
+ // Convert condition to predicates
+ val predicates = if (condition == TrueLiteral) {
+ Array.empty[Predicate]
+ } else {
+ DataSourceStrategy.normalizeExprs(Seq(condition), output)
+ .flatMap(splitConjunctivePredicates(_).map {
Review Comment:
nit:
```suggestion
.flatMap(splitConjunctivePredicates(_)
.map {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]