Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing - Negative double values comparison causing problem in SQLPredicate #368

Closed
srininara opened this issue Dec 5, 2012 · 0 comments

Comments

Projects
None yet
2 participants
@srininara
Copy link

commented Dec 5, 2012

Hi,
I am trying to use Hazelcast IMap to store Objects which contain attributes (actually down the object graph) which are of Double type. For querying these objects using SQLPredicate on these double values, I have created an index on the same. Like this:
cache.addIndex("address.currentLocation.longitude", false);

When I query this using a SQLPredicate like below everything works well:
new SqlPredicate("address.currentLocation.longitude >= 10 AND address.currentLocation.longitude <= 60")

But as soon as I introduce one of the values as negative the values returned don't match up:
new SqlPredicate("address.currentLocation.longitude >= -10 AND address.currentLocation.longitude <= 60")

Negative zeros also cause the same problem and so does both negative values:
new SqlPredicate("address.currentLocation.longitude >= -0 AND address.currentLocation.longitude <= 60")

Also tried using BETWEEN

new SqlPredicate("address.currentLocation.longitude BETWEEN -10 AND 60")

This can be reproduced consistently. Please refer Google groups post: https://groups.google.com/forum/?fromgroups=#!topic/hazelcast/eoKFo0OscSY

Please let me know when the fix can be done.

  • Srini

@talip talip closed this in 42627a4 Dec 11, 2012

@ghost ghost assigned talip Dec 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.