nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy LoPresto <alopre...@apache.org>
Subject Re: Include parent fields into the output record fields in XML data
Date Sat, 18 Apr 2020 03:41:49 GMT
Can you share your XPath and XQuery properties? I think this should be possible with queries
that return an array of results. If the results are in multiple attributes, you may be able
to recombine them in the way you want using ExecuteScript or a ScriptedRecordSetWriter to
translate them to CSV. You can also use the QueryRecord processor to perform SQL-like queries
over large datasets in a flowfile which might be helpful in forming the output you’re looking
for. 
 
Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
He/Him
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Apr 17, 2020, at 6:26 PM, ALAM Mahabub <mahabub.alam@alstomgroup.com> wrote:
> 
> Hello All, 
> I am new in NiFI. I have below nested xml file and I need to keep the parents node <track
id> with its multiple record <switch id> in a same table. I already able to separate
them but not able to align them in a same flow file attributes record.
>  
> So, it will be highly appreciated if anyone please help me how can I Include parent fields
<track id> into the output record <switch> and what will be my flow file?
>  
> track_id
> track_name
> swithc_id
> track_continue_course
> pos
> 1
> TR_3B_ASW_ITW
> 2
> Straight
> 554.05
> 1
> TR_3B_ASW_ITW
> 3
> Straight
> 2654.64
> 1
> TR_3B_ASW_ITW
> 4
> Straight
> 2767.56
> …
> …
> …
> …
> … 
>  
> XML file: 
>  
> <image001.jpg>
>  
> NiFi flow:
> In the left flow file, I am able to split  track id=1, name=”TR_3B_ASW_ITW”
> In the right flow file, I am able to split records with switch id=2, trackContinueCourse=”straight”,
pos=”544.05” etc.
>  
> Output needed: 
>  
> track_id
> track_name
> swithc_id
> track_continue_course
> pos
> 1
> TR_3B_ASW_ITW
> 2
> Straight
> 554.05
> 1
> TR_3B_ASW_ITW
> 3
> Straight
> 2654.64
> 1
> TR_3B_ASW_ITW
> 4
> Straight
> 2767.56
> …
> …
> …
> …
> … 
>  
>  
>  
> <image003.jpg>
> Regards, 
> Mahabub ALAM
> 
> CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged.
If you are not a named recipient, please notify the sender immediately and do not disclose
the contents to another person, use it for any purpose or store or copy the information in
any medium.


Mime
View raw message