https://nebula-graph.io logo
#nebula-users
Title
# nebula-users
m

Marija Zelić

08/24/2023, 10:33 AM
hi, I'm wondering about the different usage of
EMPTY
and
NULL
, when displaying an edge with one missing vertex. it seems that if a source vertex is missing, Nebula displays EMPTY (and you can filter with: IS NOT EMPTY). However, if a destination vertex is missing, Nebula displays NULL (and you can filter with: IS NOT NULL). Is there a reason for such difference, and is it safe to rely on such EMPTY/NULL filtering in queries (or is this likely to change in new Nebula versions)? Here is a short example:
Copy code
CREATE TAG player(name string)
CREATE EDGE follow()
INSERT VERTEX player(name) VALUES "001":("John")
INSERT VERTEX player(name) VALUES "002":("Michael")
INSERT EDGE follow () VALUES '001' -> '002':()

(manager@nebula) [rlgraph]> GO FROM '001' OVER follow YIELD $^.player.name as player1, $$.player.name AS player2
| player1 | player2   |
| "John"  | "Michael" |

DELETE VERTEX '001'

(manager@nebula) [rlgraph]> GO FROM '001' OVER follow YIELD $^.player.name as player1, $$.player.name AS player2
| player1 | player2   |
|         | "Michael" |

INSERT VERTEX player(name) VALUES "001":("John")
DELETE VERTEX '002'

(manager@nebula) [rlgraph]> GO FROM '001' OVER follow YIELD $^.player.name as player1, $$.player.name AS player2
| player1 | player2  |
| "John"  | __NULL__ |
3 Views