-
Notifications
You must be signed in to change notification settings - Fork 186
Case functions support: LOWER, UPPER #177
Case functions support: LOWER, UPPER #177
Conversation
"WHERE LOWER(e.lastname)='duke' " + | ||
"GROUP BY UPPER(e.firstname) "; | ||
|
||
System.out.println(executeQuery(query)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I feel that we need codestyle rule for those slips :)
* Generates next id for given method name. The id's are increasing for each method name, so | ||
* nextId("a"), nextId("a"), nextId("b") will return a_1, a_2, b_1 | ||
*/ | ||
public String nextId(String methodName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currently, the methodName is cached in request level. If i am right, does this cached method could be shared by different request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. The SqlFunctions is per-request, and this is instance field
src/main/java/com/amazon/opendistroforelasticsearch/sql/utils/SQLFunctions.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazon/opendistroforelasticsearch/sql/utils/SQLFunctions.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
Issue #128
Description of changes:
Added 2 new functions LOWER and UPPER that receive field name as a first parameter and, potentially, locale
Changed identifier generation strategy to id per function name instead of global id
While I feel that SQLFunctions should be refactored, to expedite the process as of now I'm adding just functions implemented by analogy with trim() and substring() functions
Testing
integration testing, testing via kibana
Itegration tests include ORDER BY and GROUP BY clauses to ensure that everything is working.
Found 2 new issues that will be addressed separately: #176 , #175
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.