1

already had a streaming table, some data has been written in. now i need to add a column.

sample here:

n=10
ticker = rand(`MSFT`GOOG`FB`ORCL`IBM,n)
x=rand(1.0, n)
t=streamTable(ticker, x)
share t as st

ctreated a streaming table which only have X columns, how to add a Y columns?

1 Answers1

1

You can use the function addColumn(table, colNames, colTypes) to add a new column to a dfs table or streaming table. Here is the example code:

n=10
ticker = rand(`MSFT`GOOG`FB`ORCL`IBM, n)
x=rand(1.0, n)
t=streamTable(ticker, x)
share t as st

addColumn(st,["price", "qty"],[DOUBLE, INT])
insert into st values("MSFT", 12.0, 25.46, 256)
select * from st;