cloud-fan commented on a change in pull request #34451: URL: https://github.com/apache/spark/pull/34451#discussion_r740223565
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala ########## @@ -225,6 +226,26 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] with PredicateHelper { withProjection } + def applySample(plan: LogicalPlan): LogicalPlan = plan.transform { + case sample@Sample(_, _, _, _, child) => child match { + case ScanOperation(_, filter, sHolder: ScanBuilderHolder) if filter.length == 0 => + val tableSample = TableSample( + sample.lowerBound, + sample.upperBound, + sample.withReplacement, + sample.seed) + val pushed = PushDownUtils.pushTableSample(sHolder.builder, tableSample) + if (pushed) { + sHolder.setSample(Some(tableSample)) + sample.child Review comment: ```suggestion child ``` -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org