如果用python api创建streamTable并进行订阅,然后向该table中实时添加数据

我想创建如下的stremTable
share keyedStreamTable(`date`stockId, 100:0, `date`stockId`price`volume,`INT`STRING`DOUBLE`DOUBLE) as stock_info
并执行订阅,将过滤后的数据插入filtered_info表中
subscribeTable(table_name='stock_info',actionName='filter_and_insert',handler=my_handler{filtered_info},filter=my_filter)
我该如何调用python api执行上述操作,并将pandas dataframe插入到stock_info表中
请先 登录 后评论

1 个回答

wale

建议读一下python api readme(https://gitee.com/dolphindb/api_python3/blob/master/README_CN.md)

 建表,请参考readme 的1.2小节 ,用

s.run("share keyedStreamTable(`date`stockId, 100:0, `date`stockId`price`volume,`INT`STRING`DOUBLE`DOUBLE) as stock_info")

订阅请参考readme 第10.2小节

将pandas dataframe插入到流表,可用tableInsert或MultithreadedTableWriter ,请参阅readme 第6.2小节或第6.8.1小节,

请先 登录 后评论