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

    https://github.com/apache/spark/pull/10757#discussion_r53004057
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala
 ---
    @@ -144,10 +152,11 @@ case class GetArrayStructFields(
         field: StructField,
         ordinal: Int,
         numFields: Int,
    -    containsNull: Boolean) extends UnaryExpression {
    +    containsNull: Boolean) extends UnaryExpression with ExtractValue {
     
       override def dataType: DataType = ArrayType(field.dataType, containsNull)
    -  override def toString: String = s"$child.${field.name}"
    +  override def toString: String = s"$child[$ordinal].${field.name}"
    --- End diff --
    
    The javadoc of `GetArrayStructFields` is too simple...
    
    Actually `GetArrayStructFields` means, we have an array, each element of 
this array is struct type, and for each element, we wanna get one field of it. 
It's like a batched version of `GetStructField`, just like 
`persons.map(_.name)` is a batched version of `person.name`.
    
    So `s"$child.${field.name}"` is corrected here.


---
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