Topic: one row to n rows Transformer
one row to n rows Transformer
How to write Transformer extensions that return multiple rows per input row?
Hi,
You can do this by injecting a OutputRowCollector and submitting your records to it. This was something we introduced in DC 2.4 (or was it 2.3? I forget) so if you're looking at old examples, that's why it is not there.
But there's a simple example on this page though (scroll down a bit).
You can do this by injecting a OutputRowCollector and submitting your records to it. This was something we introduced in DC 2.4 (or was it 2.3? I forget) so if you're looking at old examples, that's why it is not there.
But there's a simple example on this page though (scroll down a bit).
Btw. I would be curious to hear what kind of extension you are building :)
Thanks that works. Except that @Inject is not needed.
So about what i am trying to made. I got an file with following rows:
codpat
ind1
dstart1
dstop1
dos1
ind2
dstart2
dstop2
dos2
ind3
dstart3
dstop3
dos3
...
But for analysis it would be better to have every single observation in it its own row.
So about what i am trying to made. I got an file with following rows:
codpat
ind1
dstart1
dstop1
dos1
ind2
dstart2
dstop2
dos2
ind3
dstart3
dstop3
dos3
...
But for analysis it would be better to have every single observation in it its own row.
Sounds like a neat little feature! Go ahead and submit it on the extensions page if you'd like to share it.
Log in by clicking the login link at the top of the screen
Go back to forum.


