Skip to content

fix TranslateProcessorConfig to load target.type property correctly #5969

Merged
graytaylor0 merged 1 commit into
opensearch-project:mainfrom
wjyao0316:translate-processor-target-type
Aug 7, 2025
Merged

fix TranslateProcessorConfig to load target.type property correctly #5969
graytaylor0 merged 1 commit into
opensearch-project:mainfrom
wjyao0316:translate-processor-target-type

Conversation

@wjyao0316

@wjyao0316 wjyao0316 commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

…961)

Description

What?

This commit update TranslateProcessorConfig to load the target.type property from pipeline config with Jackson's support. The cause is that converter parameter is not updated while Jackson parsing the target.type properly. The fix removes the unncessary private field converter and instead return targetType.

It also make secondar contstructor protected for unit test only.

Why?

Make target.type property in translate processor to take effect.

Issues Resolved

Resolves #[5961]

Check List

  • [N/A ] New functionality includes testing.
  • [ N/A] New functionality has a documentation issue. Please link to it in this PR.
    • [ N/A] New functionality has javadoc added
  • Commits are signed with a real name per the DCO

Setup

  processor:
     - translate:
         mappings:
           - source: "source_field"
             targets:
               - target: "target_field"
                 map:
                   "key1": 1
                   "key2": 2
                 type: "integer"

Input:

{
  "source_field": "key1",
  "other_field": "test"
}

Output

{
  events:[
    {
      source_field:"key1",
      other_field:"test",
      s3:{
        bucket:"wenjie-sfo-test",
        key:"testfile3"
      },
      target_field: 1 //  integer 1 after the fix, it is always String("1") before the fix
    }
  ]
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@wjyao0316 wjyao0316 changed the title fix TranslateProcessorConfig to load target.type property correct (#5… fix TranslateProcessorConfig to load target.type property correct (#5961) Aug 5, 2025
@wjyao0316 wjyao0316 changed the title fix TranslateProcessorConfig to load target.type property correct (#5961) fix TranslateProcessorConfig to load target.type property correctly Aug 5, 2025
@wjyao0316 wjyao0316 changed the title fix TranslateProcessorConfig to load target.type property correctly fix TranslateProcessorConfig to load target.type property correctly (Fixes #5961) Aug 5, 2025
@alparish

alparish commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

DCO check is failing, we need to add sign off for every commit like this:
Signed-off-by: Alekhya Parisha aparisha@amazon.com

…x#5961)

**What?**

This commit update TranslateProcessorConfig to load the target.type property
from pipeline config with Jackson's support. The cause is that converter parameter
is not updated while Jackson parsing the target.type properly. The fix removes
the unncessary private field converter and instead return targetType.

It also make secondar contstructor protected for unit test only.

**Why?**

Make target.type property in translate processor to take effect.

Signed-off-by: Wenjie Yao <wjyao@amazon.com>
@wjyao0316 wjyao0316 force-pushed the translate-processor-target-type branch from 12bdbbd to 0798fdf Compare August 6, 2025 18:22
@wjyao0316 wjyao0316 changed the title fix TranslateProcessorConfig to load target.type property correctly (Fixes #5961) fix TranslateProcessorConfig to load target.type property correctly Aug 6, 2025
@graytaylor0 graytaylor0 merged commit 39ef0c1 into opensearch-project:main Aug 7, 2025
43 of 47 checks passed
@wjyao0316 wjyao0316 deleted the translate-processor-target-type branch August 8, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants