9 Replies Latest reply on Feb 21, 2014 2:58 PM by Ivan Chan

    Parsing Error for MongoDB schema

    Ivan Chan Apprentice

      I am using Teiid 8.6 and I followed the instruction to create one-2-one mapping, MongoDB Translator - Teiid 8.7 (draft) - Project Documentation Editor.  And I ran into parsing exception.

       

      Here is my simple JSON object:

       

      "addresst" { "_id": 0,

      "name": "Duke Grant",

      "age": 38,

      "gender": "male",

       

      "address": { "_id": 0,

      "street": "345 Burnett Street",

      "city": "Nash",

      "state": "Rhode Island",

      "zip": 7384 }

      }

       

      and I created a schema like the following:

       

      CREATE FOREIGN TABLE addresst (custid integer PRIMARY KEY, name varchar(25), age integer, gender varchar(25)) OPTIONS(UPDATABLE 'TRUE');

      CREATE FOREIGN TABLE address  (custid integer PRIMARY KEY, street varchar(50), city varchar(25), state varchar(25), zipcode varchar(6), FOREIGN KEY (custId) REFERENCES addresst (custid),) OPTIONS(UPDATABLE 'TRUE', teiid_mongo:MERGE 'addresst');

       

      And I kept getting the following exception:


      Caused by: org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "custid),[*])[*] OPTIONS(" at line 1, column 324.  Was expecting: "constraint" | "foreign" | "primary" | "unique" | "index" | "accesspattern"
              at org.teiid.query.parser.QueryParser.convertParserException(QueryParser.java:214)
              ... 162 more

       

      Did I do something wrong?

       

      Thanks,

       

      - Ivan C.