All Forums Extensibility
MarkMarsh 9 posts Joined 03/10
04 Oct 2013
Multiple output streams from a Java table operator

I'm trying to build a table operator that writes to multiple tables. The documentation for the table operator shows support for multiple output streams but when I try to define a second stream in the contract function I get the message that the definition has already been set (Failed [7810 : HY000] Columns definition was already set.) when executing the second setOutputInfo().

ColumnDefinition OutCol1[] = new ColumnDefinition[1];

OutCol1[0] = new ColumnDefinition("Col1", TeradataType.INTEGER_DT);

OutCol1[0].setDisplayLength(4);

contract.setOutputInfo(0, OutCol1);

 

ColumnDefinition OutCol2[] = new ColumnDefinition[1];

OutCol2[0] = new ColumnDefinition("Col2", TeradataType.INTEGER_DT);

OutCol2[0].setDisplayLength(4);

contract.setOutputInfo(1, OutCol2); // fails

 

What am I doing wrong?

 

Thanks,

Mark

 

 

 

MarkMarsh 9 posts Joined 03/10
04 Oct 2013

P.S. The database is a VM (TDExpress14.10_Sles11).
DBCINFO...

LANGUAGE SUPPORT MODE,Standard

RELEASE,14.10.00.02

VERSION,14.10.00.02

watzke 2 posts Joined 08/10
15 Oct 2013

A table operator can only have a single output table (result set). the general model to handle these is to write out the values as strings or have a "joined" row

MarkMarsh 9 posts Joined 03/10
21 Oct 2013

That's disappointing, I was hoping to avoid the cost involved in the extra step of distributing the output to the target tables.
Can you tell me why there is an output stream number? Is there a use for it that I have missed?
Thanks,
Mark

watzke 2 posts Joined 08/10
25 Oct 2013

It is there for future purposes, in 15.x there will be support for > 1 input stream.
if you need > 1 output schema you will either need to to output in some canonical form (varchar) or output a wide row
 
 

You must sign in to leave a comment.