Multiple output streams from a Java table operator

Extensibility
Enthusiast

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

Tags (2)
4 REPLIES
Enthusiast

Re: Multiple output streams from a Java table operator

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

Teradata Employee

Re: Multiple output streams from a Java table operator

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

Enthusiast

Re: Multiple output streams from a Java table operator

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

Teradata Employee

Re: Multiple output streams from a Java table operator

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