ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Kulichenko <valentin.kuliche...@gmail.com>
Subject Fwd: Does Ignite support nested SQL Queries?
Date Tue, 10 Nov 2015 21:56:28 GMT
Sergi,

I tried to execute this query and got an NPE in H2:
https://issues.apache.org/jira/browse/IGNITE-1886. Can you please take a
look?

-Val

---------- Forwarded message ----------
From: ght230 <ght230@163.com>
Date: Tue, Nov 10, 2015 at 8:46 AM
Subject: Re: Does Ignite support nested SQL Queries?
To: user@ignite.apache.org


Hi
I tried the following sub-queries, it seems ignite can not work well.

"SELECT
  a.*
FROM
  (SELECT
    CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id
  FROM
    "UserCache".user u,
    userorder ug
  WHERE u.id = ug.usrid) a,
  (SELECT
    CASE
      WHEN og.goodid < 5
      THEN 100
      ELSE og.goodid
    END id
  FROM
    userorder ug,
    "OrderGoodCache".ordergood og
  WHERE ug.id = og.orderid) b
WHERE a.id = b.id"

information about error as following´╝Ü

Exception in thread "main" javax.cache.CacheException: class
org.apache.ignite.IgniteException: Failed to parse query: SELECT
  a.*
FROM
  (SELECT
    CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id
  FROM
    "UserCache".user u,
    userorder ug
  WHERE u.id = ug.usrid) a,
  (SELECT
    CASE
      WHEN og.goodid < 5
      THEN 100
      ELSE og.goodid
    END id
  FROM
    userorder ug,
    "OrderGoodCache".ordergood og
  WHERE ug.id = og.orderid) b
WHERE a.id = b.id
        at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:636)
        at cn.ffcs.main2.main(main2.java:54)
Caused by: class org.apache.ignite.IgniteException: Failed to parse query:
SELECT
  a.*
FROM
  (SELECT
    CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id
  FROM
    "UserCache".user u,
    userorder ug
  WHERE u.id = ug.usrid) a,
  (SELECT
    CASE
      WHEN og.goodid < 5
      THEN 100
      ELSE og.goodid
    END id
  FROM
    userorder ug,
    "OrderGoodCache".ordergood og
  WHERE ug.id = og.orderid) b
WHERE a.id = b.id
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:641)
        at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:627)
        ... 1 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to parse
query: SELECT
  a.*
FROM
  (SELECT
    CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id
  FROM
    "UserCache".user u,
    userorder ug
  WHERE u.id = ug.usrid) a,
  (SELECT
    CASE
      WHEN og.goodid < 5
      THEN 100
      ELSE og.goodid
    END id
  FROM
    userorder ug,
    "OrderGoodCache".ordergood og
  WHERE ug.id = og.orderid) b
WHERE a.id = b.id
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1510)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:634)
        ... 2 more



--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Does-Ignite-support-nested-SQL-Queries-tp1714p1910.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message