ConeyLiu commented on code in PR #8088:
URL: https://github.com/apache/iceberg/pull/8088#discussion_r1282922082


##########
spark/v3.4/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/RowLevelCommandScanRelationPushDown.scala:
##########
@@ -122,16 +130,15 @@ object RowLevelCommandScanRelationPushDown extends 
Rule[LogicalPlan] with Predic
   private def pushFilters(
       cond: Expression,
       scanBuilder: ScanBuilder,
-      tableAttrs: Seq[AttributeReference]): (Seq[Filter], Seq[Predicate]) = {
+      tableAttrs: Seq[AttributeReference]): (Either[Seq[Filter], 
Seq[Predicate]], Seq[Expression]) = {
 
     val tableAttrSet = AttributeSet(tableAttrs)
     val filters = 
splitConjunctivePredicates(cond).filter(_.references.subsetOf(tableAttrSet))
     val normalizedFilters = DataSourceStrategy.normalizeExprs(filters, 
tableAttrs)
     val (_, normalizedFiltersWithoutSubquery) =
       normalizedFilters.partition(SubqueryExpression.hasSubquery)
 
-    val (pushedFilters, _) = PushDownUtils.pushFilters(scanBuilder, 
normalizedFiltersWithoutSubquery)
-    (pushedFilters.left.getOrElse(Seq.empty), 
pushedFilters.right.getOrElse(Seq.empty))
+    PushDownUtils.pushFilters(scanBuilder, normalizedFiltersWithoutSubquery)

Review Comment:
   The returning pair should be `(pushedFilters, unpushedFilters)`.
   ```scala
   // PushDownUtils
           case r: SupportsPushDownFilters =>
           ...
           (Left(r.pushedFilters()), (postScanFilters ++ 
untranslatableExprs).toSeq)
   
         case r: SupportsPushDownV2Filters =>
           ...
           (Right(r.pushedPredicates), (postScanFilters ++ 
untranslatableExprs).toSeq)
   ```



-- 
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]

Reply via email to