Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/19017
  
    Is it better than functional transformation?
    
    On Aug 24, 2017 1:46 PM, "Xiao Li" <[email protected]> wrote:
    
    > *@gatorsmile* commented on this pull request.
    > ------------------------------
    >
    > In sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/
    > expressions/jsonExpressions.scala
    > <https://github.com/apache/spark/pull/19017#discussion_r134931120>:
    >
    > > @@ -447,7 +448,18 @@ case class JsonTuple(children: Seq[Expression])
    >                generator => copyCurrentStructure(generator, parser)
    >              }
    >
    > -            row(idx) = UTF8String.fromBytes(output.toByteArray)
    > +            val jsonValue = UTF8String.fromBytes(output.toByteArray)
    > +            row(idx) = jsonValue
    > +            idx = idx + 1
    > +
    > +            // SPARK-21804: json_tuple returns null values within 
repeated columns
    > +            // except the first one; so that we need to check the 
remaining fields.
    > +            while (idx < fieldNames.length) {
    > +              if (fieldNames(idx) == jsonField) {
    > +                row(idx) = jsonValue
    > +              }
    > +              idx = idx + 1
    > +            }
    >
    >             row(idx) = jsonValue
    >             idx = idx + 1
    >
    >             // SPARK-21804: json_tuple returns null values within 
repeated columns
    >             // except the first one; so that we need to check the 
remaining fields.
    >             while (idx < fieldNames.length) {
    >               if (fieldNames(idx) == jsonField) {
    >                 row(idx) = jsonValue
    >               }
    >               idx = idx + 1
    >             }
    >
    > ->
    >
    >             do {
    >               row(idx) = jsonValue
    >               idx = fieldNames.indexOf(jsonField, idx + 1)
    >             } while (idx >= 0)
    >
    > —
    > You are receiving this because you were mentioned.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/spark/pull/19017#discussion_r134931120>, or 
mute
    > the thread
    > 
<https://github.com/notifications/unsubscribe-auth/AAEM9469kwhOt3hF3Wl6MKVviD7dRMQoks5sbQ5KgaJpZM4O-LpB>
    > .
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to