Hello,

This is a known issue.
You can look in the tail to the article [1].

In your case do it like this
select c.* from Company c join table(id bigint = ?) i on c.id = i.id

[1]:
https://apacheignite.readme.io/docs/sql-queries#performance-and-usability-considerations

On Thu, Aug 4, 2016 at 10:02 AM, begineer <redni...@gmail.com> wrote:

> So What I mean is I need to get data from cache which has keys in the list
> I
> pass to query.
> equavalent SQL will be like,
> List list = Arrays.asList(2,3,6);//dynamic list coming from client
>                         StringBuffer queryStrings = new StringBuffer(" ");
>                         for (Object object : list) {
>                                 queryStrings.append("?,");
>                         }
>                         queryStrings.deleteCharAt(queryStrings.length()-1);
>
>                         String sql = "select * from Company where Id in
> (?);
>                         SqlQuery<Integer, Company> query1 =  new
> SqlQuery<>(Company.class, sql);
>                         query1.setArgs(queryStrings.toString());
>
> Here, I can append as many keys to stringbuffer as I want and then pass
> them
> to IN clause. BUt this is not good approach and plus IN will not use
> indexing.
>
> How do I achieve same thing using table JOIN approach you suggested.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Getting-exception-in-SQL-Query-JOINS-tp6674p6732.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov

Reply via email to