-
Notifications
You must be signed in to change notification settings - Fork 273
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
criteria-geode backend toLowerCase/toUpperCase issue #1189
Comments
PR merged. |
Can you pls also check how things behave for enums ? |
Yes, I'll summarize the tests and results below: After inserting the following rows: repository.insert(new Person()
.withId("id1")
.withName("garrett")
.withHobbies(Collections.emptyList()));
repository.insert(new Person()
.withId("id2")
.withName("GARRETT")
.withHobbies(Collections.singletonList("hobby")));
List<Person> results = repository
.find(PersonCriteria.person.name.toLowerCase().is("garrett"))
.fetch(); I tested all combinations of using a
|
Absolutely, I'll do a similar test using enums with/without bind variables, using LOCAL vs PROXY regions |
Also see method invocation from gemfire documentation:
Go figure ... |
It seems that when using the toUpperCase and toLowerCase String operators parentheses are needed like so:
name.toLowerCase()
Here is an example that I drew up to output the translated OQL and show the queries that are not working. I am using this geode version 1.12 docker image to start my locator/server, creating a "person" region, and connecting with the following client example using a "PROXY" region:
Log output with loglevel FINE for criteria:
The following query run from gfsh DOES return expected results (after running the above to insert the two rows). Note the parentheses below vs the above criteria log output:
Interestingly, I ran the same example
Main.java
above using a "LOCAL" region in my example client and I get the expected results, which may explain why this issue was missed:My proposal is to change the below group of unary operators in
GeodeVisitor.java
to include parentheses which works in all cases. I think it makes sense to keep this group together for consistency even though theIterableOpterators.IS_EMPTY
is included and works without parentheses:The text was updated successfully, but these errors were encountered: