spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #20176: [SPARK-22981][SQL] Fix incorrect results of Casti...
Date Tue, 09 Jan 2018 02:57:52 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20176#discussion_r160309596
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
---
    @@ -732,6 +755,39 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId:
Option[String
          """.stripMargin
       }
     
    +  private def writeStructToStringBuilder(
    +      st: Seq[DataType],
    +      row: String,
    +      buffer: String,
    +      ctx: CodegenContext): String = {
    +    val structToStringCode = st.zipWithIndex.map { case (ft, i) =>
    +      val fieldToStringCode = castToStringCode(ft, ctx)
    +      val funcName = ctx.freshName("fieldToString")
    +      ctx.addNewFunction(funcName,
    --- End diff --
    
    no need to create a function, it's called only once.


---

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


Mime
View raw message