Skip to content

当java接口insertRecord() measurement含"." 时 将无法使用sql指定查询该measurement的数据 #4446

@ents1008

Description

@ents1008

例如
先插入

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 即可查到数据

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions