From 030377303e2563835cac5ed9d966355c88e5ea43 Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Thu, 5 Jan 2023 11:43:55 -0800 Subject: [PATCH 1/4] Resolve sub object field in search hit source Signed-off-by: Chen Dai --- .../org/opensearch/sql/legacy/HashJoinIT.java | 19 ++++++ .../sql/legacy/SQLIntegTestCase.java | 4 ++ .../org/opensearch/sql/legacy/TestUtils.java | 5 ++ .../opensearch/sql/legacy/TestsConstants.java | 1 + .../sub_object_index_mapping.json | 27 ++++++++ .../src/test/resources/sub_objects.json | 8 +++ .../physical/node/scroll/SearchHitRow.java | 7 ++ .../node/scroll/SearchHitRowTest.java | 66 +++++++++++++++++++ 8 files changed, 137 insertions(+) create mode 100644 integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json create mode 100644 integ-test/src/test/resources/sub_objects.json create mode 100644 legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java index 284d034cd8..6908e82b1a 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java @@ -9,6 +9,9 @@ import static org.hamcrest.Matchers.equalTo; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_GAME_OF_THRONES; +import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_SUB_OBJECT; +import static org.opensearch.sql.util.MatcherUtils.rows; +import static org.opensearch.sql.util.MatcherUtils.verifyDataRows; import java.io.IOException; import java.util.HashSet; @@ -55,6 +58,7 @@ public class HashJoinIT extends SQLIntegTestCase { protected void init() throws Exception { loadIndex(Index.ACCOUNT); loadIndex(Index.GAME_OF_THRONES); + loadIndex(Index.SUB_OBJECT); } @Test @@ -69,6 +73,21 @@ public void leftJoin() throws IOException { testJoin("LEFT JOIN"); } + @Test + public void innerJoinSubObjectField() { + String query = String.format(Locale.ROOT, + "SELECT " + + "a.id.serial, b.id.serial " + + "FROM %1$s AS a " + + "JOIN %1$s AS b " + + "ON a.id.serial = b.attributes.hardware.correlate_id " /*+ + "WHERE a.attributes.hardware.platform LIKE 'Linux%%' "*/, + TEST_INDEX_SUB_OBJECT); + + JSONObject response = executeJdbcRequest(query); + verifyDataRows(response, rows(3, 1), rows(3, 3)); + } + @Test public void innerJoinWithObjectField() throws IOException { testJoinWithObjectField("INNER JOIN", ""); diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java index 80348b2a8b..8f30a07383 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java @@ -517,6 +517,10 @@ public enum Index { "joinType", getJoinTypeIndexMapping(), "src/test/resources/join_objects.json"), + SUB_OBJECT(TestsConstants.TEST_INDEX_SUB_OBJECT, + "subObject", + getJoinTypeIndexMapping(), + "src/test/resources/sub_objects.json"), BANK(TestsConstants.TEST_INDEX_BANK, "account", getBankIndexMapping(), diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java index 8f8ee4a70f..911ef8f8c9 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java @@ -188,6 +188,11 @@ public static String getJoinTypeIndexMapping() { return getMappingFile(mappingFile); } + public static String getSubObjectIndexMapping() { + String mappingFile = "sub_object_index_mapping.json"; + return getMappingFile(mappingFile); + } + public static String getBankIndexMapping() { String mappingFile = "bank_index_mapping.json"; return getMappingFile(mappingFile); diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java b/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java index aff269fcce..bec471eafb 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java @@ -36,6 +36,7 @@ public class TestsConstants { TEST_INDEX + "_nested_type_with_quotes"; public final static String TEST_INDEX_EMPLOYEE_NESTED = TEST_INDEX + "_employee_nested"; public final static String TEST_INDEX_JOIN_TYPE = TEST_INDEX + "_join_type"; + public final static String TEST_INDEX_SUB_OBJECT = TEST_INDEX + "_sub_object"; public final static String TEST_INDEX_BANK = TEST_INDEX + "_bank"; public final static String TEST_INDEX_BANK_TWO = TEST_INDEX_BANK + "_two"; public final static String TEST_INDEX_BANK_WITH_NULL_VALUES = diff --git a/integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json b/integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json new file mode 100644 index 0000000000..dc2a063bea --- /dev/null +++ b/integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json @@ -0,0 +1,27 @@ +{ + "mappings": { + "properties": { + "id": { + "properties": { + "serial": { + "type": "integer" + } + } + }, + "attributes": { + "properties": { + "hardware": { + "properties": { + "correlate_id": { + "type": "integer" + }, + "message": { + "type": "keyword" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/integ-test/src/test/resources/sub_objects.json b/integ-test/src/test/resources/sub_objects.json new file mode 100644 index 0000000000..d48169a3b0 --- /dev/null +++ b/integ-test/src/test/resources/sub_objects.json @@ -0,0 +1,8 @@ +{"index":{"_id":"1"}} +{"id.serial" : 1 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux platform"} +{"index":{"_id":"2"}} +{"id.serial" : 2 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Windows platform"} +{"index":{"_id":"3"}} +{"id.serial" : 3 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux platform"} +{"index":{"_id":"4"}} +{"id.serial" : 4 , "attributes.hardware.correlate_id": 100, "attributes.hardware.platform": "Linux platform"} diff --git a/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java b/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java index 8f418deadb..12edd437fc 100644 --- a/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java +++ b/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java @@ -134,6 +134,13 @@ private Object getValueOfPath(Object source, String path, boolean isIgnoreFirstD if (dot == -1) { return ((Map) source).get(path); } + + // Object field may hold sub objects rather than in recursive structure + // ex. {"a.b.c": value} instead of {"a": {"b": {"c": value}}}} + if (((Map) source).containsKey(path)) { + return ((Map) source).get(path); + } + return getValueOfPath( ((Map) source).get(path.substring(0, dot)), path.substring(dot + 1), diff --git a/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java b/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java new file mode 100644 index 0000000000..446133c413 --- /dev/null +++ b/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java @@ -0,0 +1,66 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.sql.legacy.query.planner.physical.node.scroll; + +import static org.junit.Assert.assertEquals; +import static org.opensearch.sql.legacy.query.planner.physical.Row.RowKey; + +import com.google.common.collect.ImmutableMap; +import org.junit.Before; +import org.junit.Test; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.search.SearchHit; + +public class SearchHitRowTest { + + @Test + public void testKeyWithObjectField() { + SearchHit hit = new SearchHit(1); + hit.sourceRef(new BytesArray("{\"id\": {\"serial\": 3}}")); + SearchHitRow row = new SearchHitRow(hit, "a"); + RowKey key = row.key(new String[]{"id.serial"}); + + Object[] data = key.keys(); + assertEquals(1, data.length); + assertEquals(3, data[0]); + } + + @Test + public void testKeyWithSubObjectField() { + SearchHit hit = new SearchHit(1); + hit.sourceRef(new BytesArray("{\"attributes.hardware.correlate_id\": 10}")); + SearchHitRow row = new SearchHitRow(hit, "a"); + RowKey key = row.key(new String[]{"attributes.hardware.correlate_id"}); + + Object[] data = key.keys(); + assertEquals(1, data.length); + assertEquals(10, data[0]); + } + + @Test + public void testRetainWithObjectField() { + SearchHit hit = new SearchHit(1); + hit.sourceRef(new BytesArray("{\"a.id\": {\"serial\": 3}}")); + SearchHitRow row = new SearchHitRow(hit, ""); + row.retain(ImmutableMap.of("a.id.serial", "")); + + SearchHit expected = new SearchHit(1); + expected.sourceRef(new BytesArray("{\"a.id\": {\"serial\": 3}}")); + assertEquals(expected, row.data()); + } + + @Test + public void testRetainWithSubObjectField() { + SearchHit hit = new SearchHit(1); + hit.sourceRef(new BytesArray("{\"a.attributes.hardware.correlate_id\": 10}")); + SearchHitRow row = new SearchHitRow(hit, ""); + row.retain(ImmutableMap.of("a.attributes.hardware.correlate_id", "")); + + SearchHit expected = new SearchHit(1); + expected.sourceRef(new BytesArray("{\"a.attributes.hardware.correlate_id\": 10}")); + assertEquals(expected, row.data()); + } +} \ No newline at end of file From c2f0539e8605bee1cb443e000ac3618c0911a274 Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Thu, 5 Jan 2023 13:11:16 -0800 Subject: [PATCH 2/4] Rename to unexpanded object Signed-off-by: Chen Dai --- .../java/org/opensearch/sql/legacy/HashJoinIT.java | 10 +++++----- .../org/opensearch/sql/legacy/SQLIntegTestCase.java | 9 +++++---- .../test/java/org/opensearch/sql/legacy/TestUtils.java | 4 ++-- .../java/org/opensearch/sql/legacy/TestsConstants.java | 2 +- ...pping.json => unexpanded_object_index_mapping.json} | 0 .../{sub_objects.json => unexpanded_objects.json} | 0 .../planner/physical/node/scroll/SearchHitRow.java | 2 +- .../planner/physical/node/scroll/SearchHitRowTest.java | 5 ++--- 8 files changed, 16 insertions(+), 16 deletions(-) rename integ-test/src/test/resources/indexDefinitions/{sub_object_index_mapping.json => unexpanded_object_index_mapping.json} (100%) rename integ-test/src/test/resources/{sub_objects.json => unexpanded_objects.json} (100%) diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java index 6908e82b1a..d51d03602e 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java @@ -9,7 +9,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_GAME_OF_THRONES; -import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_SUB_OBJECT; +import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_UNEXPANDED_OBJECT; import static org.opensearch.sql.util.MatcherUtils.rows; import static org.opensearch.sql.util.MatcherUtils.verifyDataRows; @@ -58,7 +58,7 @@ public class HashJoinIT extends SQLIntegTestCase { protected void init() throws Exception { loadIndex(Index.ACCOUNT); loadIndex(Index.GAME_OF_THRONES); - loadIndex(Index.SUB_OBJECT); + loadIndex(Index.UNEXPANDED_OBJECT); } @Test @@ -74,7 +74,7 @@ public void leftJoin() throws IOException { } @Test - public void innerJoinSubObjectField() { + public void innerJoinUnexpandedObjectField() { String query = String.format(Locale.ROOT, "SELECT " + "a.id.serial, b.id.serial " + @@ -82,10 +82,10 @@ public void innerJoinSubObjectField() { "JOIN %1$s AS b " + "ON a.id.serial = b.attributes.hardware.correlate_id " /*+ "WHERE a.attributes.hardware.platform LIKE 'Linux%%' "*/, - TEST_INDEX_SUB_OBJECT); + TEST_INDEX_UNEXPANDED_OBJECT); JSONObject response = executeJdbcRequest(query); - verifyDataRows(response, rows(3, 1), rows(3, 3)); + verifyDataRows(response, rows(3, 1), rows(3, 2), rows(3, 3)); } @Test diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java index 8f30a07383..0cfc4a6aa6 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java @@ -57,6 +57,7 @@ import static org.opensearch.sql.legacy.TestUtils.getPhraseIndexMapping; import static org.opensearch.sql.legacy.TestUtils.getResponseBody; import static org.opensearch.sql.legacy.TestUtils.getStringIndexMapping; +import static org.opensearch.sql.legacy.TestUtils.getUnexpandedObjectIndexMapping; import static org.opensearch.sql.legacy.TestUtils.getWeblogsIndexMapping; import static org.opensearch.sql.legacy.TestUtils.isIndexExist; import static org.opensearch.sql.legacy.TestUtils.loadDataByRestClient; @@ -517,10 +518,10 @@ public enum Index { "joinType", getJoinTypeIndexMapping(), "src/test/resources/join_objects.json"), - SUB_OBJECT(TestsConstants.TEST_INDEX_SUB_OBJECT, - "subObject", - getJoinTypeIndexMapping(), - "src/test/resources/sub_objects.json"), + UNEXPANDED_OBJECT(TestsConstants.TEST_INDEX_UNEXPANDED_OBJECT, + "unexpandedObject", + getUnexpandedObjectIndexMapping(), + "src/test/resources/unexpanded_objects.json"), BANK(TestsConstants.TEST_INDEX_BANK, "account", getBankIndexMapping(), diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java index 911ef8f8c9..30cee86e15 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java @@ -188,8 +188,8 @@ public static String getJoinTypeIndexMapping() { return getMappingFile(mappingFile); } - public static String getSubObjectIndexMapping() { - String mappingFile = "sub_object_index_mapping.json"; + public static String getUnexpandedObjectIndexMapping() { + String mappingFile = "unexpanded_object_index_mapping.json"; return getMappingFile(mappingFile); } diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java b/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java index bec471eafb..c79314af6a 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/TestsConstants.java @@ -36,7 +36,7 @@ public class TestsConstants { TEST_INDEX + "_nested_type_with_quotes"; public final static String TEST_INDEX_EMPLOYEE_NESTED = TEST_INDEX + "_employee_nested"; public final static String TEST_INDEX_JOIN_TYPE = TEST_INDEX + "_join_type"; - public final static String TEST_INDEX_SUB_OBJECT = TEST_INDEX + "_sub_object"; + public final static String TEST_INDEX_UNEXPANDED_OBJECT = TEST_INDEX + "_unexpanded_object"; public final static String TEST_INDEX_BANK = TEST_INDEX + "_bank"; public final static String TEST_INDEX_BANK_TWO = TEST_INDEX_BANK + "_two"; public final static String TEST_INDEX_BANK_WITH_NULL_VALUES = diff --git a/integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json b/integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json similarity index 100% rename from integ-test/src/test/resources/indexDefinitions/sub_object_index_mapping.json rename to integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json diff --git a/integ-test/src/test/resources/sub_objects.json b/integ-test/src/test/resources/unexpanded_objects.json similarity index 100% rename from integ-test/src/test/resources/sub_objects.json rename to integ-test/src/test/resources/unexpanded_objects.json diff --git a/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java b/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java index 12edd437fc..b8cc2bb965 100644 --- a/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java +++ b/legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRow.java @@ -135,7 +135,7 @@ private Object getValueOfPath(Object source, String path, boolean isIgnoreFirstD return ((Map) source).get(path); } - // Object field may hold sub objects rather than in recursive structure + // Object field name maybe unexpanded without recursive object structure // ex. {"a.b.c": value} instead of {"a": {"b": {"c": value}}}} if (((Map) source).containsKey(path)) { return ((Map) source).get(path); diff --git a/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java b/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java index 446133c413..6c2f789a47 100644 --- a/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java +++ b/legacy/src/test/java/org/opensearch/sql/legacy/query/planner/physical/node/scroll/SearchHitRowTest.java @@ -9,7 +9,6 @@ import static org.opensearch.sql.legacy.query.planner.physical.Row.RowKey; import com.google.common.collect.ImmutableMap; -import org.junit.Before; import org.junit.Test; import org.opensearch.common.bytes.BytesArray; import org.opensearch.search.SearchHit; @@ -29,7 +28,7 @@ public void testKeyWithObjectField() { } @Test - public void testKeyWithSubObjectField() { + public void testKeyWithUnexpandedObjectField() { SearchHit hit = new SearchHit(1); hit.sourceRef(new BytesArray("{\"attributes.hardware.correlate_id\": 10}")); SearchHitRow row = new SearchHitRow(hit, "a"); @@ -53,7 +52,7 @@ public void testRetainWithObjectField() { } @Test - public void testRetainWithSubObjectField() { + public void testRetainWithUnexpandedObjectField() { SearchHit hit = new SearchHit(1); hit.sourceRef(new BytesArray("{\"a.attributes.hardware.correlate_id\": 10}")); SearchHitRow row = new SearchHitRow(hit, ""); From fbc7f183b2abc71030977b3380d80a91bcdb939f Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Fri, 6 Jan 2023 09:37:32 -0800 Subject: [PATCH 3/4] Update IT with where condition Signed-off-by: Chen Dai --- .../test/java/org/opensearch/sql/legacy/HashJoinIT.java | 6 +++--- integ-test/src/test/resources/unexpanded_objects.json | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java index d51d03602e..f796010bbe 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java @@ -80,12 +80,12 @@ public void innerJoinUnexpandedObjectField() { "a.id.serial, b.id.serial " + "FROM %1$s AS a " + "JOIN %1$s AS b " + - "ON a.id.serial = b.attributes.hardware.correlate_id " /*+ - "WHERE a.attributes.hardware.platform LIKE 'Linux%%' "*/, + "ON a.id.serial = b.attributes.hardware.correlate_id " + + "WHERE b.attributes.hardware.platform = 'Linux' ", TEST_INDEX_UNEXPANDED_OBJECT); JSONObject response = executeJdbcRequest(query); - verifyDataRows(response, rows(3, 1), rows(3, 2), rows(3, 3)); + verifyDataRows(response, rows(3, 1), rows(3, 3)); } @Test diff --git a/integ-test/src/test/resources/unexpanded_objects.json b/integ-test/src/test/resources/unexpanded_objects.json index d48169a3b0..e1df2570cc 100644 --- a/integ-test/src/test/resources/unexpanded_objects.json +++ b/integ-test/src/test/resources/unexpanded_objects.json @@ -1,8 +1,8 @@ {"index":{"_id":"1"}} -{"id.serial" : 1 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux platform"} +{"id.serial" : 1 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux"} {"index":{"_id":"2"}} -{"id.serial" : 2 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Windows platform"} +{"id.serial" : 2 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Windows"} {"index":{"_id":"3"}} -{"id.serial" : 3 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux platform"} +{"id.serial" : 3 , "attributes.hardware.correlate_id": 3, "attributes.hardware.platform": "Linux"} {"index":{"_id":"4"}} -{"id.serial" : 4 , "attributes.hardware.correlate_id": 100, "attributes.hardware.platform": "Linux platform"} +{"id.serial" : 4 , "attributes.hardware.correlate_id": 100, "attributes.hardware.platform": "Linux"} From 6cb5f25c2eace800d82bb3e02af49bec5289b45d Mon Sep 17 00:00:00 2001 From: Chen Dai Date: Fri, 6 Jan 2023 10:12:56 -0800 Subject: [PATCH 4/4] Fix test index mapping Signed-off-by: Chen Dai --- .../src/test/java/org/opensearch/sql/legacy/HashJoinIT.java | 2 ++ .../indexDefinitions/unexpanded_object_index_mapping.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java index f796010bbe..9cd497e675 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/HashJoinIT.java @@ -10,7 +10,9 @@ import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_GAME_OF_THRONES; import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_UNEXPANDED_OBJECT; +import static org.opensearch.sql.util.MatcherUtils.columnName; import static org.opensearch.sql.util.MatcherUtils.rows; +import static org.opensearch.sql.util.MatcherUtils.verifyColumn; import static org.opensearch.sql.util.MatcherUtils.verifyDataRows; import java.io.IOException; diff --git a/integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json b/integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json index dc2a063bea..8275147375 100644 --- a/integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json +++ b/integ-test/src/test/resources/indexDefinitions/unexpanded_object_index_mapping.json @@ -15,7 +15,7 @@ "correlate_id": { "type": "integer" }, - "message": { + "platform": { "type": "keyword" } }