Skip to content

judgment of EMPTY #2666

Closed
Closed
@cooper-lzy

Description

@cooper-lzy

Extract empty to judge, there are some exceptions:

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 1
+---+-------------+----+---+
| a | b           | c  | d |
+---+-------------+----+---+
|   | "player101" | 95 |   |
+---+-------------+----+---+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 1 ; yield $var.a is EMPTY, $var.a + 1 IS NOT EMPTY , sum($var.a), sum($var.a+1), count($var.a), max($var.a)
+-----------------+-------------------------+-------------+-----------------+---------------+-------------+
| $var.a IS EMPTY | ($var.a+1) IS NOT EMPTY | sum($var.a) | sum(($var.a+1)) | count($var.a) | max($var.a) |
+-----------------+-------------------------+-------------+-----------------+---------------+-------------+
| true            | false                   | 0           | 0               | 0             | __NULL__    |
+-----------------+-------------------------+-------------+-----------------+---------------+-------------+

(root@nebula) [basketballplayer]> GO FROM "player100" OVER * REVERSELY YIELD serve.end_year AS a , follow.degree as b   | group by $-.b  yield max($-.a) as cc
+----------+
| cc       |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+
| __NULL__ |
+----------+

(root@nebula) [basketballplayer]> GO FROM "player100" OVER * REVERSELY YIELD serve.end_year AS a , follow.degree as b   | group by $-.b  yield count($-.a) as cc
+----+
| cc |
+----+
| 0  |
+----+
| 0  |
+----+
| 0  |
+----+
| 0  |
+----+
| 0  |
+----+
| 0  |
+----+
| 0  |
+----+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 3 ;
+-----------+-------------+----+------+
| a         | b           | c  | d    |
+-----------+-------------+----+------+
|           | "player125" | 95 |      |
+-----------+-------------+----+------+
|           | "player101" | 95 |      |
+-----------+-------------+----+------+
| "team204" |             |    | 1997 |
+-----------+-------------+----+------+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 3 ; fetch prop on team $var.a
+----------------------------------+
| vertices_                        |
+----------------------------------+
| ("team204" :team{name: "Spurs"}) |
+----------------------------------+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 2 ; yield -(size($var.a) )
+-----------------+
| -(size($var.a)) |
+-----------------+
|                 |
+-----------------+
|                 |
+-----------------+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 2 ; yield toBoolean($var.a)
+-------------------+
| toBoolean($var.a) |
+-------------------+
| __NULL__          |
+-------------------+
| __NULL__          |
+-------------------+

(root@nebula) [basketballplayer]> $var = GO FROM "player100" OVER * yield serve._dst as a, follow._dst as b, follow.degree as c, serve.start_year as d |  order by $-.a | limit 2 ; yield collect($var.a)
+-----------------+
| collect($var.a) |
+-----------------+
| []              |
+-----------------+

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions