Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GIE/IR] Introduce a new strategy for pattern matching (#2159)
* [GIE/Pattern] Introduce a new ExtendStrategy for Pattern Match * [GIE/Pattern] Validate the input of pattern matching via `ExtendStrategy`, i.e., only support `g.V()` as input * [GIE/Pattern] Refine implementation of `EdgeIntersect` * [GIE/Pattern] Only support JoinKind of `Inner` in `ExtendStrategy` * [GIE/Pattern] Support PathExpand in `ExtendStrategy` * [GIE/Pattern] Match Plan: start with `Scan` op with specified table(label) value, and end with `Auxilia` op to remove system-given alias * [GIE/Pattern] Consider match priority of EQ-Predicates, PathExpand's Predicates, etc. * [GIE/Pattern] Define IrPatternError, and refine the codes to avoid unwrap() * [GIE/Pattern] Ensure the selected vertex won't break the pattern in heuristic * [GIE/Pattern] Support Fuzzy Pattern, including matching multiple edge labels, matching `Both` direction, etc. * [GIE/Pattern] Combine `Out`/`In`/`Both` adjacencies in `PatternVertexData` for simplicity * [GIE/Pattern] Remove `tag_edge_map`/`tag_vertex_map` in `Pattern` for simplicity, instead, maintain max_tag_id * [Pattern/CI] add integration ci tests for pattern match * [GIE/Pattern] Apply `NaiveStrategy` when unsupported by `ExtendStrategy`; and Remove `PatternMeta`. * [GIE/Pattern] Support Pattern of a single Vertex * [GIE/Pattern] Define PatternOrderTrait and PatternWeightTrait for matching order
- Loading branch information
1 parent
92f7da3
commit aed1f13
Showing
41 changed files
with
7,257 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
base_dir=$(cd $(dirname $0); pwd) | ||
# clean service first | ||
ps -ef | grep "com.alibaba.graphscope.gremlin.service.GraphServiceMain" | awk '{print $2}' | xargs kill -9 || true | ||
ps -ef | grep "start_rpc_server" | awk '{print $2}' | xargs kill -9 | ||
sleep 3 | ||
# start engine service and load ldbc graph | ||
cd ${base_dir}/../executor/ir/target/release && | ||
RUST_LOG=info DATA_PATH=${base_dir}/../../gstest/ldbc_graph_exp_bin PARTITION_ID=0 ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config/distributed/server_0 & | ||
cd ${base_dir}/../executor/ir/target/release && | ||
RUST_LOG=info DATA_PATH=${base_dir}/../../gstest/ldbc_graph_exp_bin PARTITION_ID=1 ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config/distributed/server_1 & | ||
sleep 10 | ||
# start compiler service | ||
cd ${base_dir} && make run graph.schema:=../executor/ir/core/resource/ldbc_schema.json pegasus.hosts:=127.0.0.1:1234,127.0.0.1:1235 pegasus.server.num:=2 & | ||
sleep 5 | ||
# run gremlin standard tests | ||
cd ${base_dir} && make pattern_test | ||
exit_code=$? | ||
# clean service | ||
ps -ef | grep "com.alibaba.graphscope.gremlin.service.GraphServiceMain" | awk '{print $2}' | xargs kill -9 || true | ||
ps -ef | grep "start_rpc_server" | awk '{print $2}' | xargs kill -9 | ||
# report test result | ||
if [ $exit_code -ne 0 ]; then | ||
echo "ir integration pattern test on experimental store fail" | ||
exit 1 | ||
fi |
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
27 changes: 27 additions & 0 deletions
27
...gine/compiler/src/test/java/com/alibaba/graphscope/integration/pattern/IrPatternTest.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,27 @@ | ||
/* | ||
* Copyright 2020 Alibaba Group Holding Limited. | ||
* | ||
* 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. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.graphscope.integration.pattern; | ||
|
||
import com.alibaba.graphscope.gremlin.integration.graph.RemoteTestGraph; | ||
import com.alibaba.graphscope.gremlin.integration.graph.RemoteTestGraphProvider; | ||
|
||
import org.apache.tinkerpop.gremlin.GraphProviderClass; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(IrPatternTestSuite.class) | ||
@GraphProviderClass(provider = RemoteTestGraphProvider.class, graph = RemoteTestGraph.class) | ||
public class IrPatternTest {} |
46 changes: 46 additions & 0 deletions
46
...compiler/src/test/java/com/alibaba/graphscope/integration/pattern/IrPatternTestSuite.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,46 @@ | ||
/* | ||
* Copyright 2020 Alibaba Group Holding Limited. | ||
* | ||
* 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. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.graphscope.integration.pattern; | ||
|
||
import org.apache.tinkerpop.gremlin.AbstractGremlinSuite; | ||
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; | ||
import org.junit.runners.model.InitializationError; | ||
import org.junit.runners.model.RunnerBuilder; | ||
|
||
public class IrPatternTestSuite extends AbstractGremlinSuite { | ||
|
||
private static final Class<?>[] allTests = | ||
new Class<?>[] { | ||
PatternQueryTest.Traversals.class, | ||
}; | ||
|
||
private static final Class<?>[] testsToEnforce = | ||
new Class<?>[] { | ||
PatternQueryTest.Traversals.class, | ||
}; | ||
|
||
public IrPatternTestSuite(final Class<?> klass, final RunnerBuilder builder) | ||
throws InitializationError { | ||
super(klass, builder, allTests, testsToEnforce, false, TraversalEngine.Type.STANDARD); | ||
} | ||
|
||
public IrPatternTestSuite( | ||
final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute) | ||
throws InitializationError { | ||
super(klass, builder, testsToExecute, testsToEnforce, true, TraversalEngine.Type.STANDARD); | ||
} | ||
} |
Oops, something went wrong.