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

Support mvn build and integration-test for Elasticsearch 7.0.1 #51

Merged
merged 2 commits into from
May 14, 2019

Conversation

penghuo
Copy link
Contributor

@penghuo penghuo commented May 14, 2019

*Issue #, if available: N/A

Description of changes:

  1. Support mvn build and integration-test for Elasticsearch 7.0.1
  2. Fix the opendistro doc link in rpm file.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@penghuo penghuo requested review from jngz-es and arsen-es May 14, 2019 05:37
@@ -86,7 +88,7 @@ public void greaterThan() {
@Test
public void greaterThanOrEqualTo() {
assertThat(
query(SELECT_FROM + "WHERE date_format(insert_time, 'YYYY-MM-dd', 'UTC') >= '2014-08-23' LIMIT 1000"),
query(SELECT_FROM + "WHERE date_format(insert_time, 'yyyy-MM-dd', 'UTC') >= '2014-08-23' LIMIT 2000"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you increase the limits ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The return hits in ES 7.0 is different with ES 6.7. ES 7.0 return value doesn't include "2014-08-24" is limited 1000.

Copy link
Contributor

Choose a reason for hiding this comment

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

But is it the expected behavior? I am ok with updating the test queries as long as we know the test is checking the right thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is the expected behavior. In the test data set, there are 1424 records has insert_time 2014-08-23. With the limit 1000, in ES 6.7, the return hits include record with insert_time as 2014-08-23 and 2014-08-24. But in ES 7.0, with the limit 1000, the result only include insert_time 2014-08-23. I didn't find the doc which mention it, but it seems the ES 7.0 sort the output in order.

"OR date_format(insert_time, 'YYYY-MM-dd', 'UTC') > '2014-08-23'"),
"WHERE date_format(insert_time, 'yyyy-MM-dd', 'UTC') < '2014-08-18' " +
"OR date_format(insert_time, 'yyyy-MM-dd', 'UTC') > '2014-08-23'" +
"ORDER BY insert_time " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you modifying the query (order by) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. There is a "containsInAnyOrder" below, not sure why "order by" here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not necessory, "ORDER BY insert_time" is copied from other integration test. will remove it.

@@ -6,13 +6,13 @@
{"messageTile": "c", "join_field": "parentType"}
{"index":{"_type": "joinType", "_id":"4"}}
{"messageTile": "d", "join_field": "parentType"}
{"index":{"_type": "joinType", "_id":"5", "_routing": "1"}}
{"index":{"_type": "joinType", "_id":"5", "routing": "1"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why renaming _routing to routing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the breaking changes in ES 7.0. The _routing with underscore has been removed.

@@ -257,7 +257,7 @@ public void functionLogs() throws Exception {
@Test
public void functionPow() throws Exception {
String query = "SELECT pow(account_number, 2) as key,"+
"abs(age - 60) as new_age from " + TEST_INDEX_ACCOUNT + "/account limit 1";
"abs(age - 60) as new_age from " + TEST_INDEX_ACCOUNT + "/account WHERE firstname = 'Virginia' and lastname='Ayala' limit 1";
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this change for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the same query, the return hit in ES 7.0 is different with ES 6.7. So I add firstname and lastname to make sure the same hit will be returned.
In case, the test is checking the function of pow. it should be fine.

containsInAnyOrder("2014-08-17")
);
}

@Test
public void lessThanOrEqualTo() {
assertThat(
query(SELECT_FROM + "WHERE date_format(insert_time, 'YYYY-MM-dd', 'UTC') <= '2014-08-18'"),
query(SELECT_FROM + "WHERE date_format(insert_time, 'yyyy-MM-dd', 'UTC') <= '2014-08-18' " +
"ORDER BY insert_time " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Another "order by" should be removed.

Copy link
Contributor

@jngz-es jngz-es left a comment

Choose a reason for hiding this comment

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

Thanks for the changes.

@penghuo penghuo merged commit c082526 into opendistro-for-elasticsearch:master May 14, 2019
@penghuo penghuo deleted the ph-fix-maven-it branch May 14, 2019 22:44
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.

4 participants