I am currently working with snowflake sql to query and return a data set. The data that gets returned separates the values into a series of data nodes all named “e” and the table columns into a set of rowtypes.
ideally what i would like to do is take the name field from the rowtype and replace all the “e” value names in the data. Any ideas on an easy way to accomplish this?
There doesn’t seem to be a 1:1 correlation between the two sets, but if you could figure out which row is which name then you can do the renaming with inline Java JSP code, something like:
There is another approach, which is to use the Data Nodes - Rename Uniquely module which would just give all the repeated e nodes unique names with an incremented number. That would at least let you perform assembly logic on the data, if the sending system always sends the same set of nodes.
Let us know if you can’t figure out a needed solution!
i didnt copy the full data. there is a 1:1. There are 18 rowType records to match the 18 data points per data record. so the first rowtype record name would be the name of the first e value in the data record, 2nd is 2nd and so on (ie. MSA_ID = 623, INVOICE_NUMBER = 6478032, etc . i was thinking something like the name value pairs module could work but obviously those need to be paired together already. Rename unique module just appends a -1 to each to make it e-1, e-2, etc., which is a great start and i could say e-1 is always this but i was hoping to find a way to read from the rowtype records and rename the data dynamically. If i ever need to change my query, the data table changes, anything, then i need to remap the columns names. thoughts?
Given that there is indeed a 1:1 row correlation, then I would do it all in Java JSP code. Input the two data streams in, read the row names into an array, then in the inner loop fetch the name from the array by index.