I have a file that I am consuming into StreamSets and in that I have the following sample:
Source_id: {String} "1234"
Partition_id: {String} "ABC"
Key: {String} "W3E"
(the field names are dynamic, sometimes it changes so we can't hardcode those field names).
I want to be able to somehow get these to two separate fields so that I can send the entire to a stored procedure that uses dynamic SQL to insert into various tables. For this purpose I need to have two fields with in this format.
ColumnName: {string} " 'Source_id', 'Partition_id', 'Key' "
ValueName: {String} "'1234', 'ABC', 'W3E' "
I've tried field mappers and other processors but unable to get it working.
I don't know Java/ Groovy enough to make it work. Any help would be appreciated.
Thanks
Regards, NonClever human.
here's a Groovy option that should do the trick:
I strongly suggest that you learn the basics of either Groovy or Javascript or Python. That should help a lot with corner cases like this.