Github user xuanyuanking commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14957#discussion_r85656729
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala
 ---
    @@ -126,4 +136,52 @@ object FileSourceStrategy extends Strategy with 
Logging {
     
         case _ => Nil
       }
    +
    +  private def generateStructFieldsContainsNesting(projects: 
Seq[Expression],
    +                                      totalSchema: StructType) : 
Seq[StructField] = {
    +    def generateStructField(curField: List[String],
    +                             node: Expression) : Seq[StructField] = {
    +      node match {
    +        case ai: GetArrayItem =>
    +          // Here we drop the previous for simplify array and map support.
    +          // Same strategy in GetArrayStructFields and GetMapValue
    +          generateStructField(List.empty[String], ai.child)
    +        case asf: GetArrayStructFields =>
    +          generateStructField(List.empty[String], asf.child)
    +        case mv: GetMapValue =>
    +          generateStructField(List.empty[String], mv.child)
    +        case attr: AttributeReference =>
    +          Seq(getFieldRecursively(totalSchema, attr.name :: curField))
    +        case sf: GetStructField =>
    +          generateStructField(sf.name.get :: curField, sf.child)
    --- End diff --
    
    fix done.
    a little question here, all projects parse from sql must have the name 
while projects from dataframe api may not   , right?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to