You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) |
+-----------------+
| [] |
+-----------------+
The text was updated successfully, but these errors were encountered:
As far as I can see, the most results are expected. The Aggregate function is basically executed by ignoring null and empty and passing an exception. And different functions will have different default initial values( such as 0 for count and [] for collect).
Here are some explanations for some of above queries:
$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 and empty+1 is null, so they are ignored by the aggregate function and return default values.
GO FROM "player100" OVER * REVERSELY YIELD serve.end_year AS a , follow.degree as b | group by $-.b yield count($-.a) as cc count(empty) just return default values.
GO FROM "player100" OVER * REVERSELY YIELD serve.end_year AS a , follow.degree as b | group by $-.b yield max($-.a) as cc
You could execute the GO FROM "player100" OVER * REVERSELY YIELD serve.end_year AS a , follow.degree as b statement, bcz I don't know about your data.
Extract empty to judge, there are some exceptions:
The text was updated successfully, but these errors were encountered: