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

Commit 9ccffc6

Browse files
chloe-zhpenghuojoshuali925jordanw-bq
authored
Bumped ES and Kibana versions to v7.9.0 (#697)
* Bug fix, support long type for aggregation (#522) * Bug fix, support long type for aggregation * change to datetime to JDBC format * Opendistro Release 1.9.0 (#532) * prepare odfe 1.9 * Fix all ES 7.8 compile and build errors * Revert changes as Lombok is working now * Update CustomExternalTestCluster.java * Fix license headers check * Use splitFieldsByMetadata to separate fields when calling SearchHit constructor * More fixes for ODFE 1.9 * Remove todo statement * Add ODFE 1.9.0 release notes * Rename release notes to use 4 digit versions (#547) * Revert changes ahead of develop branch in master (#551) * Revert "Rename release notes to use 4 digit versions (#547)" This reverts commit 33c6d3e. * Revert "Opendistro Release 1.9.0 (#532)" This reverts commit 254f2e0. * Revert "Bug fix, support long type for aggregation (#522)" This reverts commit fb2ed91. * Merge all SQL repos and adjust workflows (#549) (#554) * merge all sql repos * fix test and build workflows * fix workbench and odbc path * fix workbench and odbc path * restructure workbench dir and fix workflows * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * revert workbench directory structure * fix workbench workflow * fix workbench workflow * fix workbench workflow * fix workbench workflow * update workbench workflow for release * Delete .github/ in sql-workbench directory * Add cypress to sql-workbench * Sync latest ODBC commits * Sync latest workbench commits (will add cypress in separate PR) * Add ignored ODBC libs * add date and time support (#560) * add date and time support * update doc * update doc * Revert "add date and time support (#560)" (#567) This reverts commit 4b33a2f. * add error details for all server communication errors (#645) - add null check to avoid crashing if details not initialized * Revert "add error details for all server communication errors (#645)" (#653) This reverts commit c11125d. * upgrade to es7.9.0 and kibana7.9.0 * update lockfile Co-authored-by: Peng Huo <[email protected]> Co-authored-by: Joshua <[email protected]> Co-authored-by: Joshua Li <[email protected]> Co-authored-by: Jordan Wilson <[email protected]>
1 parent 96ab275 commit 9ccffc6

File tree

21 files changed

+504
-502
lines changed

21 files changed

+504
-502
lines changed

build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
buildscript {
1717
ext {
18-
es_version = "7.8.0"
18+
es_version = "7.9.0"
1919
}
2020

2121
repositories {
@@ -43,12 +43,12 @@ repositories {
4343
}
4444

4545
ext {
46-
opendistroVersion = '1.9.0'
46+
opendistroVersion = '1.10.0'
4747
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
4848
}
4949

5050
allprojects {
51-
version = "${opendistroVersion}.1"
51+
version = "${opendistroVersion}.0"
5252

5353
plugins.withId('java') {
5454
sourceCompatibility = targetCompatibility = "1.8"

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# permissions and limitations under the License.
1414
#
1515

16-
version=1.9.0
16+
version=1.10.0

integ-test/src/test/java/com/amazon/opendistroforelasticsearch/sql/legacy/RestIntegTestCase.java

-9
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public void setUpIndices() throws Exception {
8080
initClient();
8181
}
8282

83-
increaseScriptMaxCompilationsRate();
8483
init();
8584
}
8685

@@ -154,14 +153,6 @@ protected synchronized void loadIndex(Index index) throws IOException {
154153
}
155154
}
156155

157-
/**
158-
* Increase script.max_compilations_rate to large enough, which is only 75/5min by default.
159-
* This issue is due to our painless script not using params passed to compiled script.
160-
*/
161-
private void increaseScriptMaxCompilationsRate() throws IOException {
162-
updateClusterSetting("script.max_compilations_rate", "10000/1m", false);
163-
}
164-
165156
/**
166157
* Provide for each test to load test index, data and other setup work
167158
*/

integ-test/src/test/java/com/amazon/opendistroforelasticsearch/sql/legacy/SQLIntegTestCase.java

-10
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public void setUpIndices() throws Exception {
8181
initClient();
8282
}
8383

84-
increaseScriptMaxCompilationsRate();
8584
enableNewQueryEngine();
8685
init();
8786
}
@@ -141,15 +140,6 @@ public static void cleanUpIndices() throws IOException {
141140
wipeAllClusterSettings();
142141
}
143142

144-
/**
145-
* Increase script.max_compilations_rate to large enough, which is only 75/5min by default.
146-
* This issue is due to our painless script not using params passed to compiled script.
147-
*/
148-
private void increaseScriptMaxCompilationsRate() throws IOException {
149-
updateClusterSettings(
150-
new ClusterSetting("transient", "script.max_compilations_rate", "10000/1m"));
151-
}
152-
153143
private void enableNewQueryEngine() throws IOException {
154144
boolean isEnabled = Boolean.parseBoolean(System.getProperty("enableNewEngine", "false"));
155145
if (isEnabled) {

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/executor/join/ElasticJoinExecutor.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.elasticsearch.common.text.Text;
3636
import org.elasticsearch.common.unit.TimeValue;
3737
import org.elasticsearch.common.xcontent.XContentBuilder;
38+
import org.elasticsearch.index.mapper.MapperService;
3839
import org.elasticsearch.rest.BytesRestResponse;
3940
import org.elasticsearch.rest.RestChannel;
4041
import org.elasticsearch.rest.RestStatus;
@@ -219,7 +220,8 @@ protected SearchHit createUnmachedResult(List<Field> secondTableReturnedFields,
219220

220221
Map<String, DocumentField> documentFields = new HashMap<>();
221222
Map<String, DocumentField> metaFields = new HashMap<>();
222-
SearchHit.splitFieldsByMetadata(hit.getFields(), documentFields, metaFields);
223+
hit.getFields().forEach((fieldName, docField) ->
224+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
223225
SearchHit searchHit = new SearchHit(docId, unmatchedId, unamatchedType, documentFields, metaFields);
224226

225227
searchHit.sourceRef(hit.getSourceRef());

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/executor/join/HashJoinElasticExecutor.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.common.document.DocumentField;
3030
import org.elasticsearch.common.text.Text;
3131
import org.elasticsearch.common.unit.TimeValue;
32+
import org.elasticsearch.index.mapper.MapperService;
3233
import org.elasticsearch.index.query.BoolQueryBuilder;
3334
import org.elasticsearch.index.query.QueryBuilders;
3435
import org.elasticsearch.search.SearchHit;
@@ -185,7 +186,8 @@ private List<SearchHit> createCombinedResults(TableInJoinRequestBuilder secondTa
185186

186187
Map<String, DocumentField> documentFields = new HashMap<>();
187188
Map<String, DocumentField> metaFields = new HashMap<>();
188-
SearchHit.splitFieldsByMetadata(matchingHit.getFields(), documentFields, metaFields);
189+
matchingHit.getFields().forEach((fieldName, docField) ->
190+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
189191
SearchHit searchHit = new SearchHit(matchingHit.docId(), combinedId,
190192
new Text(matchingHit.getType() + "|" + secondTableHit.getType()),
191193
documentFields, metaFields);
@@ -245,7 +247,8 @@ private void createKeyToResultsAndFillOptimizationStructure(
245247
//int docid , id
246248
Map<String, DocumentField> documentFields = new HashMap<>();
247249
Map<String, DocumentField> metaFields = new HashMap<>();
248-
SearchHit.splitFieldsByMetadata(hit.getFields(), documentFields, metaFields);
250+
hit.getFields().forEach((fieldName, docField) ->
251+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
249252
SearchHit searchHit = new SearchHit(resultIds, hit.getId(), new Text(hit.getType()), documentFields
250253
, metaFields);
251254
searchHit.sourceRef(hit.getSourceRef());

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.elasticsearch.common.document.DocumentField;
3737
import org.elasticsearch.common.text.Text;
3838
import org.elasticsearch.common.unit.TimeValue;
39+
import org.elasticsearch.index.mapper.MapperService;
3940
import org.elasticsearch.search.SearchHit;
4041
import org.elasticsearch.search.SearchHits;
4142

@@ -176,7 +177,8 @@ private SearchHit getMergedHit(int currentCombinedResults, String t1Alias, Strin
176177
nestedLoopsRequest.getSecondTable().getOriginalSelect().isSelectAll());
177178
Map<String, DocumentField> documentFields = new HashMap<>();
178179
Map<String, DocumentField> metaFields = new HashMap<>();
179-
SearchHit.splitFieldsByMetadata(hitFromFirstTable.getFields(), documentFields, metaFields);
180+
matchedHit.getFields().forEach((fieldName, docField) ->
181+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
180182
SearchHit searchHit = new SearchHit(currentCombinedResults, hitFromFirstTable.getId() + "|"
181183
+ matchedHit.getId(), new Text(hitFromFirstTable.getType() + "|" + matchedHit.getType()),
182184
documentFields, metaFields);

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/executor/multi/MinusExecutor.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.elasticsearch.common.document.DocumentField;
3535
import org.elasticsearch.common.text.Text;
3636
import org.elasticsearch.common.unit.TimeValue;
37+
import org.elasticsearch.index.mapper.MapperService;
3738
import org.elasticsearch.search.SearchHit;
3839
import org.elasticsearch.search.SearchHits;
3940

@@ -136,7 +137,8 @@ private void fillMinusHitsFromOneField(String fieldName, Set<Object> fieldValues
136137
fields.put(fieldName, new DocumentField(fieldName, values));
137138
Map<String, DocumentField> documentFields = new HashMap<>();
138139
Map<String, DocumentField> metaFields = new HashMap<>();
139-
SearchHit.splitFieldsByMetadata(fields, documentFields, metaFields);
140+
someHit.getFields().forEach((field, docField) ->
141+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(field) ? metaFields : documentFields).put(field, docField));
140142
SearchHit searchHit = new SearchHit(currentId, currentId + "", new Text(someHit.getType()),
141143
documentFields, metaFields);
142144
searchHit.sourceRef(someHit.getSourceRef());
@@ -161,7 +163,8 @@ private void fillMinusHitsFromResults(Set<ComperableHitResult> comperableHitResu
161163
SearchHit originalHit = result.getOriginalHit();
162164
Map<String, DocumentField> documentFields = new HashMap<>();
163165
Map<String, DocumentField> metaFields = new HashMap<>();
164-
SearchHit.splitFieldsByMetadata(originalHit.getFields(), documentFields, metaFields);
166+
originalHit.getFields().forEach((fieldName, docField) ->
167+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
165168
SearchHit searchHit = new SearchHit(currentId, originalHit.getId(), new Text(originalHit.getType()),
166169
documentFields, metaFields);
167170
searchHit.sourceRef(originalHit.getSourceRef());

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/executor/multi/UnionExecutor.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.elasticsearch.client.Client;
2525
import org.elasticsearch.common.document.DocumentField;
2626
import org.elasticsearch.common.text.Text;
27+
import org.elasticsearch.index.mapper.MapperService;
2728
import org.elasticsearch.search.SearchHit;
2829
import org.elasticsearch.search.SearchHits;
2930

@@ -68,7 +69,8 @@ private void fillInternalSearchHits(List<SearchHit> unionHits, SearchHit[] hits,
6869
for (SearchHit hit : hits) {
6970
Map<String, DocumentField> documentFields = new HashMap<>();
7071
Map<String, DocumentField> metaFields = new HashMap<>();
71-
SearchHit.splitFieldsByMetadata(hit.getFields(), documentFields, metaFields);
72+
hit.getFields().forEach((fieldName, docField) ->
73+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
7274
SearchHit searchHit = new SearchHit(currentId, hit.getId(), new Text(hit.getType()), documentFields, metaFields);
7375
searchHit.sourceRef(hit.getSourceRef());
7476
searchHit.getSourceAsMap().clear();

legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.common.base.Strings;
2020
import org.elasticsearch.common.document.DocumentField;
2121
import org.elasticsearch.common.text.Text;
22+
import org.elasticsearch.index.mapper.MapperService;
2223
import org.elasticsearch.search.SearchHit;
2324

2425
import java.util.HashMap;
@@ -153,7 +154,8 @@ private Object getValueOfPath(Object source, String path, boolean isIgnoreFirstD
153154
private SearchHit cloneHit(Row<SearchHit> other) {
154155
Map<String, DocumentField> documentFields = new HashMap<>();
155156
Map<String, DocumentField> metaFields = new HashMap<>();
156-
SearchHit.splitFieldsByMetadata(hit.getFields(), documentFields, metaFields);
157+
hit.getFields().forEach((fieldName, docField) ->
158+
(MapperService.META_FIELDS_BEFORE_7DOT8.contains(fieldName) ? metaFields : documentFields).put(fieldName, docField));
157159
SearchHit combined = new SearchHit(
158160
hit.docId(),
159161
hit.getId() + "|" + (other == NULL ? "0" : ((SearchHitRow) other).hit.getId()),

legacy/src/test/java/com/amazon/opendistroforelasticsearch/sql/legacy/util/CheckScriptContents.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import static java.util.Collections.emptyList;
6060
import static org.elasticsearch.search.builder.SearchSourceBuilder.ScriptField;
6161
import static org.junit.Assert.assertTrue;
62+
import static org.mockito.ArgumentMatchers.anyString;
6263
import static org.mockito.Mockito.any;
6364
import static org.mockito.Mockito.doReturn;
6465
import static org.mockito.Mockito.mock;
@@ -255,7 +256,7 @@ public static ClusterService mockClusterService(String mappings) {
255256

256257
public static IndexNameExpressionResolver mockIndexNameExpressionResolver() {
257258
IndexNameExpressionResolver mockResolver = mock(IndexNameExpressionResolver.class);
258-
when(mockResolver.concreteIndexNames(any(), any(), any())).thenAnswer(
259+
when(mockResolver.concreteIndexNames(any(), any(), anyString())).thenAnswer(
259260
(Answer<String[]>) invocation -> {
260261
// Return index expression directly without resolving
261262
Object indexExprs = invocation.getArguments()[2];

sql-cli/src/odfe_sql_cli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
express or implied. See the License for the specific language governing
1313
permissions and limitations under the License.
1414
"""
15-
__version__ = "1.9.0.1"
15+
__version__ = "1.10.0.0"

sql-jdbc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ plugins {
3232
group 'com.amazon.opendistroforelasticsearch.client'
3333

3434
// keep version in sync with version in Driver source
35-
version '1.9.0.1'
35+
version '1.10.0.0'
3636

3737
boolean snapshot = "true".equals(System.getProperty("build.snapshot", "true"));
3838
if (snapshot) {

sql-jdbc/src/main/java/com/amazon/opendistroforelasticsearch/jdbc/internal/Version.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public enum Version {
2020

2121
// keep this in sync with the gradle version
22-
Current(1, 9, 0, 1);
22+
Current(1, 10, 0, 0);
2323

2424
private int major;
2525
private int minor;
Loading
Loading
Loading
Loading
Loading

sql-workbench/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "opendistro-sql-workbench",
3-
"version": "1.9.0.2",
3+
"version": "1.10.0.0",
44
"description": "SQL Workbench",
55
"main": "index.js",
66
"license": "Apache-2.0",
77
"homepage": "https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-workbench",
88
"kibana": {
9-
"version": "7.8.0",
9+
"version": "7.9.0",
1010
"templateVersion": "6.3.3"
1111
},
1212
"repository": {

0 commit comments

Comments
 (0)