THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
6、对齐的时间序列(Aligned timeseries)
对齐的多个时间序列需要同时创建,可以删除其中某列,但不能新增列。。
aligned不可以在对齐序列所属的设备下创建非对齐的序列,不可以在非对齐序列所属的设备下创建对齐序列。
...
Code Block | ||||
---|---|---|---|---|
| ||||
// 在实体 root.sg1.d2 下创建一组对齐的时间序列 create aligned timeseries root.sg1.d2.(s1 FLOAT encoding=RLE, s2 INT32 encoding=Grollia compression=SNAPPY) compression=SNAPPY // 注: // 1.可以指定每条时间序列的编码注:可以指定每条时间序列的编码(encoding)和压缩方式(compression),但是暂不支持指定别名(alias),props,但是暂不支持指定 props, attributes, tags 等。 // 2.未指定 compression 的时间序列,则采用系统默认配置;小括号外的 compression 定义时间列压缩方式和未显式声明的列的压缩方式。 // 插入语句,必须使用 aligned 关键词 insert into root.sg.d2(time, s1, s2) aligned values(1, 1, 2) insert into root.sg.d2(time, s1) aligned values(2, 1) //允许单独写某条时间序列,其他时间序列在该时间点上为空值 // 场景2所创建的对齐时间序列所属物理实体可以扩充时间序列,但需要在该物理实体下嵌套新实体。 // 例如,可以向d2下继续添加时间序列: create timeseries root.sg1.d2.t1.s1 FLOAT create timeseries root.sg1.d2.v1.(s1 FLOAT, s2 FLOAT) |
...
Code Block | ||||
---|---|---|---|---|
| ||||
// 插入一个 Tablet void insertTablet(Tablet tablet) // 插入多个 Tablet void insertTablets(Map<String, Tablet> tablet) // 对齐的时间序列通过 measurementSchema 构建 Tablet List<IMeasurementSchema> schemaList = new ArrayList<>(); schemaList.add(new measurementSchema(new String[] {"s1", "s2"}, new TSDataType[] {TSDataType.INT64, TSDataType.INT32})); Tablet tablet = new Tablet("root.sg1.d1.v1", schemaList); |
...