Statements of version 2.0.1 are not compatible in version 2.5.0
foesa-yang opened this issue · comments
In Nebula Graph version v2.5.0:
(root@nebula) [basketballplayer]> LOOKUP ON player \
-> YIELD player.age As playerage \
-> | GROUP BY $-.playerage \
-> YIELD $-.playerage as age, count(*) AS number \
-> | ORDER BY number DESC, age DESC;
[ERROR (-1009)]: SemanticError: Order by with invalid expression `number'
But in Nebula Graph version v2.0.1 the result is the follows:
(root@nebula) [basketballplayer]> LOOKUP ON player \
-> YIELD player.age As playerage \
-> | GROUP BY $-.playerage \
-> YIELD $-.playerage as age, count(*) AS number \
-> | ORDER BY number DESC, age DESC;
+-----+--------+
| age | number |
+-----+--------+
| 34 | 4 |
+-----+--------+
| 33 | 4 |
+-----+--------+
| 30 | 4 |
+-----+--------+
...
(czp@nebula) [basketballplayer]> LOOKUP ON player \
-> YIELD player.age As playerage \
-> | GROUP BY $-.playerage \
-> YIELD $-.playerage as age, count(*) AS number \
-> | ORDER BY number DESC, age DESC;
[ERROR (-1009)]: SemanticError: Order by with invalid expression `number'
The above is the expected behavior in version 2.5. Only $-.
can be used to refer to the variable in front of the pipe, this is my test in version 2.5:
(czp@nebula) [basketballplayer]> LOOKUP ON player \
-> YIELD player.age As playerage \
-> | GROUP BY $-.playerage \
-> YIELD $-.playerage as age, count(*) AS number \
-> | ORDER BY $-.number DESC, $-.age DESC;
+-----+--------+
| age | number |
+-----+--------+
| 34 | 4 |
+-----+--------+
| 33 | 4 |
+-----+--------+
| 30 | 4 |
+-----+--------+
...
Thanks for your careful test. Closing but feel free to ask if anything.
@Sophie-Xie
please confirm this behavior change.
It's not written in the release note.
https://github.com/vesoft-inc/nebula-graph/releases/tag/v2.5.0
updated release notes
Sorry for this incompatible. I'll close this issue firstly, since we had announce the change.