You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "MyeoungDev (via GitHub)" <gi...@apache.org> on 2026/04/05 09:13:28 UTC

[I] [Improve][Transform] Improve Replace Transform to support array-based replace_fields [seatunnel]

MyeoungDev opened a new issue, #10711:
URL: https://github.com/apache/seatunnel/issues/10711

   ### Search before asking
   
   - [x] I had searched in the [feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.
   
   
   ### Description
   
   ## Description
   
   Replace Transform currently supports replacing a single field through `replace_field`.
   To support multiple target fields in one transform, this change expands the configuration to `replace_fields` and treats it as `List<String>`.
   
   For backward compatibility, the legacy `replace_field` key is still supported.
   
   ## Goals
   
   - Add new unit tests for Replace Transform where unit test coverage did not previously exist
   - Add E2E tests for Replace Transform changes
   - Convert `replace_fields` to `List<String>`
   - Keep backward compatibility with legacy `replace_field`
   - Support replacing multiple fields in a single Replace Transform
   - Update Replace Transform documentation to use `replace_fields` as the primary key
   - Add a compatibility note in the documentation for legacy `replace_field`
   
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][Transform] Replace Transform to support array-based replace_fields [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10711:
URL: https://github.com/apache/seatunnel/issues/10711#issuecomment-4199234583

   Thanks for the proposal.
   
   This makes sense to me. The current implementation is clearly centered on a single `replace_field`, so supporting an array-based form is a natural extension.
   
   The main thing I’d suggest is to keep backward compatibility very explicit:
   1. keep `replace_field` working exactly as today
   2. add `replace_fields` as the new multi-column form
   3. define clear validation if both are specified at the same time
   
   With that in place, this looks like a clean enhancement rather than a risky refactor.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][Transform] Replace Transform to support array-based replace_fields [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10711:
URL: https://github.com/apache/seatunnel/issues/10711#issuecomment-4214309856

   Thanks, that is exactly the missing compatibility case.
   
   Please add explicit validation for the `replace_field` + `replace_fields` conflict and include one focused test for that path in PR #10712.
   
   Keeping the legacy single-field behavior unchanged while making the conflict fail clearly will make the review much easier.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][Transform] Replace Transform to support array-based replace_fields [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10711:
URL: https://github.com/apache/seatunnel/issues/10711#issuecomment-4203451065

   I checked the current Replace transform path and this request makes sense. Right now the implementation is truly single-field end to end: the config only defines `replace_field`, the factory validates that shape, and the runtime transform initializes exactly one field index.
   
   I also checked the issue timeline and there is already a linked dev PR here: #10712. The main compatibility points I would keep explicit are: keep `replace_field` working exactly as it does today, add `replace_fields` as the multi-column form, and define clear validation if both are configured together.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][Transform] Replace Transform to support array-based replace_fields [seatunnel]

Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w closed issue #10711: [Improve][Transform] Replace Transform to support array-based replace_fields
URL: https://github.com/apache/seatunnel/issues/10711


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve][Transform] Replace Transform to support array-based replace_fields [seatunnel]

Posted by "MyeoungDev (via GitHub)" <gi...@apache.org>.
MyeoungDev commented on issue #10711:
URL: https://github.com/apache/seatunnel/issues/10711#issuecomment-4204616762

   > Thanks for the proposal.
   > 
   > This makes sense to me. The current implementation is clearly centered on a single `replace_field`, so supporting an array-based form is a natural extension.
   > 
   > The main thing I’d suggest is to keep backward compatibility very explicit:
   > 
   > 1. keep `replace_field` working exactly as today
   > 2. add `replace_fields` as the new multi-column form
   > 3. define clear validation if both are specified at the same time
   > 
   > With that in place, this looks like a clean enhancement rather than a risky refactor.
   
   @davidzollo Thanks for review the issue
   
   I kept `replace_field` working as before using fallbackKeys and added unit and E2E tests to ensure both `replace_field` and `replace_fields` work as expected.
   
   I missed the case where both replace_field and replace_fields are configured at the same time.
   
   Thanks for spotting that.
   
   I’ll add the necessary validation and a test case for it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org