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

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
 ##########
 @@ -522,13 +517,10 @@ case class InputAdapter(child: SparkPlan, 
isChildColumnar: Boolean)
     child.executeColumnar()
   }
 
-  override def inputRDD: RDD[InternalRow] = {
-    if (isChildColumnar) {
-      child.executeColumnar().asInstanceOf[RDD[InternalRow]] // Hack because 
of type erasure
-    } else {
-      child.execute()
-    }
-  }
+  // `InputAdapter` can only generate code to process the rows from its child. 
If the child produces
+  // columnar batches, there must be a `ColumnarToRowExec` above 
`InputAdapter` to handle it by
+  // overriding `inputRDD`.
 
 Review comment:
   So the `ColumnarToRowExec` doubles as in `InputAdapter`? Wouldn't it be less 
confusing to replace the `InputAdapter` with `ColumnarToRowExec`?

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

Reply via email to