//创建图空间
CREATE SPACE flinkSource2(partition_num=15, replica_factor=1, vid_type=fixed_string(30))
CREATE TAG `player` ( `name` string NULL, `age` int64 NULL ) ;
CREATE EDGE `friend` ( `degree` string NULL, `start` string NULL, `src` string NULL, `dst` string NULL )
//新增点
INSERT VERTEX player(name,age) VALUES "18": ("Tom",20);
INSERT VERTEX player(name,age) VALUES "22": ("Crea",10);
INSERT VERTEX player(name,age) VALUES "20": ("Jime",32);
INSERT VERTEX player(name,age) VALUES "15": ("Bob",18);
INSERT VERTEX player(name,age) VALUES "17": ("Jena",20);
INSERT VERTEX player(name,age) VALUES "21": ("Jhon",76);
INSERT VERTEX player(name,age) VALUES "19": ("Viki",55);
INSERT VERTEX player(name,age) VALUES "16": ("Tina",19);
//新增边
INSERT EDGE friend(src,dst,degree,start) VALUES "Jime"->"John"@19: ("Jime","John","20.0","2017-04-01");
INSERT EDGE friend(src,dst,degree,start) VALUES "Bob"->"Lisa"@17: ("Bob","Lisa","20.0","2015-04-01");
INSERT EDGE friend(src,dst,degree,start) VALUES "Tim"->"Bob"@20: ("Tim","Bob","20.0","2020-04-01");
INSERT EDGE friend(src,dst,degree,start) VALUES "Tom"->"Lisa"@18: ("Tom","Lisa","20.0","2016-04-01");
INSERT EDGE friend(src,dst,degree,start) VALUES "nicole"->"Tom"@15: ("nicole","Tom","18.0","2019-05-01");
INSERT EDGE friend(src,dst,degree,start) VALUES "Tina"->"John"@16: ("Tina","John","19.0","2018-03-08");
//查看数据情况
(root@nebula) [flinkSource2]> show stats
+---------+------------+-------+
| Type | Name | Count |
+---------+------------+-------+
| "Tag" | "player" | 8 |
+---------+------------+-------+
| "Edge" | "friend" | 6 |
+---------+------------+-------+
| "Space" | "vertices" | 8 |
+---------+------------+-------+
| "Space" | "edges" | 6 |
+---------+------------+-------+
Got 4 rows (time spent 785/1114 us)
//测试删除边 DELETE EDGE serve "player100" -> "team200"@0;
> delete EDGE friend "Jime"->"John"@19
(root@nebula) [flinkSource2]> delete EDGE friend "Jime"->"John"@19
Execution succeeded (time spent 1085/1484 us)
Thu, 10 Jun 2021 10:15:35 CST
(root@nebula) [flinkSource2]> submit job stats
+------------+
| New Job Id |
+------------+
| 1459 |
+------------+
Got 1 rows (time spent 2649/2968 us)
Thu, 10 Jun 2021 10:15:47 CST
(root@nebula) [flinkSource2]> show stats
+---------+------------+-------+
| Type | Name | Count |
+---------+------------+-------+
| "Tag" | "player" | 8 |
+---------+------------+-------+
| "Edge" | "friend" | 5 |
+---------+------------+-------+
| "Space" | "vertices" | 8 |
+---------+------------+-------+
| "Space" | "edges" | 5 |
+---------+------------+-------+
Got 4 rows (time spent 776/1116 us)
Thu, 10 Jun 2021 10:15:50 CST
(root@nebula) [flinkSource2]>
重新试了一下。当知道边的数据时,是可以删除的。但是如何知道边的数据呢?
@pandasheeps
可能很简单。但是假设我生产环境数据就是这样,也没有datetime字段,但是必须要把这些脏数据找出来该怎么做呢。文档我至少看了三遍。也没有看到这种情况的描述