cloud-fan commented on a change in pull request #30869: URL: https://github.com/apache/spark/pull/30869#discussion_r548388043
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ########## @@ -920,9 +921,12 @@ object DDLUtils { serde == Some("parquet.hive.serde.ParquetHiveSerDe") || serde == Some("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe")) { ParquetSchemaConverter.checkFieldNames(colNames) + } else if (serde == HiveSerDe.sourceToSerDe("avro").get.serde) { + AvroFileFormat.checkFieldNames(colNames) } case "parquet" => ParquetSchemaConverter.checkFieldNames(colNames) case "orc" => OrcFileFormat.checkFieldNames(colNames) + case "avro" => AvroFileFormat.checkFieldNames(colNames) Review comment: What we can do here is: ``` DataSource.lookupDataSource(provider, conf) match { case f: FileFormat => f.checkFieldNames... // a new API case _ => } ``` ---------------------------------------------------------------- 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. 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