You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Valentin Kulichenko <va...@gmail.com> on 2015/09/26 01:39:43 UTC

Fwd: SQL IN operator example

Sergi,

Can you please take a look at this issue? I create a ticket and attached
the test to it: https://issues.apache.org/jira/browse/IGNITE-1552

I already made some debugging and I think the reason is that TableFunction
is parsed as an ordinary Function, so it's columnList field is ignored. As
a result, column identifiers are removed from the map query and this causes
syntax error.

Thanks!

-Val

---------- Forwarded message ----------
From: kevin <ke...@leonardo.com>
Date: Fri, Sep 25, 2015 at 9:21 AM
Subject: SQL IN operator example
To: user@ignite.apache.org


I'm trying the example with the IN operator here.
https://apacheignite.readme.io/docs/sql-queries#performance-and-usability-considerations

This is the code
Integer[] ids = {Integer.valueOf(0), Integer.valueOf(1)};
System.out.println(personCache.query(new SqlFieldsQuery("select p.firstName
from Person p join table(id bigint = ?) i on p.id =
i.id").setArgs(ids)).getAll());

I get this error though
org.apache.ignite.IgniteException: Syntax error in SQL statement "SELECT
    P.FIRSTNAME __C0
FROM TABLE(?[*]1) I
 INNER JOIN PERSON_CACHE.PERSON P
WHERE P.ID = I.ID"; expected "identifier" [42001-175]
        at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:466)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$2.iterator(IgniteH2Indexing.java:777)
        at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:59)
        at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.getAll(QueryCursorImpl.java:71)



--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/SQL-IN-operator-example-tp1493.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.