[teiid-issues] [JBoss JIRA] (TEIID-2958) MongoDB: Put nested JSON documents in one single table

Ramesh Reddy (JIRA) issues at jboss.org
Wed May 14 09:45:57 EDT 2014


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

Ramesh Reddy commented on TEIID-2958:
-------------------------------------

The enhancement I asked to log is to remove the need to add customer id in the address nested document. The above in only issue when dealing with the importing metadata from existing documents in the mongodb. However, the prior issue needs to be solved before this can be considered

> MongoDB:  Put nested JSON documents in one single table
> -------------------------------------------------------
>
>                 Key: TEIID-2958
>                 URL: https://issues.jboss.org/browse/TEIID-2958
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: Misc. Connectors
>    Affects Versions: 8.7
>         Environment: MongoDB with Teiid
>            Reporter: Ivan Chan
>            Assignee: Steven Hawkins
>              Labels: teiid
>
> Currently, it seems like ID needs to be appear in parent and child for nested documents.  But it is unlikely a case for MongoDB customers.  It would be nice if Teiid can flatten out data in one single table.  Therefore, users would not need to insert parent id in the child document in order for Teiid to work.
> I am thinking the following case.  For example I have a JSON object like this:
>  
> Customer
> {
>   _id: 1374932,
>   FirstName: "John",
>   LastName: "Doe",
>   Address:
>      {
>        _id: 43839430,
>         Street: "123 Lane",
>         City: "New York",
>         State: "NY",
>         Zipcode: "12345"
>      }
> }
>  
> In this case, customer._id doesn't exist inside Address.  There is no way to do join in regular SQL fashion.  But it would be nice if teiid can put the column from parent and child into a single table.  Maybe something similar to the following schema:
> CREATE FOREIGN TABLE  Customer (
>     CustomerId integer PRIMARY KEY,
>     FirstName varchar(25),
>     LastName varchar(25),
>     address__id integer,
>     address_Street varchar(50),
>     address_City varchar(25),
>     address_State varchar(25),
>     address_Zipcode varchar(6),
> ) OPTIONS(UPDATABLE 'TRUE');



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the teiid-issues mailing list