AGING Column with Time Option

Use the AGING clause to set an age column with time option for an input window.

The example creates a schema named TradeSchema and another schema named TradeAgeSchema, which inherits the structure of TradeSchema. TradeAgeSchema also defines three columns named AgeColumn, AgeStartTime, and ctime.

Create Schema TradeAgeSchema Inherits TradeSchema 
		(AgeColumn integer, 
  AgeStartTime bigdatetime, ctime bigdatetime);

The example creates an input window named TradeWindow that references TradeSchema, and an output window named AgeWindow that references TradeAgeSchema. The example uses the AGES EVERY syntax to increment AgeWindow every 6 seconds until the age column is equal to 10. A SELECT clause places a start time condition on AgeWindow, so that the updates specified by the AGING clause do not start until 6 minutes after the current time.

CREATE  INPUT  WINDOW TradeWindow
  SCHEMA TradeSchema
  PRIMARY KEY (Ts); //

CREATE OUTPUT WINDOW AgeWindow SCHEMA TradeAgeSchema
 PRIMARY KEY DEDUCED 
 AGES EVERY 6 SECONDS 
      SET AgeColumn 10 TIMES
       FROM AgeStartTime 
AS An 
 SELECT * , 1 as AgeColumn, 
	 now() + 360000000
	 as AgeStartTime, now() as ctime
  FROM TradeWindow ; 

The example then attaches a File CSV Input adapter named csvInConn1 to TradeWindow.