sandip-db commented on code in PR #50560:
URL: https://github.com/apache/spark/pull/50560#discussion_r2038618351


##########
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:
   This is unrelated to XML writer. Shouldn't this be part of XML to Variant?



-- 
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