ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: The result of cross-cache SQL joins is incomplete.
Date Mon, 02 Nov 2015 09:34:01 GMT
> I compared the SQL querys between yours and mine, and I found something
different. 
> For your SQL query "emp.depid = dep.id", dep.id is primary key of table
> Department. 
> But for my SQL query "A.mid = B.mid", B.mid is NOT primary key of table B. 

Actually, I've provided you with the example that shows how you can
collocate entries that belong to 3 different tables.

After the collocation has been done properly you can freely and safely use
any kind of parameters in your SQL queries (like A.mid = B.mid).

So you should properly collocate A and B before. Just as an example. 
A a = new A(aPrimaryKey);
B b = new B(bPrimaryKey);

cacheA.put(a.aPrimaryKey, a);

cacheB.put(new AffinityKey(a.primaryKey, b.primaryKey), b);

As you see above when we put the 'b' object to the cache we use a special
kind of key - AffinityKey. It will guarantee that this 'b' object will be
placed on the same node where the object 'a' with a.primaryKey is located.
After that all the queries should work fine for you.

If you still have difficulties with this please provide us with exact
objects and the list of their keys. We will try to help you to collocate
them properly.

 




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/The-result-of-cross-cache-SQL-joins-is-incomplete-tp1723p1807.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message