You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/09/02 05:53:41 UTC

[GitHub] [drill] KendraKrat opened a new issue #2304: XML format plugin misses top-level attributes

KendraKrat opened a new issue #2304:
URL: https://github.com/apache/drill/issues/2304


   Consider the example shown on the XML format plugin's documentation page (https://drill.apache.org/docs/xml-format-plugin/), which shows a list of books (simplified below to one book for brevity):
   
   <books>
      <book>
        <author>O.-J. Dahl</author>
        <title binding="hardcover" subcategory="non-fiction">Structured Programming</title>
        <category>PROGRAMMING</category>
        <year>1972</year>
      </book>
    </books>
   
   With dataLevel=2, each book becomes a row in the query output table, and the title attributes will end up correctly in the attributes column as shown on the documentation page.
   
   However, if the top-level item <book> has attributes, these attributes are not captured anywhere within the query output table.
   My data is similar to this, and I need to capture the important attributes of the top-level items in my list. 
   Could they be added to the attributes column?
   
   If the <book> element above had a weight attribute, e.g.: <book weight="0.8">
   then could it be added to the attributes column,  e.g.:  {"book_weight":0.8","title_binding":"hardcover","title_subcategory":"non-fiction"} ?
   


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] KendraKrat commented on issue #2304: XML format plugin misses top-level attributes

Posted by GitBox <gi...@apache.org>.
KendraKrat commented on issue #2304:
URL: https://github.com/apache/drill/issues/2304#issuecomment-911801975


   [books.xml.txt](https://github.com/apache/drill/files/7100004/books.xml.txt)
   
   I created an example file based on the documented example of the books list by adding some attributes to the book elements. It wouldn't let me attach an XML file here so I just appended the .txt extension.
   
   The output below shows that the book attributes aren't captured. Thank you.
   
   +-----------------------------------------------------------------+------------+---------------------------------+-------------+------+-----------------------------------------+
   |                           attributes                            |   author   |              title              |  category   | year |                 authors                 |
   +-----------------------------------------------------------------+------------+---------------------------------+-------------+------+-----------------------------------------+
   | {}                                                              | Mark Twain | The Adventures of Tom Sawyer    | FICTION     | 1876 | {}                                      |
   | {"title_binding":"paperback"}                                   | null       | The Programming Language Pascal | PASCAL      | 1971 | {"author":"Niklaus WirthSomebody else"} |
   | {"title_binding":"hardcover","title_subcategory":"non-fiction"} | O.-J. Dahl | Structured Programming          | PROGRAMMING | 1972 | {}                                      |
   +-----------------------------------------------------------------+------------+---------------------------------+-------------+------+-----------------------------------------+


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] cgivre commented on issue #2304: XML format plugin misses top-level attributes

Posted by GitBox <gi...@apache.org>.
cgivre commented on issue #2304:
URL: https://github.com/apache/drill/issues/2304#issuecomment-911570724


   @KendraKrat Could you please share an example file that isn't working?


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] KendraKrat commented on issue #2304: XML format plugin misses top-level attributes

Posted by GitBox <gi...@apache.org>.
KendraKrat commented on issue #2304:
URL: https://github.com/apache/drill/issues/2304#issuecomment-911824788


   [books-extended.txt](https://github.com/apache/drill/files/7100167/books-extended.txt)
   
   I have extended the example I provided to include an attribute on the outermost books list element as well. In my case, I have attributes on this list element that I would also like to capture and have applied to all of the book elements. However, given that I'm using dataLevel=2 in order to get each book as a separate row in the output table, I think this means you are ignoring the top level books list element, so this may be harder to capture and not fit with your parsing paradigm.


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] cgivre commented on issue #2304: XML format plugin misses top-level attributes

Posted by GitBox <gi...@apache.org>.
cgivre commented on issue #2304:
URL: https://github.com/apache/drill/issues/2304#issuecomment-921871443


   I'm going to see if I can fix this.  This seems pretty straightforward actually... 


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] cgivre commented on issue #2304: XML format plugin misses top-level attributes

Posted by GitBox <gi...@apache.org>.
cgivre commented on issue #2304:
URL: https://github.com/apache/drill/issues/2304#issuecomment-913701875


   Thanks for the issue.  I'll take a look at this. 


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org