Row Time

Use the bigdatetime system column to retrieve row-insertion times.

The example creates a schema named TradeSchema.

The example creates the schema TradesWidthDelaySchema, and uses the INHERITS syntax to apply the structure of TradeSchema to TradesWidthDelaySchema with row delay.

The example creates an input window named TradeWindow, to which it attaches the File CSV Input adapter.

The example then creates an output window named TradesWithDelay that uses the structure defined in TradesWidthDelaySchema. The SELECT clause places a row delay on timestamp, symbol, price, and volume data rows. The row delay is defined as 10 milliseconds in the HAVING clause. The results are grouped by Symbol.


CREATE OUTPUT WINDOW TradesWithDelay SCHEMA TradesWidthDelaySchema Primary Key deduced
as
SELECT 
    TradeWindow.Ts Ts, 
    TradeWindow.Symbol Symbol, 
    TradeWindow.Price Price, 
    TradeWindow.Volume Volume,
    timeToMsec(TradeWindow.BIGROWTIME ) - timeToMsec(TradeWindow.Ts)
       as RowDelay
FROM 
    TradeWindow
GROUP BY 
    TradeWindow.Symbol
;