ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: Multiple cache in a single query
Date Tue, 08 Nov 2016 04:44:07 GMT
Hi,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to user-subscribe@ignite.apache.org and follow simple instructions in
the reply.


nsarvar wrote
> I have multiple caches:
*
> IgniteCache&lt;String, WikiPage&gt; stmCache1 =
> ignite.getOrCreateCache(CacheConfig.wordCache("node1"));
> IgniteCache&lt;String, WikiPage&gt; stmCache2 =
> ignite.getOrCreateCache(CacheConfig.wordCache("node2"));
> IgniteCache&lt;String, WikiPage&gt; stmCache3 =
> ignite.getOrCreateCache(CacheConfig.wordCache("node3"));
*
> How can I get their results in a single query?
*
> SqlFieldsQuery top10Qry = new SqlFieldsQuery("select CURTIME(), pageName
> from WikiPage");
> List&lt;List&lt;?&gt;> result = stmCache1.query(top10Qry).getAll();
*
> 
> By this way, I need to get results for each cache seperately.

You can use UNION in your SQL query and it will solve this problem. However,
why do you have multiple caches with the same data type in the first place?
Is there any particular reason?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Multiple-cache-in-a-single-query-tp8751p8760.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message