-
1. Re: Parsing Error for MongoDB schema
shawkins Feb 19, 2014 8:45 PM (in response to ichanjasper)It looks to be complaining about the trailing comma "(custid),)". Generally our parser does not like having an extra comma at the end of a list of items.
-
2. Re: Parsing Error for MongoDB schema
rareddy Feb 20, 2014 9:03 AM (in response to shawkins)Ivan,
I also fixed few issues with MongoDB translator in 8.7, so I recommend using the 8.7 Beta 1 version or later.
Ramesh..
-
3. Re: Parsing Error for MongoDB schema
ichanjasper Feb 20, 2014 2:00 PM (in response to shawkins)After I removed the extra comma, it still doesn't work. Now I get the following exception:
Caused by: org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered "'TRUE', teiid_mongo[*]:[*]MERGE 'addresst'" at line 1, column 362.
Was expecting: "false" | "null" | "true" | "unknown" | <ESCAPEDTYPE> | <DECIMALVAL> | <FLOATVAL> | <STRINGVAL> | <UNSIGNEDINTEGER> | <BINARYSTRINGVAL> ...
at org.teiid.query.parser.QueryParser.convertParserException(QueryParser.java:214)
... 162 more
Here is my schema:
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');
Btw, maybe you guys should remove the "extra comma" in your document, too.
MongoDB Translator - Teiid 8.7 (draft) - Project Documentation Editor
-
4. Re: Parsing Error for MongoDB schema
shawkins Feb 20, 2014 3:06 PM (in response to ichanjasper)> After I removed the extra comma, it still doesn't work
Namespacing is not quite a first class citizen, so the key needs to be quoted when it contains a : - "teiid_mongo:MERGE"
> Btw, maybe you guys should remove the "extra comma" in your document, too
Absolutely. I'll go through the doc and see what additional corrections need to be made.
-
5. Re: Re: Parsing Error for MongoDB schema
rareddy Feb 20, 2014 3:11 PM (in response to ichanjasper)Ivan,
You should define the namespace qualifier in quotes. For ex:
OPTIONS(UPDATABLE 'TRUE', "teiid_mongo:MERGE" 'addresst');
I updated the examples in this page MongoDB Translator - Teiid 8.7
Ramesh..
-
6. Re: Re: Parsing Error for MongoDB schema
ichanjasper Feb 20, 2014 4:58 PM (in response to rareddy)I got the schema to work and it is able to query back the result. However, I found a few bugs. For example, I can't query "street" and "city", or "gender and state" in 1 query. It gives me exception. I will file bug later. Thanks for your help.
-
7. Re: Re: Parsing Error for MongoDB schema
rareddy Feb 20, 2014 7:15 PM (in response to ichanjasper)Ivan,
I have seen some issues with JOIN processing in the 8.6 version, I fixed TEIID-2845, TEIID-2843, TEIID-2841, TEIID-2839, TEIID-2838, TEIID-2830, in 8.7 so check with that version first if that solves your issues.
Ramesh..
-
8. Re: Re: Parsing Error for MongoDB schema
ichanjasper Feb 20, 2014 8:56 PM (in response to rareddy)Sure. I will try with Teiid 8.7 Beta tomorrow. Thanks.
-
9. Re: Re: Parsing Error for MongoDB schema
ichanjasper Feb 21, 2014 2:58 PM (in response to rareddy)I just tried it with Teiid 8.7 Beta. And the problems are gone! You guys are awesome! Thank you!