tdSql.execute("create table %s using machine_tool_metadata tags(%s, %d)"%(line[0],line[1],int(line[2])))
tdSql.execute("insert into %s file 'data/%s.csv'"%(line[0],line[0].replace("'","")))
tdSql.query("select count(1) - sum(device_status_3) as enableCount from ( select last(device_status_1) as device_status_1,last(device_status_2) as device_status_2,last(device_status_3) as device_status_3,last(composite_status_4) as composite_status_4,last(composite_status_5) as composite_status_5 from machine_tool_metadata where ts>= '2022-05-26 00:00:00.0' and ts <= '2022-06-01 23:59:59.0' interval(1d) group by id ) group by ts")