-
Notifications
You must be signed in to change notification settings - Fork 186
Function support for IS/IS NOT in WHERE clause #344
Function support for IS/IS NOT in WHERE clause #344
Conversation
src/main/java/com/amazon/opendistroforelasticsearch/sql/parser/WhereParser.java
Show resolved
Hide resolved
src/test/java/com/amazon/opendistroforelasticsearch/sql/esintgtest/SQLFunctionsIT.java
Outdated
Show resolved
Hide resolved
@Test | ||
public void functionAbsInWhereClauseWithIsNullTest() { | ||
JSONObject response = executeJdbcRequest( | ||
"SELECT age FROM " + TEST_INDEX_ACCOUNT + " WHERE (ABS(balance) IS NULL)" |
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.
So all your IT use TEST_INDEX_ACCOUNT
index for testing, I wonder is there any document in this index missing balance
or firstname
field? Because I recall the painless scripts we generate are unable to handle missing field (#308), I assume your IT actually doesn't cover the typical use of IS NULL
or IS NOT NULL
.
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.
Good point- I'll look for/create an index with some missing field values
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.
One suggestion, instead of create new index, could we consider using the existing index. I think there are already 10+ different indices in place.
// Assert.assertThat( | ||
// response.getJSONArray("datarows") | ||
// .getJSONArray(i).get(0), | ||
// equalTo(expectedOutput[i])); | ||
System.out.println(response.getJSONArray("datarows").getJSONArray(i).getString(0)); |
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.
Please remove it.
Issue #, if available:
#341
Description of changes:
Adding support for usage of functions with the IS/IS NOT keywords in the WHERE clause.
Example query:
SELECT dayOfWeek FROM kibana_sample_data_flights WHERE ABS(balance) IS NOT NULL
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.