| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- -- ============================================================
- -- 单分区测试
- -- ============================================================
- -- 1. 插入单分区数据
- insert into /test/aaa/test_partition (p_id, p_name, p_value) values (1, 'part1_item1', 100)
- ;
- insert into /test/aaa/test_partition (p_id, p_name, p_value) values (1, 'part1_item2', 200)
- ;
- insert into /test/aaa/test_partition (p_id, p_name, p_value) values (2, 'part2_item1', 300)
- ;
- insert into /test/aaa/test_partition (p_id, p_name, p_value) values (2, 'part2_item2', 400)
- ;
- -- 2. 查询单分区数据
- select * from /test/aaa/test_partition where p_id=1
- /**
- output()
- **/
- ;
- -- 3. 跨分区查询
- select * from /test/aaa/test_partition
- /**
- output()
- **/
- ;
- -- 4. 按分区聚合
- select p_id, count(*) from /test/aaa/test_partition group by p_id
- /**
- output()
- **/
- ;
- -- 5. 更新单分区数据
- update /test/aaa/test_partition set p_value=150 where p_id=1 and p_name='part1_item1'
- ;
- select p_value from /test/aaa/test_partition where p_id=1 and p_name='part1_item1'
- /**
- output()
- **/
- ;
- -- 6. 删除单分区数据
- delete from /test/aaa/test_partition where p_id=2 and p_name='part2_item2'
- ;
- select * from /test/aaa/test_partition where p_id=2 and p_name='part2_item2'
- /**
- output()
- count(0)
- **/
- ;
|