How sql works for near cache

classic Classic list List threaded Threaded
5 messages Options
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

How sql works for near cache

If I run sql with out where condition on near caches, query will hit server
node correct ? It wont fetch from near cache in local node. Is this a true
statement?

Ex: select _key from cachename;



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: How sql works for near cache

Hi,

Near cache makes sense only for key-value access, SQL doesn't work with near caches at all.

Evgenii

вт, 3 дек. 2019 г. в 04:20, Hemambara <[hidden email]>:
If I run sql with out where condition on near caches, query will hit server
node correct ? It wont fetch from near cache in local node. Is this a true
statement?

Ex: select _key from cachename;



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: How sql works for near cache

Is there any way we can get complete keyset or values from a near cache.
Something like cache.keyset()



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: How sql works for near cache

Hello!

You can use cache.localEntries(CachePeekMode.NEAR);

Regards,
--
Ilya Kasnacheev


ср, 4 дек. 2019 г. в 02:36, Hemambara <[hidden email]>:
Is there any way we can get complete keyset or values from a near cache.
Something like cache.keyset()



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Stanislav Lukyanov Stanislav Lukyanov
Reply | Threaded
Open this post in threaded view
|

Re: How sql works for near cache

In reply to this post by Hemambara
Not out of the box but you could use SQL or ScanQuery for that.

With SQL:
    SELECT _key FROM mycache
(given that your cache is SQL-enabled).

With ScanQuery:
    cache.query(new ScanQuery(), Cache.Entry::getKey)
(may need to fix type errors to compile this)

Stan

On Wed, Dec 4, 2019 at 2:36 AM Hemambara <[hidden email]> wrote:
Is there any way we can get complete keyset or values from a near cache.
Something like cache.keyset()



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/