Skip to content

[Bug] has() cannot be queried after "outE()" when multiple labels in "outE()" #1949

Description

@zhengyingying

Bug Type (问题类型)

No response

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题

Environment (环境信息)

  • Server Version: v0.12.0
  • Backend: memory
  • OS: CentOS
  • Data Size: 100 vertices, 200 edges

Expected & Actual behavior (期望与实际表现)

We execute the query g.V().outE('el0','el1').has('ep0',true) in HugeGraph.

Expected behavior

We expect it returns some edges.

Actual behavior

However, it throws unexpected exceptions.
java.util.Arrays$ArrayList cannot be cast to com.baidu.hugegraph.backend.id.Id

Reproduce

You can reproduce this issue using the following code.

            connection.getHugespecial().schema().propertyKey("ep1").asBoolean().ifNotExist().create();
            connection.getHugespecial().schema().propertyKey("vp0").asBoolean().ifNotExist().create();

            // vertex
            connection.getHugespecial().schema().vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
            connection.getHugespecial().schema().indexLabel("vl0Byvp0").onV("vl0").by("vp0").shard().ifNotExist().create();

            // edges
            connection.getHugespecial().schema().edgeLabel("el0").sourceLabel("vl0").targetLabel("vl0").properties("ep0").ifNotExist().create();
            connection.getHugespecial().schema().edgeLabel("el1").sourceLabel("vl0").targetLabel("vl0").properties("ep1").ifNotExist().create();
            connection.getHugespecial().schema().indexLabel("el0Byep0").onE("el0").by("ep0").shard().ifNotExist().create();
            connection.getHugespecial().schema().indexLabel("el1Byep0").onE("el1").by("ep1").shard().ifNotExist().create();

            /** create graph data */
            Vertex vertex1 = new Vertex("vl0").property("vp0", true);
            Vertex vertex2 = new Vertex("vl0").property("vp0", false);
            Vertex vertex3 = new Vertex("vl0").property("vp0", true);
            graph.addVertices(Arrays.asList(vertex1, vertex2, vertex3));

            Edge edge1 = new Edge("el0").source(vertex1).target(vertex2).property("ep0", true);
            Edge edge2 = new Edge("el1").source(vertex1).target(vertex3).property("ep1", false);
            graph.addEdges(Arrays.asList(edge1, edge2));

            GremlinManager gremlin = connection.getHugespecial().gremlin();

            String query = "g.V().outE('el0','el1').has('ep0',true)";


### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersgremlinTinkerPop gremlin

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions