cloud-fan commented on a change in pull request #33409:
URL: https://github.com/apache/spark/pull/33409#discussion_r672894317



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala
##########
@@ -52,8 +52,13 @@ private[sql] object OrcFileFormat {
     }
   }
 
-  def checkFieldNames(names: Seq[String]): Unit = {
-    names.foreach(checkFieldName)
+  def checkFieldNames(schema: StructType): Unit = {
+    schema.foreach {

Review comment:
       nit:
   ```
   schema.foreach { field =>
     checkFieldName(field.name)
     field.dataType match {
       case s: StructType => checkFieldNames(s)
       case _ =>
     }
   }
   ```

##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala
##########
@@ -593,8 +593,13 @@ private[sql] object ParquetSchemaConverter {
        """.stripMargin.split("\n").mkString(" ").trim)
   }
 
-  def checkFieldNames(names: Seq[String]): Unit = {
-    names.foreach(checkFieldName)
+  def checkFieldNames(schema: StructType): Unit = {
+    schema.foreach {
+      case field if field.dataType.isInstanceOf[StructType] =>
+        checkFieldName(field.name)
+        checkFieldNames(field.dataType.asInstanceOf[StructType])

Review comment:
       ditto




-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to