memgraph/tests/public_benchmark/ldbc/test_cases/queries/query_7.cyp
florijan 21550d3bb1 LDBC queries checked
Summary:
- checked existing queries and added new ones
- minor changes to LDBC setup

Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D737
2017-09-02 10:36:02 +02:00

22 lines
774 B
Plaintext

MATCH (person:Person {id:"17592186053137"})<-[:HAS_CREATOR]-(message)<-[like:LIKES]-(liker:Person)
WITH liker, message, like.creationDate AS likeTime, person
ORDER BY likeTime DESC, toInt(message.id) ASC
WITH
liker,
head(collect({msg: message, likeTime: likeTime})) AS latestLike,
person
RETURN
liker.id AS personId,
liker.firstName AS personFirstName,
liker.lastName AS personLastName,
latestLike.likeTime AS likeTime,
latestLike.msg.id AS messageId,
CASE exists(latestLike.msg.content)
WHEN true THEN latestLike.msg.content
ELSE latestLike.msg.imageFile
END AS messageContent,
latestLike.likeTime - latestLike.msg.creationDate AS latencyAsMilli,
not((liker)-[:KNOWS]-(person)) AS isNew
ORDER BY likeTime DESC, toInt(personId) ASC
LIMIT 10;