One Star

how to output multiple rows from single input row to tJavaRow?

hi,
i have a tJavaRow that scans some input text, and extracts several fields from it.
now i need to be able to parse multiple inputs in the same input field, and output them as several sets of output fields.
for example, lets say i have a code that takes text, and extracts country name and city name into 2 text fields. "paris, france" -> "paris","france".
now i want to be able to give it the text "paris, france and jerusalem, israel", and to process it in the same manner. i would like to get "paris","france" as one row, and then "jerusalem","israel" as a second row.
the logical thing to do is to have the same output schema, just have the tJavaRow output twice, for a single input.
is it possible? if so, how?
3 REPLIES
One Star

Re: how to output multiple rows from single input row to tJavaRow?

Hi,
this is not possible. As a workaround you can use tNormalize.
In your example you could change "paris, france and jerusalem, israel" in a more structured form "paris,france;jerusalem,israel" in tNormalize use ";" as delimiter. You will get two rows with: "paris,france" and "jerusalem,israel". All other columns are unchanged. No use again a tJava (or anything else) to split city and land.
Bye
Volker
One Star

Re: how to output multiple rows from single input row to tJavaRow?

thx.
i know about this way of solution. unfortunatly it is not possible in my real case (the example above is a bit simpler that what i really need).
is it in the roadmap to add such an ability to tJavaRow? i have already found several issues that would be best solved by enabling tJavaRow to have multiple lines of output...
One Star

Re: how to output multiple rows from single input row to tJavaRow?

Hi,
you can search in the BugTracker for it or open a new request.
By the way: If you can give some more information about your job and the data maybe some will have an idea.
Bye
Volker