You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Kenan Dalley <ke...@gm.com> on 2017/10/23 16:57:19 UTC

Ignite/Cassandra failing to use supplied value for where clause

I've got to be missing something simple here, but I'm having trouble with
Ignite calling C* with the POJO key that I'm supplying it when it tries to
"cache.get".  Whenever I try to supply the "cache.get" method with my POJO
key, it complains that it's null when it tries to execute the CQL.  I've
included a link to my project below.

This is the call in the application:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final Test1 value3 = cache.get(new
Test1Key("test123"));

With Test1Key as:


Exception Thrown
*java.lang.IllegalStateException: Failed to execute CommandLineRunner*	at
org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:779)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]	at
org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]	at
org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]	at
com.gm.examples.cassandra_persistence_store.Application.main(Application.java:55)
[classes/:na]*Caused by: javax.cache.integration.CacheLoaderException: class
org.apache.ignite.IgniteException: Failed to execute Cassandra CQL
statement: select "column_1", "column_2", "column_3", "column_4",
"column_5", "column_6", "column_7", "column_8", "column_9" from
"dev_qlty"."test1" where "my_id"=?;*	at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:282)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:418)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:384)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2024)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2022)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6608)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:959)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
~[ignite-core-2.2.0.jar:2.2.0]	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
~[na:1.8.0_92]	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
~[na:1.8.0_92]	at java.lang.Thread.run(Thread.java:745)
~[na:1.8.0_92]*Caused by: org.apache.ignite.IgniteException: Failed to
execute Cassandra CQL statement: select "column_1", "column_2", "column_3",
"column_4", "column_5", "column_6", "column_7", "column_8", "column_9" from
"dev_qlty"."test1" where "my_id"=?;*	at
org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:185)
~[ignite-cassandra-store-2.2.0.jar:2.2.0]	at
org.apache.ignite.cache.store.cassandra.CassandraCacheStore.load(CassandraCacheStore.java:189)
~[ignite-cassandra-store-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
~[ignite-core-2.2.0.jar:2.2.0]	at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:316)
~[ignite-core-2.2.0.jar:2.2.0]	... 11 common frames omitted*Caused by:
org.apache.ignite.IgniteException: Failed to execute Cassandra CQL
statement: select "column_1", "column_2", "column_3", "column_4",
"column_5", "column_6", "column_7", "column_8", "column_9" from
"dev_qlty"."test1" where "my_id"=?;*	at
org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:167)
~[ignite-cassandra-store-2.2.0.jar:2.2.0]	... 14 common frames omittedCaused
by: com.datastax.driver.core.exceptions.InvalidQueryException: Invalid null
value in condition for column my_id	at
com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63)
~[cassandra-driver-core-3.0.0.jar:na]	at
org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:144)
~[ignite-cassandra-store-2.2.0.jar:2.2.0]	... 14 common frames
omitted*Caused by:
com.datastax.driver.core.exceptions.InvalidQueryException: Invalid null
value in condition for column my_id*	at
com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:43)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:798)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:617)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1005)
~[cassandra-driver-core-3.0.0.jar:na]	at
com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:928)
~[cassandra-driver-core-3.0.0.jar:na]	at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
~[netty-handler-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
~[netty-codec-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)
~[netty-codec-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)
~[netty-codec-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
~[netty-transport-4.0.33.Final.jar:4.0.33.Final]	at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
~[netty-common-4.0.33.Final.jar:4.0.33.Final]	... 1 common frames omitted
Attached IntelliJ project
(replace the C* server name & keyspace/pw to run - I also did not include
the Ignite jars that are referenced with "systemPath")
test_cassandra.zip
<http://apache-ignite-users.70518.x6.nabble.com/file/t653/test_cassandra.zip>  



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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
Ok.  The "transient" keyword was the issue.  It was a holdover from something
else (a previous example that I was using as my basis for this), most
likely.

Here are the results from the run once I removed "transient" from all of the
fields in both Test1Key & Test1:

>>> Read from C* (get).  Key: [{Test1Key: {myId: test123}}], Value: [{Test1:
>>> {column1: 1, column2: Mon Oct 23 08:57:00 CDT 2017, column3: 1, column4:
>>> Mon Oct 23 08:57:00 CDT 2017, column5: 1, column6: Test, column7: 2017,
>>> column8: tesT, column9: 1}}]


Thanks for your help, Andrew.



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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Why Test1Key.id field is transient?
Will it works if you remove transient modifier?

Also, please check if you get value for key with 'null' id field.

On Thu, Nov 9, 2017 at 5:49 PM, Kenan Dalley <ke...@gm.com> wrote:

> I don't see how because this is what's in the table. And the code
> specifically sets the "myId" to a value before it runs.
>
> [image: DataStax CQL Results]
> ------------------------------
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
I don't see how because this is what's in the table.  And the code
specifically sets the "myId" to a value before it runs.

<http://apache-ignite-users.70518.x6.nabble.com/file/t653/Datastax_CQL_Results.png> 



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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
I can't reproduce the issue.
Is it possible you try to get value for key with 'null' id field?

On Fri, Nov 3, 2017 at 5:28 AM, Kenan Dalley <ke...@gm.com> wrote:

> Hi Andrey,
>
> I tried taking pieces from your example and I still couldn't make it work.
> First, I removed the annotations out of the POJOs and physically mapped the
> information in the persistence settings. Still got the error with "my_id".
> Second, I tried adding the QueryEntity xml config you had. Again, still got
> the null error with "my_id". Below, I'm going to post the bare-minimum that
> I'm trying to get to work without any extra coding and see if anyone can
> duplicate, or fix, what I'm doing.
>
>
> Also, I noticed that you're putting data into the cache and then pulling
> it out. I am specifically trying not to do that. I'm trying to get Ignite
> to pull data from C* into the cache directly with a cache-miss (basically,
> the cache is empty when trying to get the data). I cannot assume that the
> data is already there.
>
> ================================= Error
>
> [21:41:05] Ignite node stopped OK [uptime=00:00:02:833]
> Exception in thread "main" javax.cache.integration.CacheLoaderException: class org.apache.ignite.IgniteException: Failed to execute Cassandra CQL statement: select "column_1", "column_2", "column_3", "column_4", "column_5", "column_6", "column_7", "column_8", "column_9" from "dev_qlty"."test1" where "my_id"=?;
> 	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
> 	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:282)
> 	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:418)
> 	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:384)
> 	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2024)
> 	at org.apache.ignite.internal.processors.cache.GridCacheAdapter$15.call(GridCacheAdapter.java:2022)
> 	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6608)
> 	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:959)
> 	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: class org.apache.ignite.IgniteException: Failed to execute Cassandra CQL statement: select "column_1", "column_2", "column_3", "column_4", "column_5", "column_6", "column_7", "column_8", "column_9" from "dev_qlty"."test1" where "my_id"=?;
> 	at org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:185)
> 	at org.apache.ignite.cache.store.cassandra.CassandraCacheStore.load(CassandraCacheStore.java:189)
> 	at org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
> 	at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:316)
> 	... 11 more
> Caused by: class org.apache.ignite.IgniteException: Failed to execute Cassandra CQL statement: select "column_1", "column_2", "column_3", "column_4", "column_5", "column_6", "column_7", "column_8", "column_9" from "dev_qlty"."test1" where "my_id"=?;
> 	at org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:167)
> 	... 14 more
> Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Invalid null value in condition for column my_id
> 	at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
> 	at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
> 	at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
> 	at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63)
> 	at org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:144)
> 	... 14 more
> Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Invalid null value in condition for column my_id
> 	at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
> 	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
> 	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
> 	at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:43)
> 	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:798)
> 	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:617)
> 	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1005)
> 	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:928)
> 	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
> 	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
> 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
> 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)
> 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
> 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
> 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
> 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
> 	... 1 more
>
> ================================= Application.java
>
>
> public class Application {
>     public static void main(String... args) {
>         System.out.println(">>> Cassandra cache store Test1 example started.");
>         try (Ignite ignite = Ignition.start("cassandra-ignite.xml")) {
>             try (IgniteCache<Test1Key, Test1> cache = ignite.cache(Test1.class.getSimpleName())) {
>                 Test1Key test1Key = new Test1Key("test123");
>                 final Test1 value3 = cache.get(test1Key);
>                 System.out.println(
>                         String.format(">>> Read from C* (get).  Key: [%s], Value: [%s]", test1Key, value3));
>             }
>             System.out.println(StringUtils.EMPTY);
>         }
>     }
> }
>
> Test1.java
>
> package com.gm.test_cassandra.model;
>
> import java.util.Date;
>
> public class Test1 {
>
>     public Test1() {
>     }
>
>     /*
>         column_1 text,
>         column_2 timestamp,
>         column_3 text,
>         column_4 timestamp,
>         column_5 text,
>         column_6 text,
>         column_7 int,
>         column_8 text,
>         column_9 text
>     */
>     //    @QuerySqlField(name = "column_1")
>     private transient String column1;
>
>     //    @QuerySqlField(name = "column_2")
>     private transient Date column2;
>
>     //    @QuerySqlField(name = "column_3")
>     private transient String column3;
>
>     //    @QuerySqlField(name = "column_4")
>     private transient Date column4;
>
>     //    @QuerySqlField(name = "column_5")
>     private transient String column5;
>
>     //    @QuerySqlField(name = "column_6")
>     private transient String column6;
>
>     //    @QuerySqlField(name = "column_7")
>     private transient int column7;
>
>     //    @QuerySqlField(name = "column_8")
>     private transient String column8;
>
>     //    @QuerySqlField(name = "column_9")
>     private transient String column9;
>
>     public String getColumn1() {
>         return column1;
>     }
>
>     public void setColumn1(String column1) {
>         this.column1 = column1;
>     }
>
>     public Date getColumn2() {
>         return column2;
>     }
>
>     public void setColumn2(Date column2) {
>         this.column2 = column2;
>     }
>
>     public String getColumn3() {
>         return column3;
>     }
>
>     public void setColumn3(String column3) {
>         this.column3 = column3;
>     }
>
>     public Date getColumn4() {
>         return column4;
>     }
>
>     public void setColumn4(Date column4) {
>         this.column4 = column4;
>     }
>
>     public String getColumn5() {
>         return column5;
>     }
>
>     public void setColumn5(String column5) {
>         this.column5 = column5;
>     }
>
>     public String getColumn6() {
>         return column6;
>     }
>
>     public void setColumn6(String column6) {
>         this.column6 = column6;
>     }
>
>     public int getColumn7() {
>         return column7;
>     }
>
>     public void setColumn7(int column7) {
>         this.column7 = column7;
>     }
>
>     public String getColumn8() {
>         return column8;
>     }
>
>     public void setColumn8(String column8) {
>         this.column8 = column8;
>     }
>
>     public String getColumn9() {
>         return column9;
>     }
>
>     public void setColumn9(String column9) {
>         this.column9 = column9;
>     }
>
>     @Override
>     public String toString() {
>         final StringBuilder sb = new StringBuilder();
>         sb.append("{");
>         sb.append(Test1.class.getSimpleName() + ": {");
>         sb.append("column1: ");
>         sb.append(this.column1);
>         sb.append(", column2: ");
>         sb.append(this.column2);
>         sb.append(", column3: ");
>         sb.append(this.column3);
>         sb.append(", column4: ");
>         sb.append(this.column4);
>         sb.append(", column5: ");
>         sb.append(this.column5);
>         sb.append(", column6: ");
>         sb.append(this.column6);
>         sb.append(", column7: ");
>         sb.append(this.column7);
>         sb.append(", column8: ");
>         sb.append(this.column8);
>         sb.append(", column9: ");
>         sb.append(this.column9);
>         sb.append("}}");
>         return sb.toString();
>     }
> }
>
> Test1Key.java
>
> package com.gm.test_cassandra.model;
>
> public class Test1Key {
>
>     public Test1Key() {
>     }
>
>     //Partition Key
>     //    @QuerySqlField(index = true, name = "my_id")
>     private transient String myId;
>
>     public Test1Key(final String myId) {
>         this.myId = myId;
>     }
>
>     public String getMyId() {
>         return myId;
>     }
>
>     public void setMyId(final String myId) {
>         this.myId = myId;
>     }
>
>     @Override
>     public String toString() {
>         final StringBuilder sb = new StringBuilder();
>         sb.append("{");
>         sb.append(Test1Key.class.getSimpleName() + ": {");
>         sb.append("myId: ");
>         sb.append(this.myId);
>         sb.append("}}");
>         return sb.toString();
>     }
> }
>
> ignite.xml
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one or more
>   contributor license agreements.  See the NOTICE file distributed with
>   this work for additional information regarding copyright ownership.
>   The ASF licenses this file to You under the Apache License, Version 2.0
>   (the "License"); you may not use this file except in compliance with
>   the License.  You may obtain a copy of the License at
>
>        http://www.apache.org/licenses/LICENSE-2.0
>
>   Unless required by applicable law or agreed to in writing, software
>   distributed under the License is distributed on an "AS IS" BASIS,
>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>   See the License for the specific language governing permissions and
>   limitations under the License.
> -->
>
> <!--
>     Ignite configuration with all defaults and enabled p2p deployment and enabled events.
> -->
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>     <!-- Cassandra connection settings -->
>     <import resource="classpath:cassandra-connection-settings.xml" />
>
>     <bean id="test1Cache_persistence_settings" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
>         <constructor-arg type="org.springframework.core.io.Resource" value="classpath:test1-cassandra-persistence-settings.xml" />
>     </bean>
>
>     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
>         <!-- Set to true to enable distributed class loading for examples, default is false. -->
>         <property name="peerClassLoadingEnabled" value="true"/>
>
>         <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
>         <property name="discoverySpi">
>             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>                 <property name="ipFinder">
>                     <!--
>                         Ignite provides several options for automatic discovery that can be used
>                         instead os static IP based discovery. For information on all options refer
>                         to our documentation: http://apacheignite.readme.io/docs/cluster-config
>                     -->
>                     <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
>                     <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
>                     <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
>                         <property name="addresses">
>                             <list>
>                                 <!-- In distributed environment, replace with actual host IP address. -->
>                                 <value>127.0.0.1:47500..47509<
> /value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>         <property name="cacheConfiguration">
>             <list>
>                 <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="Test1" />
>                     <property name="readThrough" value="true" />
>                     <property name="writeThrough" value="true" />
>                     <!-- <property name="writeBehindEnabled" value="true" /> -->
>                     <property name="cacheStoreFactory">
>                         <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
>                             <!-- Datasource configuration bean which is responsible for Cassandra connection details -->
>                             <property name="dataSourceBean" value="cassandraDataSource" />
>                             <!-- Persistent settings bean which is responsible for the details of how objects will be persisted to Cassandra -->
>                             <property name="persistenceSettingsBean" value="test1Cache_persistence_settings" />
>                         </bean>
>                     </property>
>                     <property name="queryEntities">
>                         <list>
>                             <bean class="org.apache.ignite.cache.QueryEntity">
>                                 <property name="keyType" value="com.gm.test_cassandra.model.Test1Key"/>
>                                 <property name="valueType" value="com.gm.test_cassandra.model.Test1"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="column1" value="java.lang.String"/>
>                                         <entry key="column2" value="java.util.Date"/>
>                                         <entry key="column3" value="java.lang.String"/>
>                                         <entry key="column4" value="java.util.Date"/>
>                                         <entry key="column5" value="java.lang.String"/>
>                                         <entry key="column6" value="java.lang.String"/>
>                                         <entry key="column7" value="java.lang.Integer"/>
>                                         <entry key="column8" value="java.lang.String"/>
>                                         <entry key="column9" value="java.lang.String"/>
>                                     </map>
>                                 </property>
>                             </bean>
>                         </list>
>                     </property>
>                 </bean>
>             </list>
>         </property>
>     </bean>
> </beans>
>
> test1-cassandra-persistence-settings.xml
>
> <persistence keyspace="dev_qlty" table="keyspace" ttl="2592000">
>     <keyPersistence class="com.gm.test_cassandra.model.Test1Key" strategy="POJO">
>         <partitionKey>
>             <field name="myId" column="my_id" />
>         </partitionKey>
>     </keyPersistence>
>     <valuePersistence class="com.gm.test_cassandra.model.Test1" strategy="POJO">
>         <field name="column1" column="column_1" />
>         <field name="column2" column="column_2" />
>         <field name="column3" column="column_3" />
>         <field name="column4" column="column_4" />
>         <field name="column5" column="column_5" />
>         <field name="column6" column="column_6" />
>         <field name="column7" column="column_7" />
>         <field name="column8" column="column_8" />
>         <field name="column9" column="column_9" />
>     </valuePersistence>
> </persistence>
>
> cassandra-connection-settings.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:util="http://www.springframework.org/schema/util"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd
>         http://www.springframework.org/schema/util
>         http://www.springframework.org/schema/util/spring-util.xsd">
>
>     <bean id="loadBalancingPolicy" class="com.datastax.driver.core.policies.TokenAwarePolicy">
>         <constructor-arg type="com.datastax.driver.core.policies.LoadBalancingPolicy">
>             <bean class="com.datastax.driver.core.policies.RoundRobinPolicy"/>
>         </constructor-arg>
>     </bean>
>
>     <util:list id="contactPoints" value-type="java.lang.String">
>         <value>server-name</value>
>     </util:list>
>
>     <bean id="cassandraDataSource" class="org.apache.ignite.cache.store.cassandra.datasource.DataSource">
>         <property name="contactPoints" ref="contactPoints"/>
>         <property name="user" value="keyspace"/>
>         <property name="password" value="keyspace_pw"/>
>         <property name="readConsistency" value="ONE"/>
>         <property name="writeConsistency" value="ONE"/>
>         <property name="loadBalancingPolicy" ref="loadBalancingPolicy"/>
>     </bean>
> </beans>
>
>
> ------------------------------
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
Hi Andrey,

