beliefer commented on code in PR #43722:
URL: https://github.com/apache/spark/pull/43722#discussion_r1389016848


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/xml/StaxXmlParser.scala:
##########
@@ -274,7 +277,11 @@ class StaxXmlParser(
     val convertedValuesMap = collection.mutable.Map.empty[String, Any]
     val valuesMap = 
StaxXmlParserUtils.convertAttributesToValuesMap(attributes, options)
     valuesMap.foreach { case (f, v) =>
-      val nameToIndex = schema.map(_.name).zipWithIndex.toMap
+      val nameToIndex = if (caseSensitive) {
+        schema.map(_.name).zipWithIndex.toMap
+      } else {
+        CaseInsensitiveMap(schema.map(_.name).zipWithIndex.toMap)
+      }

Review Comment:
   +1



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/xml/XmlInferSchema.scala:
##########
@@ -32,7 +32,12 @@ import scala.util.control.NonFatal
 import org.apache.spark.internal.Logging
 import org.apache.spark.rdd.RDD
 import org.apache.spark.sql.catalyst.expressions.ExprUtils
-import org.apache.spark.sql.catalyst.util.{DateFormatter, PermissiveMode, 
TimestampFormatter}
+import org.apache.spark.sql.catalyst.util.{
+  CaseInsensitiveMap,
+  DateFormatter,
+  PermissiveMode,
+  TimestampFormatter
+}

Review Comment:
   ```suggestion
   import org.apache.spark.sql.catalyst.util.{CaseInsensitiveMap, 
DateFormatter, PermissiveMode, TimestampFormatter}
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to