Re: Date compare fetch in the Query

2016-03-02 Thread vkulichenko
NPE is a known issue and it's already fixed. You can build from master and
check if it works for you.

As for the original issue, can you provide the full test code? Also did you
deploy classes on server nodes?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3348.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Date compare fetch in the Query

2016-03-02 Thread sujay...@ymail.com
Just wanted share solution i found on the exception:

javax.cache.CacheException: Failed to run reduce query locally. 


by putting *limit* to the Query i was able to fetch the data





--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3339.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Date compare fetch in the Query

2016-03-01 Thread sujay...@ymail.com
*Config:*

CacheConfiguration  cacheConfig = new
CacheConfiguration<>(cacheName);
cacheConfig.setCacheMode(CacheMode.PARTITIONED);
cacheConfig.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);

cacheConfig.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new
Duration(TimeUnit.MINUTES, 40)));
cacheConfig.setEvictionPolicy(new LruEvictionPolicy(2500));
cacheConfig.setOffHeapMaxMemory(0);
cacheConfig.setSwapEnabled(false);
cacheConfig.setBackups(1);
cacheConfig.setStoreKeepBinary(false);
//cacheConfig.setWriteBehindEnabled(true);

cacheConfig.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheConfig.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cacheConfig.setIndexedTypes(String.class, Container.class);

*Model Object:*

public class Container implements Serializable {

private static final long serialVersionUID = 1L;

@QuerySqlField
private String key;

@QuerySqlField
private Long counter;

private String objectType;

@QuerySqlField
private Date updatedDate;

private byte[] data;




This is the Code Details i am using, i am not getting exception..I tired
with other Fields also Filter is not working at all

code is running as Client Mode, I have one Ignite Server running in other
linux machine



And I tried other SqlQuery options, those also failing with Below Exception:
/*
select * from PB_PRICE.Container where counter >= 1456885117000 and counter
<= 1456885127000*/

javax.cache.CacheException: Failed to run reduce query locally.
Total Count:0
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:673)
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$2.iterator(IgniteH2Indexing.java:956)
at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:61)
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$3.iterator(IgniteH2Indexing.java:990)
at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.iterator(QueryCursorImpl.java:61)
at
org.apache.ignite.internal.processors.cache.QueryCursorImpl.getAll(QueryCursorImpl.java:73)
at 
com.staples.catalog.dal.DataAccessLayer.getAll(DataAccessLayer.java:97)
at 
com.staples.catalog.service.CacheService.getAll(CacheService.java:124)
at
com.staples.catalog.processor.CacheProcessor.getAll(CacheProcessor.java:67)
at com.staples.catalog.api.CacheApi.getAll(CacheApi.java:67)
at
com.staples.catalog.main.price.pb.TestPBTimeFetch.execute(TestPBTimeFetch.java:58)
at
com.staples.catalog.main.price.pb.TestPBTimeFetch.main(TestPBTimeFetch.java:45)
Caused by: java.lang.NullPointerException
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndexUnsorted$1.hasNext(GridMergeIndexUnsorted.java:97)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndex$IteratorCursor.next(GridMergeIndex.java:327)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMergeIndex$FetchingCursor.next(GridMergeIndex.java:358)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.query(GridReduceQueryExecutor.java:614)
... 11 more 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3328.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Date compare fetch in the Query

2016-03-01 Thread vkulichenko
Can you provide the full test that you're running? Did you check the logs for
exceptions?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3326.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Date compare fetch in the Query

2016-03-01 Thread sujay...@ymail.com
No Filter is not happening

p.getUpdatedDate().before(get1HourBefore())  --- Both are java.util.Date
Objects



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3322.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Date compare fetch in the Query

2016-03-01 Thread vkulichenko
Hi,

Can query itself doesn't do any comparisons, it simply calls the filter you
provided. Does this happen?

Did you verify that the filter is implemented correctly (e.g., that
get1HourBefore() returns the correct value for comparison)?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Date-compare-fetch-in-the-Query-tp3308p3315.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.