[
https://issues.apache.org/jira/browse/STREAMPIPES-347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17324040#comment-17324040
]
Philipp Zehnder commented on STREAMPIPES-347:
---------------------------------------------
Hi Patrick,
I agree this processor would be really helpful, but I am not sure how we can
support this with the current SDK.
I did something similar in the BooleanToState Processor [1], but I couldn't
figure out a way how to define a stream requirement and use this user input
then in the collection property.
In the processor I ended up using a requiredCodeblock with the JavaScript
validator. A user has to provide the mappings via a JSON configuration. This
solution works, but I would like to have a more user friendly way here as well.
What do you think? Any ideas?
[1]
[https://github.com/apache/incubator-streampipes-extensions/blob/dev/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/state/BooleanToStateController.java]
> Add FieldRenamer JVM processor for multiple fields
> --------------------------------------------------
>
> Key: STREAMPIPES-347
> URL: https://issues.apache.org/jira/browse/STREAMPIPES-347
> Project: StreamPipes
> Issue Type: New Feature
> Components: Pipeline Elements
> Reporter: Patrick Wiener
> Priority: Major
> Labels: newbie
>
> *Context*
> Rename multiple events field at once.
> {code:java}
> {
> "time_stamp": 1234,
> "sensor_id": "sensor1",
> "sensor_measurement": 24.0
> }
> {code}
> rename "sensor_id" -> "id", "sensor_measurement", "measurement": new event
> {code:java}
> {
> "time_stamp": 1234,
> "id": "sensor1",
> "measurement": 24.0
> }{code}
> *Problem*
> Currently, we do have a FieldRenamer implemented using Flink wrapper, yet
> only allowing to rename one field at a time, i.e., renaming n fields requires
> a sequence of #n FieldRenamer processors. In addition, this option is
> unavailable when using lite version, i.e., standalone Java extensions.
> *Solution*
> Add FieldRenamer JVM processor using something like CollectionStaticProperty
> to allow arbitrary number of mappings, where a user can select a mapping
> property and add a new field name in a text field right next to it.
>
> [EDIT]: There is a duplicate
> https://issues.apache.org/jira/browse/STREAMPIPES-338
> While this allows to rename single fields, it still does not support multi
> field renaming in one step.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)