You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/21 01:04:16 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #33441: [SPARK-36202][SQL] Unify schema check code of FileFormat

HyukjinKwon commented on a change in pull request #33441:
URL: https://github.com/apache/spark/pull/33441#discussion_r673588586



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
##########
@@ -933,19 +934,34 @@ object DDLUtils {
         case HIVE_PROVIDER =>
           val serde = table.storage.serde
           if (serde == HiveSerDe.sourceToSerDe("orc").get.serde) {
-            OrcFileFormat.checkFieldNames(schema)
+            checkDataColNames("orc", schema)
           } else if (serde == HiveSerDe.sourceToSerDe("parquet").get.serde ||
             serde == Some("parquet.hive.serde.ParquetHiveSerDe") ||
             serde == Some("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe")) {
-            ParquetSchemaConverter.checkFieldNames(schema)
+            checkDataColNames("parquet", schema)
           }
-        case "parquet" => ParquetSchemaConverter.checkFieldNames(schema)
-        case "orc" => OrcFileFormat.checkFieldNames(schema)
+        case "parquet" => checkDataColNames("parquet", schema)
+        case "orc" => checkDataColNames("orc", schema)
         case _ =>
       }
     }
   }
 
+  private[sql] def checkDataColNames(provider: String, schema: StructType): Unit = {

Review comment:
       ```suggestion
     def checkDataColNames(provider: String, schema: StructType): Unit = {
   ```
   
   execution package is already private. let's remove




-- 
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-unsubscribe@spark.apache.org

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



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