vesoft-inc / nebula-graph

A distributed, fast open-source graph database featuring horizontal scalability and high availability. This is an archived repo for v2.5 only, from 2.6.0 +, NebulaGraph switched back to https://github.com/vesoft-inc/nebula

Home Page:https://nebula-graph.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Statements of version 2.0.1 are not compatible in version 2.5.0

foesa-yang opened this issue · comments

commented

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.

commented

Sorry for this incompatible. I'll close this issue firstly, since we had announce the change.