HyukjinKwon commented on a change in pull request #33409:
URL: https://github.com/apache/spark/pull/33409#discussion_r672018403
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala
##########
@@ -593,8 +593,14 @@ private[sql] object ParquetSchemaConverter {
""".stripMargin.split("\n").mkString(" ").trim)
}
- def checkFieldNames(names: Seq[String]): Unit = {
- names.foreach(checkFieldName)
+ def checkFieldNames(schema: StructType): Unit = {
+ schema.map(field => field.name -> field.dataType)
+ .foreach {
+ case (name, struct: StructType) =>
Review comment:
I think you can traverse with `StructField`? e.g.)
```scala
case field if field.dataType.isInstanceOf[StructType] =>
checkFieldName(name)
checkFieldNames(struct)
case field => checkFieldName(field.name)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]