-
Notifications
You must be signed in to change notification settings - Fork 1.1k
当java接口insertRecord() measurement含"." 时 将无法使用sql指定查询该measurement的数据 #4446
Copy link
Copy link
Closed
Description
例如
先插入
private static Session session = new Session("127.0.0.1",6667,"root","root");
public static void insertRecord(String driveId,long time,List<String> measurements,List<String> values) throws IoTDBConnectionException, StatementExecutionException {
session.open();
session.insertRecord(driveId,time,measurements,values);
session.close();
}
public static void main(String[] args) throws Exception {
while (true) {
List<String> measurements = new ArrayList<>();
List<String> values = new ArrayList<>();
Map<String, String> data = new HashMap<>();
Random random = new Random();
data.put("TL_JS06.R_50NeckTemp2", String.valueOf(10 * random.nextFloat()));
data.put("R_50NeckTemp3", String.valueOf(10 * random.nextFloat()));
for (String tag : data.keySet()) {
measurements.add(tag);
values.add(data.get(tag));
}
IotDbSessionUtils.insertRecord("root.test.SD-T-JS006", new Date().getTime(), measurements, values);
Thread.sleep(100);
}
}后查询 1 无数据, 2 有数据
select count(TL_JS06.R_50NeckTemp2),LAST_VALUE(TL_JS06.R_50NeckTemp2) from root.test.SD-T-JS006 group by ([2021-11-22 17:45:00, 2021-11-22 17:47:00), 2400ms)
select count(R_50NeckTemp3),LAST_VALUE(R_50NeckTemp3) from root.test.SD-T-JS006 group by ([2021-11-22 17:45:00, 2021-11-22 17:47:00), 2400ms)但使用select * from root.test.SD-T-JS006 即可查到数据
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.