流表访问的时候报错:A stream table does not support direct access. Please use sql query to retrieve data

创建一个流表:

colName=["time","x"]
colType=["timestamp","int"]
t = streamTable(100:0, colName, colType);
enableTableShareAndPersistence(table=t, tableName=`st, cacheSize=1200000)

写入2条数据:

time = 0..1 + now()
x = 10 20
data = table(time, x)
st.append!(data )

查询time列的数据:

st.time

错误提示:

A stream table does not support direct access. Please use sql query to retrieve data

请问这个错误应该怎么解决?

请先 登录 后评论

1 个回答

Jason Tang - 时序数据库技术支持

流数据表(streamTable)可以理解为特殊的内存表,目前不支持st.time这样的访问方式,支持SQL查询的访问方式,如下:

select time from st

结果:

attachments-2021-08-M7dWKlYU610cb7331308a.png

请先 登录 后评论