Example: JoinStream with FullOuter Join Migration

In CCL, the Aleri store element migrates to a CREATE MEMORY STORE statement, and the JoinStream element migrates to an output window with JOIN expressions.

The Aleri JoinStream "FOuterJoindatatypes" has a left outer join between input streams "alldatatypes" and "alldatatypes1", with One-One mapping between these input streams. In CCL, the Aleri SourceStream elements (alldatatypes and alldatatypes1) migrate to an input window.

However, the CCL may not get compiled because the Event Stream Processor compiler is more strict than the Aleri compiler, and therefore, there are some changes in the expressions used in the SELECT clause that cannot be handled by the migration tool. Perform these changes manually.
  1. Ensure there is One-One mapping between participating streams and windows.
  2. Add firstnonnull() for primary keys.

AleriML:

<Store file="store1" fullsize="64" id="store1" kind="memory"/>
    <SourceStream id="alldatatypes" store="store1">
    	<Column datatype="int32" key="true" name="id"/>
    <Column datatype="int64" key="false" name="a"/>
    <Column datatype="string" key="false" name="charData"/>
  </SourceStream>
     <SourceStream id="alldatatypes1" store="store1">
		<Column datatype="int32" key="true" name="id"/>
		<Column datatype="int64" key="false" name="a"/>
		<Column datatype="string" key="false" name="charData1"/>
   </SourceStream>
  <JoinStream id="FOuterJoindatatypes" istream="alldatatypes alldatatypes1" store="store1">
   <Join constraints="id=id" table1="alldatatypes" table2="alldatatypes1" type="fullouter"/>
   <ColumnExpression key="true" name="id">alldatatypes.id</ColumnExpression>
    <ColumnExpression key="false" name="a">alldatatypes1.a</ColumnExpression>
    <ColumnExpression key="false" name="chardata">alldatatypes.charData</ColumnExpression>
   <ColumnExpression key="false" name="chardata1">alldatatypes1.charData1</ColumnExpression>
    </JoinStream> 

CCL:

CREATE  MEMORY  STORE store1 PROPERTIES  INDEXTYPE ='tree',  INDEXSIZEHINT =8;
CREATE  INPUT  WINDOW alldatatypes
SCHEMA (id INTEGER, a LONG, charData STRING)
PRIMARY KEY (id)
 STORE store1;
CREATE  INPUT  WINDOW alldatatypes1
SCHEMA (id INTEGER, a LONG, charData1 STRING)
PRIMARY KEY (id)
 STORE store1;
CREATE  OUTPUT  WINDOW FOuterJoindatatypes
SCHEMA (id INTEGER, a LONG, chardata STRING, chardata1 STRING)
PRIMARY KEY (id)
 STORE store1
 AS 
SELECT firstnonnull(alldatatypes.id) AS id, alldatatypes1.a AS a, alldatatypes.charData AS chardata, alldatatypes1.charData1 AS chardata1 FROM 
alldatatypes
 FULL JOIN 
alldatatypes1
 ON alldatatypes.id = alldatatypes1.id;