From 3d0fae2543745bf936f22bedeb018ab467d00b21 Mon Sep 17 00:00:00 2001 From: Yee <2520865+yixinglu@users.noreply.github.com> Date: Sat, 3 Dec 2022 19:54:40 +0800 Subject: [PATCH] Fix IC 10 validation (#65) --- nebula/queries/interactive-complex-10.ngql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nebula/queries/interactive-complex-10.ngql b/nebula/queries/interactive-complex-10.ngql index 545421cb7..19ebd1b73 100644 --- a/nebula/queries/interactive-complex-10.ngql +++ b/nebula/queries/interactive-complex-10.ngql @@ -8,11 +8,9 @@ WHERE (birthday.month==$month AND birthday.day>=21) OR (birthday.month==($month%12)+1 AND birthday.day<22) WITH DISTINCT friend AS f, city AS c, person AS p OPTIONAL MATCH (f)<-[:POST_HAS_CREATOR]-(post:Post) -WITH f AS friend, c AS city, collect(post) AS posts, p AS person -WITH friend, - city, - size(posts) AS postCount, - size([p IN posts WHERE (p)-[:HAS_TAG]->()<-[:HAS_INTEREST]-(person)]) AS commonPostCount +OPTIONAL MATCH (p)-[:HAS_INTEREST]->(m)<-[:HAS_TAG]-(post:Post) +with f AS friend, c AS city, post, CASE WHEN count(m) > 0 THEN 1 ELSE 0 END AS cnt +with friend, city, sum(cnt) AS commonPostCount, count(post) AS postCount RETURN toInteger(substr(id(friend), 2)) AS personId, friend.Person.firstName AS personFirstName, friend.Person.lastName AS personLastName,