Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7076#discussion_r34865586
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateMutableProjection.scala
 ---
    @@ -45,7 +45,32 @@ object GenerateMutableProjection extends 
CodeGenerator[Seq[Expression], () => Mu
               else
                 mutableRow.${ctx.setColumn(e.dataType, i, 
evaluationCode.primitive)};
             """
    -    }.mkString("\n")
    +    }
    +    val partitionedProjectionCode = 
projectionCode.foldLeft(List.empty[String]) {
    +      (acc, code) =>
    +        acc match {
    +          case Nil => List(code)
    +          case head::tail =>
    +            // code size limit is 64kb and each char takes less or equal 
to 2 bytes
    +            if (head.length < 32 * 1000) {
    +              s"$head\n$code"::tail
    +            } else {
    +              code::acc
    +            }
    +        }
    +    }
    +      .zipWithIndex
    +      .map {
    +        case (body, i) =>
    +          s"""
    +             private void apply$i(InternalRow i) {
    +               $body
    +             }
    +           """
    +      }
    +    val projectionCalls = ((partitionedProjectionCode.length - 1) to 0 by 
-1)
    +      .map(i => s"apply$i(i);")
    --- End diff --
    
    As we have some discussion on #7418 probably it's too heavy to call 
function for getting the one field value. Particularly for the case:
    `select a+b from src`


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to