Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/993#discussion_r15333966
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala ---
    @@ -51,8 +82,46 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] 
with Logging {
        */
       def executeCollect(): Array[Row] = execute().map(_.copy()).collect()
     
    -  protected def buildRow(values: Seq[Any]): Row =
    -    new GenericRow(values.toArray)
    +  protected def newProjection(
    +      expressions: Seq[Expression], inputSchema: Seq[Attribute]): 
Projection = {
    +    log.debug(
    +      s"Creating Projection: $expressions, inputSchema: $inputSchema, 
codegen:$codegenEnabled")
    +    if (codegenEnabled) {
    +      GenerateProjection(expressions, inputSchema)
    +    } else {
    +      new InterpretedProjection(expressions, inputSchema)
    +    }
    +  }
    +
    +  protected def newMutableProjection(
    +      expressions: Seq[Expression],
    +      inputSchema: Seq[Attribute]): () => MutableProjection = {
    +    log.debug(
    +      s"Creating MutableProj: $expressions, inputSchema: $inputSchema, 
codegen:$codegenEnabled")
    +    if(codegenEnabled) {
    +      GenerateMutableProjection(expressions, inputSchema)
    --- End diff --
    
    This is another use of apply that is very confusing, because it is not 
obvious GenerateMutableProjection is a closure.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to