[ 
https://issues.apache.org/jira/browse/NIFI-5524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16582915#comment-16582915
 ] 

Mark Payne commented on NIFI-5524:
----------------------------------

[~sivaprasanna] I don't believe there's any need for a new property. We can 
simply update the Schema that is held by the Record object. If the Record 
Writer is configured to inherit the schema from the Record, then it will 
inherit those fields. If the Record Writer is configured to use an explicit 
schema from a schema registry, then that schema will be used (and hence the 
extra fields dropped, just as they are today).

> Allow UpdateRecord to modify the schema where prudent
> -----------------------------------------------------
>
>                 Key: NIFI-5524
>                 URL: https://issues.apache.org/jira/browse/NIFI-5524
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Matt Burgess
>            Priority: Major
>
> Currently UpdateRecord requires the user to know the input schema in order to 
> specify any fields to be added, either by adding them as optional/nullable on 
> the input schema, or knowing they will exist in the output schema, and thus 
> adding them there (as an extension of the input schema).
> A common use case is to infer the schema (or otherwise not easily ascertain 
> the input schema) and add field(s). It would be of great benefit if 
> UpdateRecord could also modify the output schema (especially if inherited 
> from the input schema, but of course open for discussion) to include any 
> added fields. This would remove the requirement for users to know the 
> input/output schemas ahead of time; rather the output fields would simply be 
> added to the output schema (if they don't already exist).
> With great power comes great responsibility; clearly if a field is to be 
> added/updated using a RecordPath expression that perhaps evaluates to 
> multiple nodes, the behavior may well be undefined (although hopefully 
> documented). This Jira proposes to cover the most common use cases of 
> adding/updating fields by also adding/updating schema elements where prudent.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to