spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatorsmile <...@git.apache.org>
Subject [GitHub] spark pull request #19821: [WIP][SPARK-22608][SQL] add new API to CodeGenera...
Date Mon, 27 Nov 2017 00:17:46 GMT
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19821#discussion_r153087865
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
---
    @@ -785,13 +785,36 @@ class CodegenContext {
        * @param expressions the codes to evaluate expressions.
        */
       def splitExpressions(row: String, expressions: Seq[String]): String = {
    -    if (row == null || currentVars != null) {
    +    if (INPUT_ROW == null || currentVars != null) {
           // Cannot split these expressions because they are not created from a row object.
           return expressions.mkString("\n")
         }
         splitExpressions(expressions, funcName = "apply", arguments = ("InternalRow", row)
:: Nil)
       }
     
    +  /**
    +   * Splits the generated code of expressions into multiple functions, because function
has
    +   * 64kb code size limit in JVM. This version takes care of INPUT_ROW and currentVars
    +   *
    +   * @param expressions the codes to evaluate expressions.
    +   * @param funcName the split function name base.
    +   * @param argumentsExceptRow the list of (type, name) of the arguments of the split
function
    +   *                           except for ctx.INPUT_ROW
    +  */
    +  def splitExpressions(
    +      expressions: Seq[String],
    +      funcName: String,
    +      argumentsExceptRow: Seq[(String, String)]): String = {
    --- End diff --
    
    Let the caller also provides `ctx.INPUT_ROW`?
    Change it to
    ```Scala
    arguments: Seq[(String, String)]
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message