cloud-fan commented on a change in pull request #25264:
[SPARK-28213][SQL][followup] code cleanup and bug fix for columnar execution
framework
URL: https://github.com/apache/spark/pull/25264#discussion_r307949797
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala
##########
@@ -57,40 +57,36 @@ class ColumnarRule {
* [[org.apache.spark.sql.execution.python.ArrowEvalPythonExec]] and
* [[MapPartitionsInRWithArrowExec]]. Eventually this should replace those
implementations.
*/
-case class ColumnarToRowExec(child: SparkPlan)
- extends UnaryExecNode with CodegenSupport {
+case class ColumnarToRowExec(child: SparkPlan) extends UnaryExecNode with
CodegenSupport {
+ assert(child.supportsColumnar)
override def output: Seq[Attribute] = child.output
override def outputPartitioning: Partitioning = child.outputPartitioning
override def outputOrdering: Seq[SortOrder] = child.outputOrdering
+ // `ColumnarToRowExec` is the beginning of a codegen stage, so it doesn't
need to copy result and
+ // it can add limit condition check.
+ override def needCopyResult: Boolean = false
+ protected override def canCheckLimitNotReached: Boolean = true
+
override lazy val metrics: Map[String, SQLMetric] = Map(
- "numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output
rows"),
Review comment:
Maybe I was too conservative. I'll add it back, and revisit this when I
benchmark Spark 3.0.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]