Github user yhuai commented on a diff in the pull request: https://github.com/apache/spark/pull/14014#discussion_r70029907 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala --- @@ -482,13 +482,105 @@ private[parquet] class ParquetRowConverter( */ // scalastyle:on private def isElementType( - parquetRepeatedType: Type, catalystElementType: DataType, parentName: String): Boolean = { + parquetRepeatedType: Type, catalystElementType: DataType, parent: GroupType): Boolean = { (parquetRepeatedType, catalystElementType) match { - case (t: PrimitiveType, _) => true - case (t: GroupType, _) if t.getFieldCount > 1 => true - case (t: GroupType, _) if t.getFieldCount == 1 && t.getName == "array" => true - case (t: GroupType, _) if t.getFieldCount == 1 && t.getName == parentName + "_tuple" => true - case (t: GroupType, StructType(Array(f))) if f.name == t.getFieldName(0) => true + case (t: PrimitiveType, _) => + // For legacy 2-level list types with primitive element type, e.g.: + // + // // List<Integer> (nullable list, non-null elements) + // optional group my_list (LIST) { <-- parent + // repeated int32 element; <-- repeatedType --- End diff -- Seems it is better to make the name match the variable name.
--- 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