I tried taking pieces from your example and I still couldn't make it work. 
First, I removed the annotations out of the POJOs and physically mapped the
information in the persistence settings.  Still got the error with "my_id". 
Second, I tried adding the QueryEntity xml config you had.  Again, still got
the null error with "my_id".  Below, I'm going to post the bare-minimum that
I'm trying to get to work without any extra coding and see if anyone can
duplicate, or fix, what I'm doing.


Also, I noticed that you're putting data into the cache and then pulling it
out.  I am specifically trying not to do that.  I'm trying to get Ignite to
pull data from C* into the cache directly with a cache-miss (basically, the
cache is empty when trying to get the data).  I cannot assume that the data
is already there.

=================================
Error
=================================
Application.java
Test1.java
Test1Key.java
ignite.xml
test1-cassandra-persistence-settings.xml
cassandra-connection-settings.xml




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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Got it.

Seems, CassandraStore doesn't supports storeKeepBinary(true) flag.

On Wed, Nov 1, 2017 at 8:04 PM, Andrey Mashenkov <andrey.mashenkov@gmail.com
> wrote:

> Hi Kenan,
>
> Looks like annotation configuration is not allowed together with xml
> comfiguration.
> I wonder there was no Exception. I've made an example with all mapping
> configured in xml and got no errors.
>
> Please, check an example that workable for me [1].
>
>
> [1] https://github.com/AMashenkov/ignite-with-cassandra-sample1
>
> On Fri, Oct 27, 2017 at 6:20 PM, Kenan Dalley <ke...@gm.com> wrote:
>
>> So can someone try to take my example and actually get it to work?  It's
>> baffling to me why this fails as it does.
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>
>
>
> --
> Best regards,
> Andrey V. Mashenkov
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Hi Kenan,

