Skip to content

Commit b61bd14

Browse files
authored
Fix typo in RemoveProcessor (opensearch-project#11983)
* Fix typo in RemoveProcessor Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify changelog Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com>
1 parent 79964c2 commit b61bd14

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
103103
- Add search query categorizer ([#10255](https://github.com/opensearch-project/OpenSearch/pull/10255))
104104
- Per request phase latency ([#10351](https://github.com/opensearch-project/OpenSearch/issues/10351))
105105
- Add cluster state stats ([#10670](https://github.com/opensearch-project/OpenSearch/pull/10670))
106-
- Remove ingest processor supports excluding fields ([#10967](https://github.com/opensearch-project/OpenSearch/pull/10967))
106+
- Remove ingest processor supports excluding fields ([#10967](https://github.com/opensearch-project/OpenSearch/pull/10967), [#11983](https://github.com/opensearch-project/OpenSearch/pull/11983))
107107
- [Tiered caching] Enabling serialization for IndicesRequestCache key object ([#10275](https://github.com/opensearch-project/OpenSearch/pull/10275))
108108
- [Tiered caching] Defining interfaces, listeners and extending IndicesRequestCache with Tiered cache support ([#10753](https://github.com/opensearch-project/OpenSearch/pull/10753))
109109
- [Remote cluster state] Restore cluster state version during remote state auto restore ([#10853](https://github.com/opensearch-project/OpenSearch/pull/10853))

modules/ingest-common/src/main/java/org/opensearch/ingest/common/RemoveProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public final class RemoveProcessor extends AbstractProcessor {
7272
) {
7373
super(tag, description);
7474
if (fields == null && excludeFields == null || fields != null && excludeFields != null) {
75-
throw new IllegalArgumentException("ether fields and excludeFields must be set");
75+
throw new IllegalArgumentException("either fields or excludeFields must be set");
7676
}
7777
if (fields != null) {
7878
this.fields = new ArrayList<>(fields);
@@ -188,7 +188,7 @@ public RemoveProcessor create(
188188
final Object excludeField = ConfigurationUtils.readOptionalObject(config, "exclude_field");
189189

190190
if (field == null && excludeField == null || field != null && excludeField != null) {
191-
throw newConfigurationException(TYPE, processorTag, "field", "ether field or exclude_field must be set");
191+
throw newConfigurationException(TYPE, processorTag, "field", "either field or exclude_field must be set");
192192
}
193193

194194
boolean ignoreMissing = ConfigurationUtils.readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false);

modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorFactoryTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ public void testCreateWithExcludeField() throws Exception {
9797
OpenSearchParseException.class,
9898
() -> factory.create(null, processorTag, null, config)
9999
);
100-
assertThat(exception.getMessage(), equalTo("[field] ether field or exclude_field must be set"));
100+
assertThat(exception.getMessage(), equalTo("[field] either field or exclude_field must be set"));
101101

102102
Map<String, Object> config2 = new HashMap<>();
103103
config2.put("field", "field1");
104104
config2.put("exclude_field", "field2");
105105
exception = expectThrows(OpenSearchParseException.class, () -> factory.create(null, processorTag, null, config2));
106-
assertThat(exception.getMessage(), equalTo("[field] ether field or exclude_field must be set"));
106+
assertThat(exception.getMessage(), equalTo("[field] either field or exclude_field must be set"));
107107

108108
Map<String, Object> config6 = new HashMap<>();
109109
config6.put("exclude_field", "exclude_field");

modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void testRemoveMetadataField() throws Exception {
203203

204204
public void testCreateRemoveProcessorWithBothFieldsAndExcludeFields() throws Exception {
205205
assertThrows(
206-
"ether fields and excludeFields must be set",
206+
"either fields or excludeFields must be set",
207207
IllegalArgumentException.class,
208208
() -> new RemoveProcessor(randomAlphaOfLength(10), null, null, null, false)
209209
);
@@ -223,7 +223,7 @@ public void testCreateRemoveProcessorWithBothFieldsAndExcludeFields() throws Exc
223223
}
224224

225225
assertThrows(
226-
"ether fields and excludeFields must be set",
226+
"either fields or excludeFields must be set",
227227
IllegalArgumentException.class,
228228
() -> new RemoveProcessor(randomAlphaOfLength(10), null, fields, excludeFields, false)
229229
);

0 commit comments

Comments
 (0)