From 115917004679c404212d87ca6d5d4eefb9cbc35c Mon Sep 17 00:00:00 2001 From: Xiaoli Zhou Date: Mon, 26 Aug 2024 17:09:42 +0800 Subject: [PATCH] Revert "feat(interactive): Support `PathExpand` with `PATH_OPT=TRAIL` in GIE" (#4183) Reverts alibaba/GraphScope#4101 --- .../tinkerpop/supported_gremlin_steps.md | 15 -- .../compiler/ir_experimental_ci.sh | 2 - interactive_engine/compiler/pom.xml | 4 - .../common/ir/runtime/ffi/Utils.java | 2 - .../common/ir/runtime/proto/Utils.java | 2 - .../common/ir/tools/config/GraphOpt.java | 3 +- .../graphscope/common/jna/type/PathOpt.java | 3 +- .../suite/standard/IrGremlinQueryTest.java | 209 +----------------- .../gremlin/plugin/step/PathExpandStep.java | 4 +- .../executor/ir/core/src/plan/ffi.rs | 1 - .../src/apis/graph/element/path.rs | 66 ++---- .../executor/ir/proto/algebra.proto | 2 - .../executor/ir/proto/physical.proto | 2 - .../executor/ir/runtime/src/assembly.rs | 3 +- .../runtime/src/process/operator/sink/sink.rs | 2 +- interactive_engine/pom.xml | 26 --- 16 files changed, 29 insertions(+), 317 deletions(-) diff --git a/docs/interactive_engine/tinkerpop/supported_gremlin_steps.md b/docs/interactive_engine/tinkerpop/supported_gremlin_steps.md index 895607d11ceb..229f2f6aa207 100644 --- a/docs/interactive_engine/tinkerpop/supported_gremlin_steps.md +++ b/docs/interactive_engine/tinkerpop/supported_gremlin_steps.md @@ -586,18 +586,6 @@ lengthRange - the lower and the upper bounds of the path length,
edgeLabel Usages of the with()-step:
keyValuePair - the options to configure the corresponding behaviors of the `PathExpand`-step. - -Below are the supported values and descriptions for `PATH_OPT` and `RESULT_OPT` options. - - Parameter | Supported Values | Description ------------|-------------------|------------------------------------------------ - PATH_OPT | ARBITRARY | Allow vertices or edges to be duplicated. - PATH_OPT | SIMPLE | No duplicated nodes. - PATH_OPT | TRAIL | No duplicated edges. - RESULT_OPT| END_V | Only keep the end vertex. - RESULT_OPT| ALL_V | Keep all vertices along the path. - RESULT_OPT| ALL_V_E | Keep all vertices and edges along the path. - ```bash # expand hops within the range of [1, 10) along the outgoing edges, # vertices can be duplicated and only the end vertex should be kept @@ -606,9 +594,6 @@ g.V().out("1..10").with('PATH_OPT', 'ARBITRARY').with('RESULT_OPT', 'END_V') # vertices and edges can be duplicated, and all vertices and edges along the path should be kept g.V().out("1..10").with('PATH_OPT', 'ARBITRARY').with('RESULT_OPT', 'ALL_V_E') # expand hops within the range of [1, 10) along the outgoing edges, -# edges cannot be duplicated, and all vertices and edges along the path should be kept -g.V().out("1..10").with('PATH_OPT', 'TRAIL').with('RESULT_OPT', 'ALL_V_E') -# expand hops within the range of [1, 10) along the outgoing edges, # vertices cannot be duplicated and all vertices should be kept g.V().out("1..10").with('PATH_OPT', 'SIMPLE').with('RESULT_OPT', 'ALL_V') # = g.V().out("1..10").with('PATH_OPT', 'ARBITRARY').with('RESULT_OPT', 'END_V') diff --git a/interactive_engine/compiler/ir_experimental_ci.sh b/interactive_engine/compiler/ir_experimental_ci.sh index 71d668c35d94..ae3dd45b7c35 100755 --- a/interactive_engine/compiler/ir_experimental_ci.sh +++ b/interactive_engine/compiler/ir_experimental_ci.sh @@ -37,7 +37,6 @@ fi # Test3: run gremlin standard tests on distributed experimental store via calcite-based ir # start distributed engine service and load modern graph -export DISTRIBUTED_ENV=true cd ${base_dir}/../executor/ir/target/release && RUST_LOG=info DATA_PATH=/tmp/gstest/modern_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 && @@ -55,7 +54,6 @@ if [ $exit_code -ne 0 ]; then echo "ir\(calcite-based\) gremlin integration with proto physical test on distributed experimental store fail" exit 1 fi -unset DISTRIBUTED_ENV # Test4: run cypher movie tests on experimental store via ir-core cd ${base_dir}/../executor/ir/target/release && DATA_PATH=/tmp/gstest/movie_graph_exp_bin RUST_LOG=info ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config & diff --git a/interactive_engine/compiler/pom.xml b/interactive_engine/compiler/pom.xml index db9c9b0ad2b4..2d368e12b8ec 100644 --- a/interactive_engine/compiler/pom.xml +++ b/interactive_engine/compiler/pom.xml @@ -234,10 +234,6 @@ - - org.apache.maven.plugins - maven-shade-plugin - org.apache.maven.plugins maven-clean-plugin diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/ffi/Utils.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/ffi/Utils.java index 5154d1221531..fa7655eea0a7 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/ffi/Utils.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/ffi/Utils.java @@ -117,8 +117,6 @@ public static final PathOpt ffiPathOpt(GraphOpt.PathExpandPath opt) { switch (opt) { case ARBITRARY: return PathOpt.Arbitrary; - case TRAIL: - return PathOpt.Trail; case SIMPLE: default: return PathOpt.Simple; diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/proto/Utils.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/proto/Utils.java index 41955150c9a6..86a354cd2e0f 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/proto/Utils.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/runtime/proto/Utils.java @@ -562,8 +562,6 @@ public static final GraphAlgebraPhysical.PathExpand.PathOpt protoPathOpt( return GraphAlgebraPhysical.PathExpand.PathOpt.ARBITRARY; case SIMPLE: return GraphAlgebraPhysical.PathExpand.PathOpt.SIMPLE; - case TRAIL: - return GraphAlgebraPhysical.PathExpand.PathOpt.TRAIL; default: throw new UnsupportedOperationException( "opt " + opt + " in path is unsupported yet"); diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/tools/config/GraphOpt.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/tools/config/GraphOpt.java index ab4e34dd23c1..27f464dc85f1 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/tools/config/GraphOpt.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/tools/config/GraphOpt.java @@ -59,8 +59,7 @@ public enum Match { public enum PathExpandPath { ARBITRARY, - SIMPLE, - TRAIL + SIMPLE } public enum PathExpandResult { diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/jna/type/PathOpt.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/jna/type/PathOpt.java index 788815cecbf6..64ecc99ffe3d 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/jna/type/PathOpt.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/jna/type/PathOpt.java @@ -20,8 +20,7 @@ public enum PathOpt implements IntEnum { Arbitrary, - Simple, - Trail; + Simple; @Override public int getInt() { diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java index f3bd48f94669..2a5631cb0ea4 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java @@ -199,36 +199,11 @@ public abstract class IrGremlinQueryTest extends AbstractGremlinProcessTest { public abstract Traversal get_g_V_path_expand_until_age_gt_30_values_age(); - // g.V().has("id",2).both("1..5").with("PATH_OPT","ARBITRARY").with("RESULT_OPT","END_V").count() - public abstract Traversal get_g_VX2X_both_with_arbitrary_endv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","SIMPLE").with("RESULT_OPT","END_V").count() - public abstract Traversal get_g_VX2X_both_with_simple_endv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","TRAIL").with("RESULT_OPT","END_V").count() - public abstract Traversal get_g_VX2X_both_with_trail_endv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","ARBITRARY").with("RESULT_OPT","ALL_V").count() - public abstract Traversal get_g_VX2X_both_with_arbitrary_allv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","SIMPLE").with("RESULT_OPT","ALL_V").count() - public abstract Traversal get_g_VX2X_both_with_simple_allv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","TRAIL").with("RESULT_OPT","ALL_V").count() - public abstract Traversal get_g_VX2X_both_with_trail_allv_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","ARBITRARY").with("RESULT_OPT","ALL_V_E").count() - public abstract Traversal get_g_VX2X_both_with_arbitrary_allve_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","SIMPLE").with("RESULT_OPT","ALL_V_E").count() - public abstract Traversal get_g_VX2X_both_with_simple_allve_count(); - - // g.V().has("id",2).both("1..5").with("PATH_OPT","TRAIL").with("RESULT_OPT","ALL_V_E").count() - public abstract Traversal get_g_VX2X_both_with_trail_allve_count(); - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) @Test public void g_V_path_expand_until_age_gt_30_values_age() { + // the until condition follows a sql-like expression syntax, which can only be opened when + // language type is antlr_gremlin_calcite assumeTrue("antlr_gremlin_calcite".equals(System.getenv("GREMLIN_SCRIPT_LANGUAGE_NAME"))); final Traversal traversal = get_g_V_path_expand_until_age_gt_30_values_age(); @@ -276,96 +251,6 @@ public void g_V_where_expr_name_equal_marko_and_age_gt_20_or_age_lt_10_name() { Assert.assertEquals("marko", traversal.next()); } - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_arbitrary_endv_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_arbitrary_endv_count(); - printTraversalForm(traversal); - Assert.assertEquals(28, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_simple_endv_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_simple_endv_count(); - printTraversalForm(traversal); - Assert.assertEquals(9, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_trail_endv_count() { - // Skip this test in distributed settings because edge ids might differ - // across partitions in experimental store. - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - assumeFalse("true".equals(System.getenv("DISTRIBUTED_ENV"))); - final Traversal traversal = get_g_VX2X_both_with_trail_endv_count(); - printTraversalForm(traversal); - Assert.assertEquals(11, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_arbitrary_allv_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_arbitrary_allv_count(); - printTraversalForm(traversal); - Assert.assertEquals(28, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_simple_allv_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_simple_allv_count(); - printTraversalForm(traversal); - Assert.assertEquals(9, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_trail_allv_count() { - // Skip this test in distributed settings because edge ids might differ - // across partitions in experimental store. - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - assumeFalse("true".equals(System.getenv("DISTRIBUTED_ENV"))); - final Traversal traversal = get_g_VX2X_both_with_trail_allv_count(); - printTraversalForm(traversal); - Assert.assertEquals(11, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_arbitrary_allve_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_arbitrary_allve_count(); - printTraversalForm(traversal); - Assert.assertEquals(28, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_simple_allve_count() { - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - final Traversal traversal = get_g_VX2X_both_with_simple_allve_count(); - printTraversalForm(traversal); - Assert.assertEquals(9, traversal.next().intValue()); - } - - @Test - @LoadGraphWith(LoadGraphWith.GraphData.MODERN) - public void g_VX2X_both_with_trail_allve_count() { - // Skip this test in distributed settings because edge ids might differ - // across partitions in experimental store. - assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE"))); - assumeFalse("true".equals(System.getenv("DISTRIBUTED_ENV"))); - final Traversal traversal = get_g_VX2X_both_with_trail_allve_count(); - printTraversalForm(traversal); - Assert.assertEquals(11, traversal.next().intValue()); - } - @Test @LoadGraphWith(MODERN) public void g_V_both_both_dedup_byXoutE_countX_name() { @@ -1540,96 +1425,6 @@ public Traversal get_g_V_select_expr_2_xor_3_mult_2_limit_1() { .values("name"); } - @Override - public Traversal get_g_VX2X_both_with_arbitrary_endv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "ARBITRARY") - .with("RESULT_OPT", "END_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_simple_endv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "SIMPLE") - .with("RESULT_OPT", "END_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_trail_endv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "TRAIL") - .with("RESULT_OPT", "END_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_arbitrary_allv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "ARBITRARY") - .with("RESULT_OPT", "ALL_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_simple_allv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "SIMPLE") - .with("RESULT_OPT", "ALL_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_trail_allv_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "TRAIL") - .with("RESULT_OPT", "ALL_V") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_arbitrary_allve_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "ARBITRARY") - .with("RESULT_OPT", "ALL_V_E") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_simple_allve_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "SIMPLE") - .with("RESULT_OPT", "ALL_V_E") - .count()); - } - - @Override - public Traversal get_g_VX2X_both_with_trail_allve_count() { - return ((IrCustomizedTraversal) - g.V().has("id", 2) - .both("1..5") - .with("PATH_OPT", "TRAIL") - .with("RESULT_OPT", "ALL_V_E") - .count()); - } - @Override public Traversal get_g_V_path_expand_until_age_gt_30_values_age() { return ((IrCustomizedTraversal) diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/plugin/step/PathExpandStep.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/plugin/step/PathExpandStep.java index d0dfc7f79e4a..c51d5c10d8fe 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/plugin/step/PathExpandStep.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/plugin/step/PathExpandStep.java @@ -87,13 +87,13 @@ public void configure(final Object... keyValues) { String key = toCamelCaseInsensitive(originalKey); String value = toCamelCaseInsensitive(originalVal); if (key.equals("PathOpt")) { - if (value.equals("Arbitrary") || value.equals("Simple") || value.equals("Trail")) { + if (value.equals("Arbitrary") || value.equals("Simple")) { this.pathOpt = PathOpt.valueOf(value); } else { throw new ExtendGremlinStepException( "value " + originalVal - + " is invalid, use ARBITRARY, SIMPLE or TRAIL instead (case" + + " is invalid, use ARBITRARY or SIMPLE instead (case" + " insensitive)"); } } else if (key.equals("ResultOpt")) { diff --git a/interactive_engine/executor/ir/core/src/plan/ffi.rs b/interactive_engine/executor/ir/core/src/plan/ffi.rs index 63063c37b886..f622220aa164 100644 --- a/interactive_engine/executor/ir/core/src/plan/ffi.rs +++ b/interactive_engine/executor/ir/core/src/plan/ffi.rs @@ -2312,7 +2312,6 @@ mod graph { pub enum PathOpt { Arbitrary = 0, Simple = 1, - Trail = 2, } #[allow(dead_code)] diff --git a/interactive_engine/executor/ir/graph_proxy/src/apis/graph/element/path.rs b/interactive_engine/executor/ir/graph_proxy/src/apis/graph/element/path.rs index 5a2a55eb2653..326b17519c4b 100644 --- a/interactive_engine/executor/ir/graph_proxy/src/apis/graph/element/path.rs +++ b/interactive_engine/executor/ir/graph_proxy/src/apis/graph/element/path.rs @@ -85,11 +85,9 @@ pub enum GraphPath { AllPath(Vec), /// Simple path, which may contains both vertices and edges, or only vertices. SimpleAllPath(Vec), - /// Trail, which may contains both vertices and edges, or only vertices. - TrailAllPath(Vec), - /// Arbitrary path with only end vertices preserved. + /// Arbitrary path with only end vertices preserved, which may contain both vertices and edges, or only vertices. EndV((VertexOrEdge, usize)), - /// Simple path with only end vertex preserved. + /// Simple path with only end vertex preserved, which may contains both vertices and edges, or only vertices. SimpleEndV((VertexOrEdge, Vec, usize)), } @@ -104,13 +102,11 @@ impl GraphPath { let entry = entry.into(); let id = entry.id(); GraphPath::SimpleEndV((entry, vec![id], 1)) - }, - pb::path_expand::PathOpt::Trail => GraphPath::TrailAllPath(vec![entry.into()]), + } }, pb::path_expand::ResultOpt::AllV | pb::path_expand::ResultOpt::AllVE => match path_opt { pb::path_expand::PathOpt::Arbitrary => GraphPath::AllPath(vec![entry.into()]), pb::path_expand::PathOpt::Simple => GraphPath::SimpleAllPath(vec![entry.into()]), - pb::path_expand::PathOpt::Trail => GraphPath::TrailAllPath(vec![entry.into()]), }, } } @@ -124,16 +120,7 @@ impl GraphPath { } GraphPath::SimpleAllPath(ref mut path) => { let entry = entry.into(); - if entry.is_vertex() && path.contains(&entry) { - false - } else { - path.push(entry); - true - } - } - GraphPath::TrailAllPath(ref mut path) => { - let entry = entry.into(); - if entry.is_edge() && path.contains(&entry) { + if path.contains(&entry) { false } else { path.push(entry); @@ -150,7 +137,7 @@ impl GraphPath { } GraphPath::SimpleEndV((ref mut e, ref mut path, ref mut weight)) => { let entry = entry.into(); - if entry.is_vertex() && path.contains(&entry.id()) { + if path.contains(&entry.id()) { false } else { path.push(entry.id()); @@ -167,35 +154,35 @@ impl GraphPath { pub fn get_path_start(&self) -> Option<&VertexOrEdge> { match self { - GraphPath::AllPath(ref p) | GraphPath::SimpleAllPath(ref p) | GraphPath::TrailAllPath(ref p) => p.first(), + GraphPath::AllPath(ref p) | GraphPath::SimpleAllPath(ref p) => p.first(), GraphPath::EndV(_) | GraphPath::SimpleEndV(_) => None, } } pub fn get_path_end(&self) -> &VertexOrEdge { match self { - GraphPath::AllPath(ref p) | GraphPath::SimpleAllPath(ref p) | GraphPath::TrailAllPath(ref p) => p.last().unwrap(), + GraphPath::AllPath(ref p) | GraphPath::SimpleAllPath(ref p) => p.last().unwrap(), GraphPath::EndV((ref e, _)) | GraphPath::SimpleEndV((ref e, _, _)) => e, } } pub fn get_path_end_mut(&mut self) -> &mut VertexOrEdge { match self { - GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) | GraphPath::TrailAllPath(ref mut p) => p.last_mut().unwrap(), + GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) => p.last_mut().unwrap(), GraphPath::EndV((ref mut e, _)) | GraphPath::SimpleEndV((ref mut e, _, _)) => e, } } pub fn get_path(&self) -> Option<&Vec> { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => Some(p), + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => Some(p), GraphPath::EndV(_) | GraphPath::SimpleEndV(_) => None, } } pub fn take_path(self) -> Option> { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => Some(p), + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => Some(p), GraphPath::EndV(_) | GraphPath::SimpleEndV(_) => None, } } @@ -214,7 +201,7 @@ impl GraphPath { false } } - GraphPath::SimpleAllPath(_) | GraphPath::TrailAllPath(_) => { + GraphPath::SimpleAllPath(_) => { if let Some(other_path) = other.take_path() { for e in other_path { if !self.append(e) { @@ -233,7 +220,7 @@ impl GraphPath { // pop the last element from the path, and return the element. pub fn pop(&mut self) -> Option { match self { - GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) | GraphPath::TrailAllPath(ref mut p) => p.pop(), + GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) => p.pop(), GraphPath::EndV(_) | GraphPath::SimpleEndV(_) => None, } } @@ -241,7 +228,7 @@ impl GraphPath { // reverse the path. pub fn reverse(&mut self) { match self { - GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) | GraphPath::TrailAllPath(ref mut p) => { + GraphPath::AllPath(ref mut p) | GraphPath::SimpleAllPath(ref mut p) => { p.reverse(); } GraphPath::EndV(_) | GraphPath::SimpleEndV(_) => {} @@ -251,7 +238,7 @@ impl GraphPath { // get the element ids in the path, including both vertices and edges. pub fn get_elem_ids(&self) -> Vec { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => p.iter().map(|e| e.id()).collect(), + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => p.iter().map(|e| e.id()).collect(), GraphPath::EndV((e, _)) | GraphPath::SimpleEndV((e, _, _)) => vec![e.id()], } } @@ -259,7 +246,7 @@ impl GraphPath { // get the element labels in the path, including both vertices and edges. pub fn get_elem_labels(&self) -> Vec> { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => p.iter().map(|e| e.label()).collect(), + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => p.iter().map(|e| e.label()).collect(), GraphPath::EndV((e, _)) | GraphPath::SimpleEndV((e, _, _)) => vec![e.label()], } } @@ -332,7 +319,7 @@ impl Element for GraphPath { // the path len is the number of edges in the path; fn len(&self) -> usize { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => { + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => { p.iter() .filter(|v_or_e| v_or_e.is_vertex()) .count() @@ -362,7 +349,7 @@ impl GraphElement for GraphPath { fn get_property(&self, key: &NameOrId) -> Option { match self { - GraphPath::AllPath(path) | GraphPath::SimpleAllPath(path) | GraphPath::TrailAllPath(path) => { + GraphPath::AllPath(path) | GraphPath::SimpleAllPath(path) => { let mut properties = vec![]; for v_or_e in path { if let Some(p) = v_or_e.get_property(key) { @@ -389,7 +376,7 @@ impl GraphElement for GraphPath { fn get_all_properties(&self) -> Option> { match self { - GraphPath::AllPath(_) | GraphPath::SimpleAllPath(_) | GraphPath::TrailAllPath(_) => { + GraphPath::AllPath(_) | GraphPath::SimpleAllPath(_) => { // not supported yet. None } @@ -407,13 +394,8 @@ impl PartialEq for GraphPath { match (self, other) { (GraphPath::AllPath(p1), GraphPath::AllPath(p2)) | (GraphPath::AllPath(p1), GraphPath::SimpleAllPath(p2)) - | (GraphPath::AllPath(p1), GraphPath::TrailAllPath(p2)) | (GraphPath::SimpleAllPath(p1), GraphPath::AllPath(p2)) - | (GraphPath::SimpleAllPath(p1), GraphPath::SimpleAllPath(p2)) - | (GraphPath::SimpleAllPath(p1), GraphPath::TrailAllPath(p2)) - | (GraphPath::TrailAllPath(p1), GraphPath::AllPath(p2)) - | (GraphPath::TrailAllPath(p1), GraphPath::SimpleAllPath(p2)) - | (GraphPath::TrailAllPath(p1), GraphPath::TrailAllPath(p2)) => p1.eq(p2), + | (GraphPath::SimpleAllPath(p1), GraphPath::SimpleAllPath(p2)) => p1.eq(p2), (GraphPath::EndV((p1, _)), GraphPath::EndV((p2, _))) | (GraphPath::EndV((p1, _)), GraphPath::SimpleEndV((p2, _, _))) | (GraphPath::SimpleEndV((p1, _, _)), GraphPath::EndV((p2, _))) @@ -496,10 +478,6 @@ impl Encode for GraphPath { path.write_to(writer)?; writer.write_u64(*weight as u64)?; } - GraphPath::TrailAllPath(path) => { - writer.write_u8(4)?; - path.write_to(writer)?; - } } Ok(()) } @@ -528,10 +506,6 @@ impl Decode for GraphPath { let weight = ::read_from(reader)? as usize; Ok(GraphPath::SimpleEndV((vertex_or_edge, path, weight))) } - 4 => { - let path = >::read_from(reader)?; - Ok(GraphPath::TrailAllPath(path)) - } _ => Err(std::io::Error::new(std::io::ErrorKind::Other, "unreachable")), } } @@ -571,7 +545,7 @@ impl TryFrom for GraphPath { impl Hash for GraphPath { fn hash(&self, state: &mut H) { match self { - GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) | GraphPath::TrailAllPath(p) => p.hash(state), + GraphPath::AllPath(p) | GraphPath::SimpleAllPath(p) => p.hash(state), GraphPath::EndV((e, _)) | GraphPath::SimpleEndV((e, _, _)) => e.hash(state), } } diff --git a/interactive_engine/executor/ir/proto/algebra.proto b/interactive_engine/executor/ir/proto/algebra.proto index 3587bb631270..4a7dd61b7962 100644 --- a/interactive_engine/executor/ir/proto/algebra.proto +++ b/interactive_engine/executor/ir/proto/algebra.proto @@ -323,8 +323,6 @@ message PathExpand { ARBITRARY = 0; // a path without vertex duplications SIMPLE = 1; - // a path without edge duplications - TRAIL = 2; } // Define what result is required for this path. We currently support `EndV` and `AllV`, while an option to // include all edges and vertices may be needed in the future. diff --git a/interactive_engine/executor/ir/proto/physical.proto b/interactive_engine/executor/ir/proto/physical.proto index 8e4f30d40ac4..4a3983c55941 100644 --- a/interactive_engine/executor/ir/proto/physical.proto +++ b/interactive_engine/executor/ir/proto/physical.proto @@ -221,8 +221,6 @@ message PathExpand { ARBITRARY = 0; // a path without vertex duplications SIMPLE = 1; - // a path without edge duplications - TRAIL = 2; } // Define what result is required for this path. We currently support `EndV` and `AllV`, while an option to // include all edges and vertices may be needed in the future. diff --git a/interactive_engine/executor/ir/runtime/src/assembly.rs b/interactive_engine/executor/ir/runtime/src/assembly.rs index 9cef1c501579..4f8c66926782 100644 --- a/interactive_engine/executor/ir/runtime/src/assembly.rs +++ b/interactive_engine/executor/ir/runtime/src/assembly.rs @@ -786,7 +786,8 @@ impl IRJobAssembly { base ))) })?; - if (pb::path_expand::ResultOpt::AllVE == unsafe { std::mem::transmute(path.result_opt) } || pb::path_expand::PathOpt::Trail == unsafe { std::mem::transmute(path.path_opt) }) + + if pb::path_expand::ResultOpt::AllVE == unsafe { std::mem::transmute(path.result_opt) } && pb::edge_expand::ExpandOpt::Vertex == unsafe { std::mem::transmute(edge_expand.expand_opt) } { diff --git a/interactive_engine/executor/ir/runtime/src/process/operator/sink/sink.rs b/interactive_engine/executor/ir/runtime/src/process/operator/sink/sink.rs index 426a2c2e782a..93e61c09baae 100644 --- a/interactive_engine/executor/ir/runtime/src/process/operator/sink/sink.rs +++ b/interactive_engine/executor/ir/runtime/src/process/operator/sink/sink.rs @@ -355,7 +355,7 @@ impl RecordSinkEncoder { fn path_to_pb(&self, p: &GraphPath) -> result_pb::GraphPath { let mut graph_path_pb = vec![]; match p { - GraphPath::AllPath(path) | GraphPath::SimpleAllPath(path) | GraphPath::TrailAllPath(path) => { + GraphPath::AllPath(path) | GraphPath::SimpleAllPath(path) => { for vertex_or_edge in path { let vertex_or_edge_pb = self.vertex_or_edge_to_pb(vertex_or_edge); graph_path_pb.push(vertex_or_edge_pb); diff --git a/interactive_engine/pom.xml b/interactive_engine/pom.xml index f88742d73e9b..ebac47b2d6ec 100644 --- a/interactive_engine/pom.xml +++ b/interactive_engine/pom.xml @@ -737,32 +737,6 @@ maven-shade-plugin ${maven.shade.version} - - - package - - shade - - - - - com.alibaba.graphscope:interactive - - com.alibaba.graphscope.gaia.proto.* - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - maven-assembly-plugin