[
https://issues.apache.org/jira/browse/DRILL-7831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17258730#comment-17258730
]
ASF GitHub Bot commented on DRILL-7831:
---------------------------------------
luocooong commented on a change in pull request #2132:
URL: https://github.com/apache/drill/pull/2132#discussion_r551759800
##########
File path:
contrib/format-xml/src/main/java/org/apache/drill/exec/store/xml/XMLReader.java
##########
@@ -298,15 +305,27 @@ private void processEvent(XMLEvent currentEvent,
} else if (currentState == xmlState.FIELD_ENDED && currentNestingLevel
>= dataLevel) {
// Case to end nested maps
// Pop tupleWriter off stack
- currentTupleWriter = rowWriterStack.pop();
- attributePrefix = XMLUtils.removeField(attributePrefix);
+ if (rowWriterStack.size() > 0) {
+ currentTupleWriter = rowWriterStack.pop();
+ }
+ // Pop field name
+ if (fieldNameStack.size() > 0) {
+ fieldNameStack.pop();
+ }
+
+ attributePrefix = XMLUtils.removeField(attributePrefix,fieldName);
Review comment:
Could you please confirm that the `attributePrefix` variable will not be
null in the context of the `XMLReader.processEvent()` ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Drill Fails To Read XML File with Self Closing Tags
> ---------------------------------------------------
>
> Key: DRILL-7831
> URL: https://issues.apache.org/jira/browse/DRILL-7831
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.17.0
> Reporter: Charles Givre
> Priority: Major
> Fix For: 1.19.0
>
>
> If an XML file has self closing tags as shown below, Drill fails to read that
> properly.
> {{
> <field1 />
> <field2 />
> }}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)