Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/21061
  
    SGTM
    
    On Thu, Jul 12, 2018, 12:19 PM Takuya UESHIN <notificati...@github.com>
    wrote:
    
    > *@ueshin* commented on this pull request.
    > ------------------------------
    >
    > In
    > 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
    > <https://github.com/apache/spark/pull/21061#discussion_r201898932>:
    >
    > > +    val i = ctx.freshName("i")
    > +    val pos = ctx.freshName("pos")
    > +    val value = ctx.freshName("value")
    > +    val size = ctx.freshName("size")
    > +    val (postFix, openHashElementType, getter, setter, javaTypeName, 
castOp, arrayBuilder) =
    > +      if (elementTypeSupportEquals) {
    > +        elementType match {
    > +          case ByteType | ShortType | IntegerType | LongType =>
    > +            val ptName = CodeGenerator.primitiveTypeName(elementType)
    > +            val unsafeArray = ctx.freshName("unsafeArray")
    > +            (if (elementType == LongType) s"$$mcJ$$sp" else s"$$mcI$$sp",
    > +              if (elementType == LongType) "Long" else "Int",
    > +              s"get$ptName($i)", s"set$ptName($pos, $value)", 
CodeGenerator.javaType(elementType),
    > +              if (elementType == LongType) "(long)" else "(int)",
    > +              s"""
    > +                 |${ctx.createUnsafeArray(unsafeArray, size, 
elementType, s" $prettyName failed.")}
    >
    > Do you mean a refactoring around the usage of createUnsafeArray through
    > new collection functions in another PR? If so, I'm okay with doing it in
    > another PR.
    >
    > —
    > You are receiving this because you were mentioned.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/spark/pull/21061#discussion_r201898932>, or 
mute
    > the thread
    > 
<https://github.com/notifications/unsubscribe-auth/AAEM9yfWA_RnPbO_fsjFD4rCxpHL0glqks5uFsA3gaJpZM4TS6Ng>
    > .
    >



---

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

Reply via email to