-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE-395] Support for Standard Match Operator (#429)
- Loading branch information
Showing
37 changed files
with
560 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...aflow-dsl/geaflow-dsl-parser/src/test/java/com/antgroup/geaflow/dsl/IsoGqlSyntaxTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2023 AntGroup CO., Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
*/ | ||
|
||
package com.antgroup.geaflow.dsl; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
@Test(groups = "SyntaxTest") | ||
public class IsoGqlSyntaxTest extends BaseDslTest { | ||
|
||
@Test | ||
public void testIsoGQLMatch() throws Exception { | ||
String unParseSql = parseSqlAndUnParse("IsoGQLMatch.sql"); | ||
String unParseStmts = parseStmtsAndUnParse(parseStmtsAndUnParse(unParseSql)); | ||
Assert.assertEquals(unParseStmts, unParseSql); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
geaflow/geaflow-dsl/geaflow-dsl-parser/src/test/resources/IsoGQLMatch.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
MATCH (n:person{id: 1}) where n.born != 1000 RETURN n.name, n.born, n.id; | ||
MATCH (a:person WHERE a.id = 1)-[e:know]->{6}(b:person) return e; | ||
MATCH (n:person{id: 1, name: 'c'}) where n.born != 1000 RETURN n.name, n.born, n.id; | ||
MATCH (n:person{id: 1}) where n.born < 1950 AND n.born > 1900 RETURN n.name, n.born, n.id; | ||
MATCH (a:person {id: 1})-[e1:know]->(b:person)-[e2:acted_in]->(c:movie) | ||
RETURN a.id, e1.weight, b.id, b.name, e2.role, c.title LIMIT 10; | ||
MATCH (a:person {id: 1})-[e1:know]->(b:person)-[e2:acted_in]->(c:movie) | ||
RETURN a.id, e1.weight, b.id, b.name, e2.role, c.title LIMIT 2; | ||
MATCH (a:person {id: 1})-[e1:know]->{2}(b:person) return a.id, b.id, b.name; | ||
MATCH (a:person WHERE a.id = 1)-[e:know]->{6}(b:person) return e; | ||
MATCH p = (a:person WHERE a.id = 1) -[e:know]->{1, 6} (b:person) RETURN p; | ||
MATCH (n:person{id: 1}) RETURN n.name, n.born, n.id; | ||
MATCH (a:person {id: 3})-[b:acted_in]->(c:movie) RETURN b.role, b.act_year; | ||
MATCH (a:person {id: 1})-[e1:know]->(b:person) return a.id, a.born, b.id, b.name, b.born; | ||
MATCH (a:person {id: 1})-[e1:know]->{2}(b:person) return a.id, b.id, b.name, b.born; | ||
MATCH (a:person {id: 1})-[e:know]->(b:person) return e.weight + b.born - b.id; | ||
MATCH (n:person WHERE n.id = 1) -[e:know]->{2}(m:person) RETURN m.id; | ||
MATCH (n:person{id:5})-[:know]->(m:person)<-[:know]-(k:person)-[:know]->(t:person) | ||
RETURN n.id, m.id, k.id, t.id; | ||
MATCH (n:person{id:1})-[:know]->(m:person)<-[:know]-(k:person) RETURN n.id, m.id, k.id; | ||
MATCH (n:person{id:1}) RETURN n, n.name; | ||
MATCH (a:person {id: 3})-[b:acted_in]->(c:movie) RETURN a,c; | ||
MATCH (a:person {id: 1})-[e:know]->(c:person {id:3}) RETURN e; | ||
MATCH (a:person {id: 3})-[e:acted_in]->(c:movie) RETURN e; | ||
MATCH p=(a:person{id:1})-[e:know]->(b:person) RETURN a.id, a.name, b.id, b.name, p; | ||
MATCH p=(a:person{id:1})-[e:know]->(b:person)-[e2:acted_in]->(c:movie) RETURN a.id, b.id, c.id, p; | ||
MATCH (a:person {id: 1}) return a.born + a.born; | ||
MATCH (a:person {id: 1})-[e:know]->(b:person) return a.born + b.born - b.id; | ||
MATCH (n:person{id: 1}) RETURN n.name, n.born, n.id; | ||
MATCH (a:person {id: 3})-[b:acted_in]->(c:movie) RETURN a.id, b.role, c.id LIMIT 10; | ||
MATCH (a:person {id: 3})-[b:acted_in]->(c:movie) | ||
RETURN a.name, a.id, b.role, c.id, c.title LIMIT 10; | ||
MATCH (a:person {id: 3})-[b:acted_in]->(c:movie) WHERE c.id = 102 | ||
RETURN a.id, b.role, c.id LIMIT 10; | ||
MATCH (a:person {id: 10000})-[b:acted_in]->(c:movie) | ||
RETURN a.name, a.id, b.role, c.id, c.title LIMIT 10; | ||
MATCH (a:person {id: 3})<-[b:know]-(c:person) RETURN a.name, a.id, b.weight, c.id, c.name; | ||
MATCH (n:person{id: '1'}) RETURN n.name, n.born, n.id; | ||
MATCH (a:person {id: '3'})-[b:acted_in]->(c:movie) RETURN a.id, b.role, c.id LIMIT 10; | ||
MATCH (a:person {id: '3'})-[b:acted_in]->(c:movie) | ||
RETURN a.name, a.id, b.role, c.id, c.title LIMIT 10; | ||
MATCH (a:person {id: '3'})-[b:acted_in]->(c:movie) WHERE c.id = '102' | ||
RETURN a.id, b.role, c.id LIMIT 10; |
Oops, something went wrong.