viirya commented on a change in pull request #28366:
URL: https://github.com/apache/spark/pull/28366#discussion_r418607459
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -179,15 +179,22 @@ class DataSourceV2Strategy(session: SparkSession) extends
Strategy with Predicat
case OverwriteByExpression(r: DataSourceV2Relation, deleteExpr, query,
writeOptions, _) =>
// fail if any filter cannot be converted. correctness depends on
removing all matching data.
- val filters = splitConjunctivePredicates(deleteExpr).map {
- filter => DataSourceStrategy.translateFilter(deleteExpr).getOrElse(
- throw new AnalysisException(s"Cannot translate expression to source
filter: $filter"))
- }.toArray
+ val filters = splitConjunctivePredicates(deleteExpr)
+ def transferFilters =
+ (filters: Seq[Expression], supportNestedPredicatePushdown: Boolean) =>
{
+ filters.map { filter =>
+ DataSourceStrategy.translateFilter(deleteExpr,
supportNestedPredicatePushdown)
+ .getOrElse(throw new AnalysisException(
+ s"Cannot translate expression to source filter: $filter"))
+ }.toArray
+ }
r.table.asWritable match {
case v1 if v1.supports(TableCapability.V1_BATCH_WRITE) =>
- OverwriteByExpressionExecV1(v1, filters, writeOptions.asOptions,
query) :: Nil
+ OverwriteByExpressionExecV1(
+ v1, transferFilters(filters, false), writeOptions.asOptions,
query) :: Nil
Review comment:
ok. got it. thanks.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]