streamTable

Syntax

streamTable(X, [X1], [X2], …..)

or

streamTable(capacity:size, colNames, colTypes)

Arguments

For the first usage, X, X1, X2, …. are vectors.

For the second scenario:

capacity is the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.

size is the initial size (in terms of the number of rows) of the table. If size=0, create an empty table.

colNames is a string vector of column names.

colTypes is a string vector of data types.

Details

Create a table in real-time mode to be used in streaming (also called a stream table). A table in real-time mode can handle concurrent reading and writing.

Examples

$ id=`XOM`GS`AAPL
$ x=102.1 33.4 73.6
$ rt = streamTable(id, x);
$ rt=streamTable(`XOM`GS`AAPL as id, 102.1 33.4 73.6 as x);
$ colName=["Name","Age"]
$ colType=["string","int"]
$ rt = streamTable(100:10, colName, colType);