[teiid-issues] [JBoss JIRA] Commented: (TEIID-1306) Add support for JSON data sources (JSON translator, JSON-to-table mapping functions).

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Wed Oct 20 13:54:15 EDT 2010


    [ https://jira.jboss.org/browse/TEIID-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558244#action_12558244 ] 

Steven Hawkins commented on TEIID-1306:
---------------------------------------

It was fairly straight-forward to implement the conversion to xml using the ASL2 json-simple library.  While it could be more compact to use attributes, it's easier to do in a streaming fashion with all elements, for example:  

JSON: { "firstName" : "John", "address" : { "street" : "123 Drive" } }
XML with a root name of Person:  <Person><firstName>John</firstName><address><street>123 Drive</street></address></Person> 

The pros of converting to xml is that we only need to introduce a single system function - jsontoxml(Clob json, String rootElementName) - and we get to reuse the existing xml processing logic (rather than choosing from one of the non-standard json path languages), and we'll have the power of XQuery and XPath.

The cons of converting to xml is that: the conversion to XML is non-standard, json keys need sqlxml name escaping, null values come through as empty elements, root JSON arrays will have an additional root element, and there is an increased processing overhead.

> Add support for JSON data sources (JSON translator, JSON-to-table mapping functions).
> -------------------------------------------------------------------------------------
>
>                 Key: TEIID-1306
>                 URL: https://jira.jboss.org/browse/TEIID-1306
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Misc. Connectors
>    Affects Versions: 7.1
>            Reporter: Ken Johnson
>            Assignee: Steven Hawkins
>             Fix For: 7.2
>
>
> Consider adding support in Teiid to consume services (as data sources) that return JSON payloads rather than XML payloads.  This is an increasingly common integration scenario.  The approach used for XML processing seems to be a compatible pattern for this use case.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the teiid-issues mailing list