Looks like annotation configuration is not allowed together with xml
comfiguration.
I wonder there was no Exception. I've made an example with all mapping
configured in xml and got no errors.

Please, check an example that workable for me [1].


[1] https://github.com/AMashenkov/ignite-with-cassandra-sample1

On Fri, Oct 27, 2017 at 6:20 PM, Kenan Dalley <ke...@gm.com> wrote:

> So can someone try to take my example and actually get it to work?  It's
> baffling to me why this fails as it does.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
So can someone try to take my example and actually get it to work?  It's
baffling to me why this fails as it does.



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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
Yeah, sorry about the confusion.  I was playing around with the field names
to see if that was a possible issue and had refactored the "Test1Key.id"
field to "Test1Key.myId".  It should have been "myId" originally since the
column name was "my_id" (see the updated Test1Key below).

I'm just not getting this to work.  The "IndexedType" pair example only
deals with a Primitive (Long) key to a POJO (Person) and not the POJO
(Test1Key) key to a POJO (Test1).  Nothing that I am doing is getting this
to use the "test123" actual value being sent in instead of the "null" value
that it's using when attempting to execute the CQL.  I've tried with
String/Test1Key and Test1Key/Test1 and I've tried it with only
String/Test1Key and I've tried it with Test1Key/Test1 and without doing the
IndexedTypes.  Nothing has worked.  I continue to get the error:

