Page 1 of 1

Re-order metadata in column definition

Posted: Thu Aug 18, 2016 5:07 pm
by Developer9
Hi ,

I am looking for a way to re-order metadata (Drag and Drop something like we do it in a transformer stage or other stage that supports mapping ).

Ex:Sequential file stage -output --columns tab

I tried re-order desired column order --map back to the sequential fie stage )

Code: Select all

Seq --xfm stage


Thanks.

Posted: Fri Aug 19, 2016 6:30 am
by chulett
What are you ultimately trying to accomplish? If you want to re-order the columns in a sequential file, you'll need to create new metadata for that.

Edited to add: My reply was based on creating a sequential file but looking more closely I see that it is your source. So I do have to admit I don't see the point of what you are doing as you have no choice in how a sequential file is read. Of course you can re-order them afterwards as noted but I'd still like to know what brought you here to ask this question, what are you ultimately trying to accomplish? :?

Meaning, sometimes it's better to start with the actual problem you are attempting to solve rather than focusing on your solution without ever mentioning the problem. :wink:

Posted: Fri Aug 19, 2016 7:43 am
by Mike
Workaround: You can reorder the input columns of a transformer stage.

1) Add a temporary transformer stage.
2) Move the output link of your sequential file to the transformer.
3) Use the transformer to reorder its input columns.
4) Move the link back to its original position.
5) Delete the temporary transformer stage.

This works because the column metadata is associated with the link and not the source stage.

** Edit ** Just noticed you are already attached to a transformer. No need for a temporary transformer in that case. Just reorder the columns on the input side of your transformer.

Mike

Posted: Fri Aug 19, 2016 12:01 pm
by Developer9
@Chulett,
This is actually not a problem but some reason we change the source file column order just curious since many years we have an option to re-order the existing columns in the columns tab it self with out having to use transformer or other temporary stage for this purpose
For Example :In my column metadata I want to move the columns similar to functionality stages supporting Link ordering with Arrows for re-order
I am sure there is no functionality exist as such at least recent versions currently 11.5 but want to check with the forum for any tips to save time in development :)

Posted: Fri Aug 19, 2016 12:02 pm
by Developer9
@Mike ,Tried that option already :)..Thank you

Posted: Fri Aug 19, 2016 3:50 pm
by ray.wurlod
The functionality is there, including in version 11.5.

In the Columns grid (in the bottom right quadrant of the Transformer stage, or in the downstream Sequential File stage), select the Column name and then use your right mouse button to drag a column (up or down) to its new position.

You can also achieve the same in the upper right quadrant of the Transformer stage, except that you must use the left mouse button to drag the column definition up or down in the order.

Posted: Fri Aug 19, 2016 5:32 pm
by Developer9
Thanks ray ..this is what I am expecting will check once we have 11.5 available :)