-
1. Re: TEIID16012 and TEIID16011 while retrieving data from View
rareddy Jul 28, 2015 12:25 PM (in response to jayeshgarg)Does your "TrainFileView" view has Primary Key defined? OData requires PK defined on all tables and views.
-
2. Re: TEIID16012 and TEIID16011 while retrieving data from View
jayeshgarg Jul 29, 2015 4:53 AM (in response to rareddy)Hi Ramesh,
Thanks for the info. I added the Primary Key and was able to make a jdbc call to query the data but not via odbc. Below are the queries I used to fetch the data via jdbc:
SELECT * FROM LinkFileTrain.TrainFileView where train_id='29d3cdbe-a9d3-4119-9066-a07fb07fea97'
and via the odbc
Also, If I want to fetch all the data from Cassandra, which is my underlying database, I have to pass "ALLOW FILTERING" in the query string. How can I do that via Teiid? My requirement is to join both the tables and get the complete data rather than quering for individual records.
Thanks,
Jayesh
-
3. Re: TEIID16012 and TEIID16011 while retrieving data from View
rareddy Jul 29, 2015 9:57 AM (in response to jayeshgarg)Jayesh,
I think you meant OData not ODBC right?
The query using the OData needs to be like
{code}
{code}
For learning the OData query syntax read some articles here Getting Started · OData - the Best Way to REST you can also read the OData specification to learn all about OData.
BTW, Teiid currently supports both OData Version 2 as well as OData version 4 (just introduced). The same query for V4 in Teiid looks like
{code}
{code}
Now for your Cassandra question, Teiid should automatically add this (if it is designed as such), if not it may take a code modification in Cassandra translator to do so. Two join two tables, are these two tables in Cassandra or in different databases? Right now it looks like Cassandra translator is not written to handle joins inside Cassandra. This may be due to Cassandra not supporting way to retrieve data from two entities, or Teiid translator has not written that way. I am not sure of Cassandra capabilities right now.
However, in either case if you have written view table in Teiid for your join, Teiid will combine the data for you and will give you a single resultset.
Ramesh..