You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by "Govindprasad, Nirmal" <ni...@jpmchase.com> on 2020/09/07 02:44:22 UTC

Unable to create new column

Hi All,
I am new to NIFI and I was trying to do POC on data transformation. I have column a and b and I need to add columns a+b and create new column c can write it to output file/DB. Can you please help.

I tried with updateAttribute, QueryRecord processors and dint not work as expected.

Thanks and Regards
Nirmal G

This message is confidential and subject to terms at: https://www.jpmorgan.com/emaildisclaimer including on confidential, privileged or legal entity information, malicious content and monitoring of electronic messages. If you are not the intended recipient, please delete this message and notify the sender immediately. Any unauthorized use is strictly prohibited.

Re: Unable to create new column

Posted by Mark Payne <ma...@hotmail.com>.
Normal,

UpdateAttribute would not be what you want here. You want to modify FlowFile content, not the attributes. QueryRecord is perhaps what you want. It depends on the use case. If you want to add a value of ‘hello’, as column c, for instance, you can do that with QueryRecord by using the SQL “SELECT a, b, ‘hello’ AS c FROM FLOWFILE”. But if you want to get the value for column C from a CSV file or some external dataset, for instance, then LookupRecord might make more sense. If you want to get the value by combining values from columns a and b, then you could potentially use QueryRecord or UpdateRecord.

Lots of different possibilities, but I think you need to provide more information about your use case.

Thanks
-Mark

On Sep 6, 2020, at 10:44 PM, Govindprasad, Nirmal <ni...@jpmchase.com>> wrote:

Hi All,
I am new to NIFI and I was trying to do POC on data transformation. I have column a and b and I need to add columns a+b and create new column c can write it to output file/DB. Can you please help.

I tried with updateAttribute, QueryRecord processors and dint not work as expected.

Thanks and Regards
Nirmal G

This message is confidential and subject to terms at: https://www.jpmorgan.com/emaildisclaimer including on confidential, privileged or legal entity information, malicious content and monitoring of electronic messages. If you are not the intended recipient, please delete this message and notify the sender immediately. Any unauthorized use is strictly prohibited.