diff --git a/modules/ingest-common/src/main/java/org/opensearch/ingest/common/KeyValueProcessor.java b/modules/ingest-common/src/main/java/org/opensearch/ingest/common/KeyValueProcessor.java index 285d8c6496ca7..73f03b3cb2e0f 100644 --- a/modules/ingest-common/src/main/java/org/opensearch/ingest/common/KeyValueProcessor.java +++ b/modules/ingest-common/src/main/java/org/opensearch/ingest/common/KeyValueProcessor.java @@ -166,11 +166,11 @@ private static Consumer buildExecution( final Function valueTrimmer = buildTrimmer(trimValue); String path = document.renderTemplate(field); - final boolean filedPathNullOrEmpty = Strings.isNullOrEmpty(path); - if (filedPathNullOrEmpty || document.hasField(path, true) == false) { + final boolean fieldPathNullOrEmpty = Strings.isNullOrEmpty(path); + if (fieldPathNullOrEmpty || document.hasField(path, true) == false) { if (ignoreMissing) { return; - } else if (filedPathNullOrEmpty) { + } else if (fieldPathNullOrEmpty) { throw new IllegalArgumentException("field path cannot be null nor empty"); } else { throw new IllegalArgumentException("field [" + path + "] doesn't exist"); diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/150_kv.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/150_kv.yml index 52ea548d5be5d..30a0a520b5c40 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/150_kv.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/150_kv.yml @@ -42,6 +42,10 @@ teardown: --- "Test KV Processor with template snippets": + - skip: + version: " - 2.11.99" + reason: "KV Processor with template snippets is only supported since 2.12.0" + - do: ingest.put_pipeline: id: "1" @@ -80,6 +84,10 @@ teardown: --- "Test KV Processor with non-existing field and without ignore_missing": + - skip: + version: " - 2.11.99" + reason: "KV Processor with template snippets is only supported since 2.12.0" + - do: ingest.put_pipeline: id: "1" @@ -141,6 +149,10 @@ teardown: --- "Test KV Processor with non-existing field and ignore_missing": + - skip: + version: " - 2.11.99" + reason: "KV Processor with template snippets is only supported since 2.12.0" + - do: ingest.put_pipeline: id: "1"