请问下在dolphindb中怎样通过获取已有的表的schema来创建一个有同样schema的新的空表?

在dolphindb中我有已知的一张表我想弄一张空表跟他同样的schema,应该怎么操作?

请先 登录 后评论

1 个回答

chenweijian

可以通过schema().colDefs得到原表的字段定义:

pt = loadTable("dfs://GPS_data", "pt")
shema =  pt.schema().colDefs
col1 = exec name from shema
col2 = exec typeString from shema
t = table(10:0, col1, col2)

或者直接通过一个不成立的where条件得到:

t=select * from pt where Send_time=1970.01.01T00:00:00.000
请先 登录 后评论