ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Re: The result of cross-cache SQL joins is incomplete.
Date Thu, 29 Oct 2015 05:32:13 GMT
On Wed, Oct 28, 2015 at 7:48 PM, iceguo <guoht@ffcs.cn> wrote:

> In the above example, there is only 1 join condition in the SQL,
> ”Person.orgid = Organization.id “,
> we can collocate Persons with their organizations by setting
> “Person.key = new AffinityKey<>(Person.id, Person.orgid)".
> But if my join SQL including more than 1 join conditions. such as:
> "select Person.firstName from Person, \"OrganizationCache\".Organization
> where Person.orgid = Organization.id and Person.firstName =
> Organization.name”.

I think in the example you are providing it should be always enough to
colocate on one field, say “orgId”, and the 2nd join criteria should
automatically work in colocated fashion.

It is also possible to have compound affinity keys (keys that are based on
more than one field), if it makes sense for you. For example, you can have
a CompoundKey class with ID and NAME fields, and then have both, Person and
Organization colocate based on this class.

Hope this helps.

> How to collocate Persons with their organizations?
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/The-result-of-cross-cache-SQL-joins-is-incomplete-tp1723p1754.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message