Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Function support for IS/IS NOT in WHERE clause #344

Closed
wants to merge 4 commits into from
Closed

Function support for IS/IS NOT in WHERE clause #344

wants to merge 4 commits into from

Conversation

davidcui1225
Copy link
Contributor

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.

@Test
public void functionAbsInWhereClauseWithIsNullTest() {
JSONObject response = executeJdbcRequest(
"SELECT age FROM " + TEST_INDEX_ACCOUNT + " WHERE (ABS(balance) IS NULL)"
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Comment on lines +346 to +350
// Assert.assertThat(
// response.getJSONArray("datarows")
// .getJSONArray(i).get(0),
// equalTo(expectedOutput[i]));
System.out.println(response.getJSONArray("datarows").getJSONArray(i).getString(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants