Hi Val,
Yes, I do the change as you suggest.
Now, the tables is the following:
School:
id
name
address
1
xxx
aaa
Class:
id
name
number
schoolID
1
yyy
bbb
1
Student:
id
name
sex
schoolID
classID
1
zzz
male
1
1
And the cache keys are the following:
SchoolKey
{
private int id;
}
ClassKey
{
private int id;
@AffinityKeyMapped
private int schoolID;
}
StudentKey
{
private int id;
private int classID;
@AffinityKeyMapped
private int schoolID;
}
Now, This guarantee
that class data and student data linked to a particular school resides on
the same node.
But, I want to query like this:
select * from school, class, student where student.id = school.id and
student.id = class.id and school.id = 1 and class.id = 1;
This query want to find all the students in school 1 and class 1.
In Ignite, the data linked to school 1 resides on the same node, but the
students in class 1 may not be in the same node,
because the classID is not affinity key.
So, can the query work right?
Thanks for reply again.
Bob
From: vkulichenko
Date: 2016-07-28 08:01
To: [email protected]
Subject: Re: Re: SQL join query return different result under the same data
when having different ignite instance.
Hi Bob,
In this example Class table should also have schoolId field and schoolId
should be used as the affinity key for all three types. This will guarantee
that all data linked to a particular school resides on the same node.
-Val
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/SQL-join-query-return-different-result-under-the-same-data-when-having-different-ignite-instance-tp6433p6575.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential
and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of
this communication is
not the intended recipient, unauthorized use, forwarding, printing, storing,
disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this
communication in error,please
immediately notify the sender by return e-mail, and delete the original message
and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------