Skip to content

Commit 4d1c8e3

Browse files
committed
Apply spotless formatting
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent 0d76d1c commit 4d1c8e3

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/sql/QueryValidationIT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,11 @@ public void testAliasToKeywordMultiFieldFailsWithBadRequest() throws IOException
118118
expectResponseException()
119119
.hasStatusCode(BAD_REQUEST)
120120
.hasErrorType("SemanticCheckException")
121-
.containsMessage(
122-
"Alias field [source_alias] refers to unresolved path [source.keyword]")
121+
.containsMessage("Alias field [source_alias] refers to unresolved path [source.keyword]")
123122
.whenExecute(String.format(Locale.ROOT, "SELECT * FROM %s", index));
124123
}
125124

126-
private static void createIndexWithMapping(String indexName, String mapping)
127-
throws IOException {
125+
private static void createIndexWithMapping(String indexName, String mapping) throws IOException {
128126
Request request = new Request("PUT", "/" + indexName);
129127
request.setJsonEntity(String.format(Locale.ROOT, "{ \"mappings\": %s }", mapping));
130128
client().performRequest(request);

opensearch/src/test/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataTypeTest.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -489,32 +489,36 @@ public void traverseAndFlatten_alias_to_unresolvable_path_throws_descriptive_err
489489
// Alias path targets a text multi-field, which is not in the flattened mapping.
490490
Map<String, OpenSearchDataType> keywordAliasTree =
491491
Map.of(
492-
"source", textKeywordType,
492+
"source",
493+
textKeywordType,
493494
"source_alias",
494-
new OpenSearchAliasType("source.keyword", OpenSearchDataType.of(MappingType.Invalid)));
495+
new OpenSearchAliasType("source.keyword", OpenSearchDataType.of(MappingType.Invalid)));
495496
SemanticCheckException keywordException =
496497
assertThrows(
497498
SemanticCheckException.class,
498499
() -> OpenSearchDataType.traverseAndFlatten(keywordAliasTree));
499500
assertEquals(
500-
"Alias field [source_alias] refers to unresolved path [source.keyword]. The alias path"
501-
+ " must point to an existing field in the mapping; a text multi-field (e.g."
502-
+ " \"source.keyword.keyword\") or a removed/renamed field is not a valid alias target.",
501+
"Alias field [source_alias] refers to unresolved path [source.keyword]. The alias path must"
502+
+ " point to an existing field in the mapping; a text multi-field (e.g."
503+
+ " \"source.keyword.keyword\") or a removed/renamed field is not a valid alias"
504+
+ " target.",
503505
keywordException.getMessage());
504506

505507
// Alias path targets a field that does not exist.
506508
Map<String, OpenSearchDataType> missingFieldTree =
507509
Map.of(
508-
"col1", textType,
509-
"col_alias", new OpenSearchAliasType("missing", OpenSearchDataType.of(MappingType.Invalid)));
510+
"col1",
511+
textType,
512+
"col_alias",
513+
new OpenSearchAliasType("missing", OpenSearchDataType.of(MappingType.Invalid)));
510514
SemanticCheckException missingException =
511515
assertThrows(
512516
SemanticCheckException.class,
513517
() -> OpenSearchDataType.traverseAndFlatten(missingFieldTree));
514518
assertEquals(
515519
"Alias field [col_alias] refers to unresolved path [missing]. The alias path must point to"
516-
+ " an existing field in the mapping; a text multi-field (e.g. \"missing.keyword\") or a"
517-
+ " removed/renamed field is not a valid alias target.",
520+
+ " an existing field in the mapping; a text multi-field (e.g. \"missing.keyword\") or"
521+
+ " a removed/renamed field is not a valid alias target.",
518522
missingException.getMessage());
519523
}
520524

0 commit comments

Comments
 (0)