cloud-fan commented on a change in pull request #35130:
URL: https://github.com/apache/spark/pull/35130#discussion_r782760379



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/PushDownUtils.scala
##########
@@ -130,8 +128,17 @@ object PushDownUtils extends PredicateHelper {
       return None
     }
 
-    val agg = new Aggregation(translatedAggregates.toArray, 
translatedGroupBys.toArray)
-    Some(agg).filter(scanBuilder.pushAggregation)
+    Some(new Aggregation(translatedAggregates.toArray, 
translatedGroupBys.toArray))
+  }
+
+  /**
+   * Pushes down aggregates to the data source reader
+   *
+   * @return pushed aggregation.
+   */
+  def pushAggregates(
+      scanBuilder: SupportsPushDownAggregates, aggOpt: Option[Aggregation]): 
Option[Aggregation] = {
+    aggOpt.filter(scanBuilder.pushAggregation)

Review comment:
       Doesn't seem necessary to create a method for only one line of code.




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