You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2018/08/02 01:17:42 UTC

[GitHub] spark pull request #19777: [SPARK-22549][SQL] Fix 64KB JVM bytecode limit pr...

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

    https://github.com/apache/spark/pull/19777#discussion_r207077435
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala ---
    @@ -125,13 +125,34 @@ case class ConcatWs(children: Seq[Expression])
         if (children.forall(_.dataType == StringType)) {
           // All children are strings. In that case we can construct a fixed size array.
           val evals = children.map(_.genCode(ctx))
    -
    -      val inputs = evals.map { eval =>
    -        s"${eval.isNull} ? (UTF8String) null : ${eval.value}"
    -      }.mkString(", ")
    -
    -      ev.copy(evals.map(_.code).mkString("\n") + s"""
    -        UTF8String ${ev.value} = UTF8String.concatWs($inputs);
    +      val separator = evals.head
    +      val strings = evals.tail
    +      val numArgs = strings.length
    +      val args = ctx.freshName("args")
    +
    +      val inputs = strings.zipWithIndex.map { case (eval, index) =>
    +        if (eval.isNull != "true") {
    --- End diff --
    
    @kiszk I was looking at build warnings and it notes that this compares a `ExprValue` and `String` and they will always not be equal. Should it be `eval.isNull.code != "true"` maybe?


---

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