xiaonanyang-db commented on code in PR #50560: URL: https://github.com/apache/spark/pull/50560#discussion_r2038642161
########## sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/xml/XmlFileFormat.scala: ########## @@ -63,8 +63,11 @@ class XmlFileFormat extends TextBasedFileFormat with DataSourceRegister { files: Seq[FileStatus]): Option[StructType] = { val xmlOptions = getXmlOptions(sparkSession, options) - XmlDataSource(xmlOptions).inferSchema( - sparkSession, files, xmlOptions) + xmlOptions.singleVariantColumn match { + case Some(columnName) => Some(StructType(Array(StructField(columnName, VariantType)))) + case None => + XmlDataSource(xmlOptions).inferSchema(sparkSession, files, xmlOptions) + } Review Comment: ah, yeah, this is reverted changes that were left because of code conflict, I will revert. ########## sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/xml/XmlFileFormat.scala: ########## @@ -63,8 +63,11 @@ class XmlFileFormat extends TextBasedFileFormat with DataSourceRegister { files: Seq[FileStatus]): Option[StructType] = { val xmlOptions = getXmlOptions(sparkSession, options) - XmlDataSource(xmlOptions).inferSchema( - sparkSession, files, xmlOptions) + xmlOptions.singleVariantColumn match { + case Some(columnName) => Some(StructType(Array(StructField(columnName, VariantType)))) + case None => + XmlDataSource(xmlOptions).inferSchema(sparkSession, files, xmlOptions) + } Review Comment: ah, yeah, this is reverted changes that were left because of code conflict, I will remove it. -- 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