Forum Discussion
I’m attaching an example pipeline that generates a separate JSON file for each document in a particular category:
FilePerCategory_2017_11_17.slp (7.0 KB)
Here’s some detail on what’s going on in the pipeline:
- The Group By Fields Snap can be used to do the category grouping (make sure the input documents are sorted by category, otherwise I think you’ll get multiple outputs for the same category).
- Once the categories are grouped together in a single document, you can write them out to a file using the JSON Formatter. This JSON Formatter has the ‘Format each document’ option checked, which means that a separate binary output document will be generated for each input document. We want this since every input document will be the collection of items in the category and that’s what we want in each file. In addition, we set the ‘Content’ property to ‘$group’ since that contains the array of items in the category. The last thing for the formatter is to compute the file name based on the category using the ‘Binary Header Properties’ to set the ‘content-location’ property in the binary output document header.
- Finally, there’s a File Writer that writes out a file using the name as found in the ‘content-location’ property.
Thank you for the input and solution for json file. Is there any approach for CSV file format?
because there is no specific way to write our contents($group) to in CSV parser/formatter. But we have it in JSON for-matter “Content” option.
Solved this scenario in a different way.
Insert handled by using inner join.
For Update
Here I have to update 2 columns($status, $ID) based on 6 key columns matching data.
So, I have read the target table as reference table($col_Ref) and regular/new data as left side data and performing an inner join based on 6 key columns.
There I found the matching data.
I put 1 filter to sort $status=“Active”
I just mapped 2 ($status hardcoded as “INACTIVE” I have to update the $status column if $stat=“Active”, $ID taken from filter ) columns which I want to update in the Target Table.Finally in Oracle Update snap mentioned Schema and table name.
In where clause $Status=“Active”.
This was one of the ways that I found for resolving this issue.
If we have any other ways to handle this, then it could be helpful.
Related Content
- 7 months ago
- 6 years ago
- 8 months ago