You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/11/10 12:11:38 UTC

[GitHub] spark pull request #19518: [SPARK-18016][SQL][CATALYST] Code Generation: Con...

Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19518#discussion_r150220400
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -801,12 +801,12 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
       private[this] def castToByteCode(from: DataType, ctx: CodegenContext): CastFunction = from match {
         case StringType =>
           val wrapper = ctx.freshName("wrapper")
    -      ctx.addMutableState("UTF8String.IntWrapper", wrapper,
    +      val wrapperAccessor = ctx.addMutableState("UTF8String.IntWrapper", wrapper,
    --- End diff --
    
    I'd like to have something like
    ```
    val wrapper = ctx.addMutableState("UTF8String.IntWrapper", v => s"$v = new UTF8String.IntWrapper();")
    ```


---

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