zhztheplayer commented on code in PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#discussion_r2126832985
##########
shims/spark35/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExecShim.scala:
##########
@@ -146,10 +146,35 @@ abstract class BatchScanExecShim(
}
}
-abstract class ArrowBatchScanExecShim(original: BatchScanExec) extends
DataSourceV2ScanExecBase {
- @transient override lazy val inputPartitions: Seq[InputPartition] =
original.inputPartitions
-
- override def keyGroupedPartitioning: Option[Seq[Expression]] =
original.keyGroupedPartitioning
+abstract class ArrowBatchScanExecShim(original: BatchScanExec)
+ extends BatchScanExecShim(
+ original.output,
+ original.scan,
+ original.runtimeFilters,
+ original.spjParams.keyGroupedPartitioning,
+ original.ordering,
+ original.table,
+ original.spjParams.commonPartitionValues,
+ original.spjParams.applyPartialClustering,
+ original.spjParams.replicatePartitions
+ ) {
+ override def scan: Scan = original.scan
override def ordering: Option[Seq[SortOrder]] = original.ordering
+
+ override def output: Seq[Attribute] = original.output
+
+ override lazy val metrics = {
+ Map("numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of
output rows")) ++
+ customMetrics
+ }
+
+ override def doExecuteColumnar(): RDD[ColumnarBatch] = {
+ val numOutputRows = longMetric("numOutputRows")
+ inputRDD.asInstanceOf[RDD[ColumnarBatch]].map {
+ b =>
+ numOutputRows += b.numRows()
+ b
+ }
+ }
Review Comment:
Any difference of this code among the Spark versions? Or else we can move it
to `ArrowBatchScanExec.scala`?
--
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]