Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private[xml] object StaxXmlParser {
case _: EndElement if data.isEmpty => null
case _: EndElement if options.treatEmptyValuesAsNulls => null
case _: EndElement => data
case _ => convertField(parser, dataType, options)
}

case (c: Characters, ArrayType(st, _)) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private[xml] object InferSchema {
case _: EndElement if data.isEmpty => NullType
case _: EndElement if options.treatEmptyValuesAsNulls => NullType
case _: EndElement => StringType
case _ => inferField(parser, options)
}
case c: Characters if !c.isWhiteSpace =>
// This means data exists
Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/null-nested-struct.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<root>
<item>
<b>
<!-- nested comments -->
<es>
<e>1</e>
</es>
Expand All @@ -10,6 +11,9 @@
<item>
<!-- Issue 117 - This is where an empty Row would be produced instead of null -->
<b>

<!-- nested comments -->

<es></es>
</b>
</item>
Expand Down