Search code examples
javahazelcastpredicatehazelcast-imapin-memory-data-grid

Hazelcast LIKE/ILIKE predicate/query on Integer/Long types


Is there a way to perform ILIKE/LIKE querying on Integer/Long object attributes in Hazelcast's distributed query?

For eg: In postgres, we can query like,

select * from document where CAST(numOfPages AS TEXT) ilike '%2';

to get the documents with total number of pages ending with 2.

Please help me achieve the same scenario for a hazelcast distributed query.


Solution

  • Try a value extractor, http://docs.hazelcast.org/docs/3.10.2/manual/html-single/index.html#custom-attributes

    This would allow you to return the numeric field as a string, and then you can run LIKE upon it.

    Or you could return odd or even, etc