Caused by: org.apache.ignite.IgniteException: Failed to execute Cassandra
CQL statement: select "column_1", "column_2", "column_3", "column_4",
"column_5", "column_6", "column_7", "column_8", "column_9" from
"dev_qlty"."test1" where "my_id"=?;Caused by:
com.datastax.driver.core.exceptions.InvalidQueryException: Invalid null
value in condition for column my_id


Application.java updates
Test1Key.java
cassandra-ignite.xml updates
I've tried with just the top QueryEntity xml and with both below with the
Java code using the ".cache" instead of ".getOrCreateCache(config)".



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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Kenan,

I've found there is an issue that can cause unexpected behavior when using
Cassandra keyPersistence configuration with Ignite annotations [1].
But XML way should work.

I'm confused as in first message you wrote Test1Key has 'id' field, in last
message it has 'my_id' field and 'myId' in mapping?
Is it possible to have same field name in Ignite and Cassandra? or
configure proper alias for field in QueryEntity configuration?


[1] https://issues.apache.org/jira/browse/IGNITE-6280

On Wed, Oct 25, 2017 at 4:27 PM, Kenan Dalley <ke...@gm.com> wrote:

> I don't understand what the reasoning behind manually setting the
> IndexedType pair in the configuration. Yes, this is a field that is
> indexed, but the problem is that it's not correctly pulling the data from
> C* and it's worked in the past with other C* tables/caches via @Annotation
> without the need to manually set it. Also, based on the changes that I
> made, it didn't make any difference manually setting the IndexedType pair:
> either by Java or by XML. I may not have set it up correctly, though. Note:
> I did not have both the XML and the Java configuration set at the same
> time. I had one or the other and neither worked. By Java in
> Application.java.test1() method
>
>     private void test1() {
>         System.out.println(">>> Cassandra cache store Test1 example started.");
>         CacheConfiguration<Test1Key, Test1> config = new CacheConfiguration<>(Application.TEST1_CACHE_NAME);
>         config.setIndexedTypes(String.class, Test1Key.class);
>         try (IgniteCache<Test1Key, Test1> cache = this.ignite
> //                .cache(Application.TEST1_CACHE_NAME)) {
>                 .getOrCreateCache(config)) {
>
> By XML in cassandra-ignite.xml
>
>
>                 <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="Test1" />
>                     <property name="readThrough" value="true" />
>                     <property name="writeThrough" value="true" />
>                     <!-- <property name="writeBehindEnabled" value="true" /> -->
>                     <property name="cacheStoreFactory">
>                         <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
>                             <!-- Datasource configuration bean which is responsible for Cassandra connection details -->
>                             <property name="dataSourceBean" value="cassandraDataSource" />
>                             <!-- Persistent settings bean which is responsible for the details of how objects will be persisted to Cassandra -->
>                             <property name="persistenceSettingsBean" value="test1Cache_persistence_settings" />
>                         </bean>
>                     </property>
>                     <property name="queryEntities">
>                         <list>
>                             <bean class="org.apache.ignite.cache.QueryEntity">
>                                 <property name="keyType" value="java.lang.String"/>
>                                 <property name="valueType" value="com.gm.test_cassandra.model.Test1Key"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="myId" value="java.lang.String"/>
>                                     </map>
>                                 </property>
>                                 <property name="indexes">
>                                     <list>
>                                         <bean class="org.apache.ignite.cache.QueryIndex">
>                                             <constructor-arg value="myId"/>
>                                         </bean>
>                                     </list>
>                                 </property>
>                             </bean>
>                         </list>
>                     </property>
>                 </bean>
>
>
> ------------------------------
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
I don't understand what the reasoning behind manually setting the IndexedType
pair in the configuration.  Yes, this is a field that is indexed, but the
problem is that it's not correctly pulling the data from C* and it's worked
in the past with other C* tables/caches via @Annotation without the need to
manually set it.  Also, based on the changes that I made, it didn't make any
difference manually setting the IndexedType pair: either by Java or by XML. 
I may not have set it up correctly, though.Note: I did not have both the XML
and the Java configuration set at the same time.  I had one or the other and
neither worked.
By Java in Application.java.test1() method
By XML in cassandra-ignite.xml




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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Kenan,

You can try to set IndexedType pair to cache configuration [1] to force
Ignite process annotations on Key\Value classes.

[1]
https://apacheignite.readme.io/docs/indexes#section-registering-indexed-types

On Tue, Oct 24, 2017 at 11:00 PM, Kenan Dalley <ke...@gm.com> wrote:

> These were included in the project file link in the initial post. Here
> they are in text for reference. The only thing not posted is the pom.xml
> and it's just standard SpringBoot Ignite w/ Cassandra.
> cassandra-ignite.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one or more
>   contributor license agreements.  See the NOTICE file distributed with
>   this work for additional information regarding copyright ownership.
>   The ASF licenses this file to You under the Apache License, Version 2.0
>   (the "License"); you may not use this file except in compliance with
>   the License.  You may obtain a copy of the License at
>
>        http://www.apache.org/licenses/LICENSE-2.0
>
>   Unless required by applicable law or agreed to in writing, software
>   distributed under the License is distributed on an "AS IS" BASIS,
>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>   See the License for the specific language governing permissions and
>   limitations under the License.
> -->
>
> <!--
>     Ignite configuration with all defaults and enabled p2p deployment and enabled events.
> -->
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>     <!-- Cassandra connection settings -->
>     <import resource="classpath:cassandra-connection-settings.xml" />
>
>     <bean id="test1Cache_persistence_settings" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
>         <constructor-arg type="org.springframework.core.io.Resource" value="classpath:test1-cassandra-persistence-settings.xml" />
>     </bean>
>
>     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
>         <!-- Set to true to enable distributed class loading for examples, default is false. -->
>         <property name="peerClassLoadingEnabled" value="true"/>
>
>         <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
>         <property name="discoverySpi">
>             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>                 <property name="ipFinder">
>                     <!--
>                         Ignite provides several options for automatic discovery that can be used
>                         instead os static IP based discovery. For information on all options refer
>                         to our documentation: http://apacheignite.readme.io/docs/cluster-config
>                     -->
>                     <!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
>                     <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
>                     <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
>                         <property name="addresses">
>                             <list>
>                                 <!-- In distributed environment, replace with actual host IP address. -->
>                                 <value>127.0.0.1:47500..47509</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>         <property name="cacheConfiguration">
>             <list>
>                 <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="Test1" />
>                     <property name="readThrough" value="true" />
>                     <property name="writeThrough" value="true" />
>                     <!-- <property name="writeBehindEnabled" value="true" /> -->
>                     <property name="cacheStoreFactory">
>                         <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
>                             <!-- Datasource configuration bean which is responsible for Cassandra connection details -->
>                             <property name="dataSourceBean" value="cassandraDataSource" />
>                             <!-- Persistent settings bean which is responsible for the details of how objects will be persisted to Cassandra -->
>                             <property name="persistenceSettingsBean" value="test1Cache_persistence_settings" />
>                         </bean>
>                     </property>
>                 </bean>
>             </list>
>         </property>
>     </bean>
> </beans>
>
> test1-cassandra-persistence-settings.xml
>
> <persistence keyspace="keyspace" table="test1" ttl="2592000">
>     <keyPersistence class="com.gm.test_cassandra.model.Test1Key" strategy="POJO" />
>     <valuePersistence class="com.gm.test_cassandra.model.Test1" strategy="POJO" />
> </persistence>
>
> cassandra-connection-settings.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:util="http://www.springframework.org/schema/util"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd
>         http://www.springframework.org/schema/util
>         http://www.springframework.org/schema/util/spring-util.xsd">
>
>     <bean id="loadBalancingPolicy" class="com.datastax.driver.core.policies.TokenAwarePolicy">
>         <constructor-arg type="com.datastax.driver.core.policies.LoadBalancingPolicy">
>             <bean class="com.datastax.driver.core.policies.RoundRobinPolicy"/>
>         </constructor-arg>
>     </bean>
>
>     <util:list id="contactPoints" value-type="java.lang.String">
>         <value>server-name</value>
>     </util:list>
>
>     <bean id="cassandraDataSource" class="org.apache.ignite.cache.store.cassandra.datasource.DataSource">
>         <property name="contactPoints" ref="contactPoints"/>
>         <property name="user" value="keyspace"/>
>         <property name="password" value="keyspace_pw"/>
>         <property name="readConsistency" value="ONE"/>
>         <property name="writeConsistency" value="ONE"/>
>         <property name="loadBalancingPolicy" ref="loadBalancingPolicy"/>
>     </bean>
> </beans>
>
> Test1Key.java
>
> package com.gm.test_cassandra.model;
>
> import org.apache.ignite.cache.query.annotations.QuerySqlField;
>
> public class Test1Key {
>
>     //Partition Key
>     @QuerySqlField(index = true, groups = {"test1_PK"}, name = "my_id")
>     private transient String my_id;
>
>     public Test1Key() {
>     }
>
>     public Test1Key(final String my_id) {
>         this.my_id = my_id;
>     }
>
>     public String getMy_id() {
>         return my_id;
>     }
>
>     public void setMy_id(final String my_id) {
>         this.my_id = my_id;
>     }
>
>     @Override
>     public boolean equals(final Object o) {
>         if (this == o) {
>             return true;
>         }
>
>         if (!(o instanceof Test1Key)) {
>             return false;
>         }
>
>         final Test1Key other = (Test1Key) o;
>
>         if (this.my_id != null ? !this.my_id.equals(other.my_id) : other.my_id != null) {
>             return false;
>         }
>         return true;
>     }
>
>     @Override
>     public int hashCode() {
>         return this.my_id != null ? this.my_id.hashCode() : 0;
>     }
>
>     @Override
>     public String toString() {
>         final StringBuilder sb = new StringBuilder();
>         sb.append("{");
>         sb.append(Test1Key.class.getSimpleName() + ": {");
>         sb.append("my_id: ");
>         sb.append(this.my_id);
>         sb.append("}}");
>         return sb.toString();
>     }
> }
>
> Test1.java
>
> package com.gm.test_cassandra.model;
>
> import java.util.Date;
> import org.apache.ignite.cache.query.annotations.QuerySqlField;
>
> public class Test1 {
>
>     /*
>         column_1 text,
>         column_2 timestamp,
>         column_3 text,
>         column_4 timestamp,
>         column_5 text,
>         column_6 text,
>         column_7 int,
>         column_8 text,
>         column_9 text
>     */
>     @QuerySqlField(name = "column_1")
>     private transient String column1;
>
>     @QuerySqlField(name = "column_2")
>     private transient Date column2;
>
>     @QuerySqlField(name = "column_3")
>     private transient String column3;
>
>     @QuerySqlField(name = "column_4")
>     private transient Date column4;
>
>     @QuerySqlField(name = "column_5")
>     private transient String column5;
>
>     @QuerySqlField(name = "column_6")
>     private transient String column6;
>
>     @QuerySqlField(name = "column_7")
>     private transient int column7;
>
>     @QuerySqlField(name = "column_8")
>     private transient String column8;
>
>     @QuerySqlField(name = "column_9")
>     private transient String column9;
>
>     public Test1() {
>     }
>
>     public String getColumn1() {
>         return column1;
>     }
>
>     public void setColumn1(String column1) {
>         this.column1 = column1;
>     }
>
>     public Date getColumn2() {
>         return column2;
>     }
>
>     public void setColumn2(Date column2) {
>         this.column2 = column2;
>     }
>
>     public String getColumn3() {
>         return column3;
>     }
>
>     public void setColumn3(String column3) {
>         this.column3 = column3;
>     }
>
>     public Date getColumn4() {
>         return column4;
>     }
>
>     public void setColumn4(Date column4) {
>         this.column4 = column4;
>     }
>
>     public String getColumn5() {
>         return column5;
>     }
>
>     public void setColumn5(String column5) {
>         this.column5 = column5;
>     }
>
>     public String getColumn6() {
>         return column6;
>     }
>
>     public void setColumn6(String column6) {
>         this.column6 = column6;
>     }
>
>     public int getColumn7() {
>         return column7;
>     }
>
>     public void setColumn7(int column7) {
>         this.column7 = column7;
>     }
>
>     public String getColumn8() {
>         return column8;
>     }
>
>     public void setColumn8(String column8) {
>         this.column8 = column8;
>     }
>
>     public String getColumn9() {
>         return column9;
>     }
>
>     public void setColumn9(String column9) {
>         this.column9 = column9;
>     }
>
>     @Override
>     public boolean equals(final Object o) {
>         if (this == o) {
>             return true;
>         }
>
>         if (!(o instanceof Test1)) {
>             return false;
>         }
>
>         final Test1 other = (Test1) o;
>
>         if (this.column1 != null ? !this.column1.equals(other.column1) : other.column1 != null) {
>             return false;
>         }
>
>         if (this.column2 != null ? !this.column2.equals(other.column2) : other.column2 != null) {
>             return false;
>         }
>
>         if (this.column3 != null ? !this.column3.equals(other.column3) : other.column3 != null) {
>             return false;
>         }
>
>         if (this.column4 != null ? !this.column4.equals(other.column4) : other.column4 != null) {
>             return false;
>         }
>
>         if (this.column5 != null ? !this.column5.equals(other.column5) : other.column5 != null) {
>             return false;
>         }
>
>         if (this.column6 != null ? !this.column6.equals(other.column6) : other.column6 != null) {
>             return false;
>         }
>
>         if (!(this.column7 == other.column7)) {
>             return false;
>         }
>
>         if (this.column8 != null ? !this.column8.equals(other.column8) : other.column8 != null) {
>             return false;
>         }
>
>         if (this.column9 != null ? !this.column9.equals(other.column9) : other.column9 != null) {
>             return false;
>         }
>
>         return true;
>     }
>
>     @Override
>     public int hashCode() {
>         int res = this.column1 != null ? this.column1.hashCode() : 0;
>         res = (31 * res) + (this.column2 != null ? this.column2.hashCode() : 0);
>         res = (31 * res) + (this.column3 != null ? this.column3.hashCode() : 0);
>         res = (31 * res) + (this.column4 != null ? this.column4.hashCode() : 0);
>         res = (31 * res) + (this.column5 != null ? this.column5.hashCode() : 0);
>         res = (31 * res) + (this.column6 != null ? this.column6.hashCode() : 0);
>         res = (31 * res) + (this.column7);
>         res = (31 * res) + (this.column8 != null ? this.column8.hashCode() : 0);
>         res = (31 * res) + (this.column9 != null ? this.column9.hashCode() : 0);
>         return res;
>     }
>
>     @Override
>     public String toString() {
>         final StringBuilder sb = new StringBuilder();
>         sb.append("{");
>         sb.append(Test1.class.getSimpleName() + ": {");
>         sb.append("column1: ");
>         sb.append(this.column1);
>         sb.append(", column2: ");
>         sb.append(this.column2);
>         sb.append(", column3: ");
>         sb.append(this.column3);
>         sb.append(", column4: ");
>         sb.append(this.column4);
>         sb.append(", column5: ");
>         sb.append(this.column5);
>         sb.append(", column6: ");
>         sb.append(this.column6);
>         sb.append(", column7: ");
>         sb.append(this.column7);
>         sb.append(", column8: ");
>         sb.append(this.column8);
>         sb.append(", column9: ");
>         sb.append(this.column9);
>         sb.append("}}");
>         return sb.toString();
>     }
> }
>
> Application.java
>
> package com.gm.test_cassandra;
>
> import org.apache.commons.lang3.StringUtils;
> import org.apache.ignite.Ignite;
> import org.apache.ignite.IgniteCache;
> import org.springframework.beans.factory.annotation.Autowired;
> import org.springframework.boot.Banner;
> import org.springframework.boot.CommandLineRunner;
> import org.springframework.boot.SpringApplication;
> import org.springframework.boot.autoconfigure.SpringBootApplication;
>
> import com.gm.test_cassandra.model.Test1;
> import com.gm.test_cassandra.model.Test1Key;
>
> @SpringBootApplication
> public class Application implements CommandLineRunner {
>     /**
>      * Cache name.
>      */
>     private static final String TEST1_CACHE_NAME = Test1.class.getSimpleName();
>
>     private static Test1Key test1Key = new Test1Key("test123");
>
>     @Autowired
>     Ignite ignite;
>
>     public static void main(String... args) {
>         SpringApplication app = new SpringApplication(Application.class);
>         app.setBannerMode(Banner.Mode.OFF);
>         app.run(args);
>         System.exit(0);
>     }
>
>     @Override
>     public void run(String... strings) throws Exception {
>         test1();
>     }
>
>     private void test1() {
>         System.out.println(">>> Cassandra cache store Test1 example started.");
>         try (IgniteCache<Test1Key, Test1> cache = this.ignite
>                 .cache(Application.TEST1_CACHE_NAME)) {
>
> //            System.out.println(StringUtils.EMPTY);
> //            System.out.println("Loading cache...");
> //
> //            cache.loadCache(null,
> //                            "select * from dev_qlty.test1 ");// +
> //                            //" where my_id = 'test123';");
> //            System.out.println(StringUtils.EMPTY);
> //            System.out.println("Cache size: " + cache.size());
> //
> //            Iterable<Cache.Entry<Test1Key, Test1>> entries = cache.localEntries();
> //            Iterator<Cache.Entry<Test1Key, Test1>> it = entries.iterator();
> //            System.out.println(StringUtils.EMPTY);
> //            System.out.println("Entries...");
> //            while (it.hasNext()) {
> //                Cache.Entry<Test1Key, Test1> entry = it.next();
> //                System.out.println("Key: " + entry.getKey()+ ", Value: " + entry.getValue());
> //            }
>
>             // Read from C*
>             System.out.println(StringUtils.EMPTY);
>             System.out.println(">>> Cache retrieve Vehicle example started.");
>
>             // Get with skipStore, Get with Store, Get with skipStore
> //            final Vehicle value1 = cache.withSkipStore().get(Application.test2Key);
> //            System.out.println(
> //                    String.format(">>> Read from C* (get - skipStore => expect \"null\" result).  Key: [%s], Value: [%s]", Application.test1Key,
> //                                  value1));
> //            final Vehicle value3 = cache.get(Application.test1Key);
>             final Test1 value3 = cache.get(new Test1Key("test123"));
>             System.out.println(
>                     String.format(">>> Read from C* (get).  Key: [%s], Value: [%s]", Application.test1Key,
>                                   value3));
>
>             final Test1 value5 = cache.withSkipStore().get(Application.test1Key);
>             System.out.println(
>                     String.format(">>> Read from C* (get - skipStore => expect actual result).  Key: [%s], Value: [%s]",
>                                   Application.test1Key,
>                                   value5));
>         }
>         System.out.println(StringUtils.EMPTY);
>     }
> }
>
> ApplicationConfig.java
>
> package com.gm.test_cassandra.config;
>
> import org.apache.ignite.Ignite;
> import org.apache.ignite.Ignition;
> import org.springframework.context.annotation.Bean;
> import org.springframework.context.annotation.Configuration;
>
> @Configuration
> public class ApplicationConfig {
>     @Bean
>     public Ignite ignite() {
>         return Ignition.start("cassandra-ignite.xml");
>     }
> }
>
>
> ------------------------------
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
These were included in the project file link in the initial post.  Here they
are in text for reference.  The only thing not posted is the pom.xml and
it's just standard SpringBoot Ignite w/ Cassandra.
cassandra-ignite.xml
test1-cassandra-persistence-settings.xml
cassandra-connection-settings.xml
Test1Key.java
Test1.java
Application.java
ApplicationConfig.java




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

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Andrey Mashenkov <an...@gmail.com>.
Hi Kenan,

Seems, column mapping is missed.
You mix annotation configuration via @QuerySqlField annotation and creating
table via "CREATE TABLE". I'm not sure it can work this way.

Seems, you have neither QueryEntities configured nor IndexedTypes to Ignite
can process annotations and know about id<->my_id mapping.
Would you please share cache configuration?


On Mon, Oct 23, 2017 at 8:03 PM, Kenan Dalley <ke...@gm.com> wrote:

> Here's the C* setup:
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov

Re: Ignite/Cassandra failing to use supplied value for where clause

Posted by Kenan Dalley <ke...@gm.com>.
Here's the C* setup:





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