我在下面的DolphinDB中创建一个流表,
share streamTable(1000000:0,`deviceID`ts`battery_temperature`cpu_percentage`mem_free,[INT,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE]) as sensor_readings
enableTablePersistence(sensor_readings, true, false, 1000000)
然后我将2个订户创建为波纹管,
tableSchema = table(1000000:0,`deviceID`ts`battery_temperature`cpu_percentage`mem_free,[INT,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE])
db1 = database("",VALUE,2019.04.24..2019.05.20)
db2 = database("",RANGE,0..10*100)
db = database("dfs://iotDemoDB",COMPO,[db1,db2])
dfsTable = db.createPartitionedTable(tableSchema,"sensor_readings",`ts`deviceID)
//one subscriber for storing
subscribeTable(, "sensor_readings", "save_to_db", -1, append!{dfsTable}, true, 1000000,10)
//the other subscriber for computing
share streamTable(1000000:0, `time`deviceID`battery_temperature_avg`cpu_percentage_avg`mem_free_avg, [TIMESTAMP,INT,DOUBLE,DOUBLE,DOUBLE]) as sensor_readings_avg
metrics = createTimeSeriesAggregator("aggr1",60000,2000,<[avg(battery_temperature),avg(cpu_percentage),avg(mem_free)]>,sensor_readings,sensor_readings_avg,`ts,,`deviceID,2000)
subscribeTable(, "sensor_readings", "metric_engine", -1, append!{metrics},true)
我想让所有订阅者都用完后自动删除记录,但这是行不通的。怎么做?在influxdb中,记录可以自动删除吗?