Closed
Description
Please check the FAQ documentation before raising an issue
Describe the bug (required)
Steps to reproduce the behavior:
(root@nebula) [nba_int_vid]> unwind [[1,3,5],[0]] as e return e | yield reduce(s=list[], i IN collect($-.e) | s + i) AS a
+--------------+
| a |
+--------------+
| [1, 3, 5, 0] |
+--------------+
Got 1 rows (time spent 5322/5902 us)
Thu, 16 Dec 2021 11:30:40 CST
(root@nebula) [nba_int_vid]> unwind [[1,3,5],[0]] as e return e | yield reduce(s=list[], i IN collect($-.e) | s + i) AS a | yield $-.a
[ERROR (-1009)]: SemanticError: `$-.a', not exist prop `a'
Thu, 16 Dec 2021 11:30:48 CST
BUT it's ok for following query:
(root@nebula) [nba_int_vid]> yield 4 as t | yield reduce(s=list[], i IN [$-.t] | s + i) as a
+-----+
| a |
+-----+
| [4] |
+-----+
Got 1 rows (time spent 2330/2827 us)
Thu, 16 Dec 2021 11:34:53 CST
(root@nebula) [nba_int_vid]> yield 4 as t | yield reduce(s=list[], i IN [$-.t] | s + i) as a | yield $-.a
+------+
| $-.a |
+------+
| [4] |
+------+
What's the difference between above two queries? It's so confused for me.