shujingyang-db commented on code in PR #44571:
URL: https://github.com/apache/spark/pull/44571#discussion_r1442398779


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/xml/XmlInferSchema.scala:
##########
@@ -175,31 +174,26 @@ class XmlInferSchema(options: XmlOptions, caseSensitive: 
Boolean)
         parser.nextEvent()
         parser.peek match {
           case _: StartElement => inferObject(parser)
-          case _: EndElement if data.isEmpty => NullType
-          case _: EndElement if options.nullValue == "" => NullType
-          case _: EndElement => StringType
+          case _: EndElement if data.trim.isEmpty =>

Review Comment:
   `data.trim.isEmpty` isn't always true. We do a `parser.nextEvent()`. 
`c.isWhiteSpace` is always true for the last event and we're checking the 
current event.



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