ATTACH ADAPTER Statement

Use the ATTACH ADAPTER statement to attach a File CSV Input adapter to a window.

The example creates a schema named TradeSchema and an input window named TradeWindow that references the schema.

The example then attaches the File CSV Input adapter to TradeWindow.

This ATTACH ADAPTER instance is named csvInConn1, but you can assign it any name. The TYPE requirement refers to the adapter ID, which is unique to the adapter. The ID for the File CSV Input adapter is dsv_in. The example defines values for adapter parameters, either maintaining the default values or modifying them as needed. You can find the adapter type or ID and a list of parameters for each adapter in the Adapters Guide.

 ATTACH INPUT ADAPTER csvInConn1
 TYPE dsv_in
 TO TradeWindow
 PROPERTIES 
   blockSize=1, 
   dateFormat='%Y/%m/%d %H:%M:%S', 
   delimiter=',', 
   dir='$ProjectFolder/../data', 
   expectStreamNameOpcode=false, 
   fieldCount=0, 
   file='stock-trades.csv', 
   filePattern='*.csv', 
   hasHeader=true, 
   safeOps=false, 
   skipDels=false, 
   timestampFormat= '%Y/%m/%d %H:%M:%S';