Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support {match UNION match UNION mathc...} with ... Return syntax #5980

Open
Reid00 opened this issue Nov 20, 2024 · 0 comments
Open

support {match UNION match UNION mathc...} with ... Return syntax #5980

Reid00 opened this issue Nov 20, 2024 · 0 comments
Labels
type/enhancement Type: make the code neat or more efficient

Comments

@Reid00
Copy link

Reid00 commented Nov 20, 2024

as neo4j support below statement, we want to migrate to nebula, could you please support this syntax?
detail according to here https://discuss.nebula-graph.com.cn/t/topic/15776

{ MATCH p = (self:Company)<-[sr:Invest|Legal]-(target)
WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506
RETURN target, p, 'C' AS nodeType, 1 AS orderWeight 
UNION
MATCH p = (self:Company)<-[sr:FinalBenefit]-(target:Company)
WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 AND sr.percent >= 5
RETURN target, p, 'BE5' AS nodeType, 5 AS orderWeight 
UNION 
MATCH p = (self:Company)<-[sr:FinalBenefit]-(target:Person) 
WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 AND sr.percent >= 5 
RETURN target, p, 'BP5' AS nodeType, 5 AS orderWeight
UNION
MATCH p = (self:Company)<-[sr:Employ]-(target:Person) 
WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506 
RETURN target, p, 'DJG' AS nodeType, 7 AS orderWeight 
UNION 
MATCH p = (self:Company)-[sr:Invest]->(target:Company) 
WHERE id(self)== -7835036839804393803 AND id(target)== -531217911035008506
RETURN target, p, 'HE' AS nodeType, 4 AS orderWeight }  
WITH target, p, nodeType, orderWeight 
RETURN target AS target, collect(p) AS path, collect(nodeType) AS nodeType, min(orderWeight) AS orderWeight, CASE target.status WHEN 'Yes' THEN 0 WHEN 'No' THEN 0 WHEN '' THEN 0 WHEN 'Yes_1' THEN 1 WHEN 'xx' THEN 1 WHEN 'xxx' THEN 10 WHEN 'xxxx' THEN 10 WHEN '***' THEN 11 WHEN '*' THEN 11 ELSE 8 END AS status ORDER BY status, orderWeight SKIP 0 LIMIT 100
@Reid00 Reid00 added the type/enhancement Type: make the code neat or more efficient label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

1 participant