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

[Bug] "has()" cannot be queried after "inE()" under certain conditions #1736

Closed
1 task done
choeoe opened this issue Jan 20, 2022 · 2 comments
Closed
1 task done

[Bug] "has()" cannot be queried after "inE()" under certain conditions #1736

choeoe opened this issue Jan 20, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@choeoe
Copy link

choeoe commented Jan 20, 2022

Bug Type (问题类型)

gremlin (结果不合预期)

Before submit

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

Environment (环境信息)

  • Server Version: v0.12.0
  • Backend: memory
  • OS: 8 CPUs, 32 G RAM, windows wsl
  • Data Size: 3000 vertices, 6000 edges

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

An error occurred when querying "has()" after "inE()".

Expected:

The query is "g.V().inE('edge2','edge3','edge4').has('location','8672904391940353816')". It expects to return edges.

Actual behavior:

java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to com.baidu.hugegraph.backend.id.Id

Example to reproduce

hugegraph.schema().propertyKey("prop1").asText().ifNotExist().create();
hugegraph.schema().propertyKey("prop2").asText().ifNotExist().create();
        hugegraph.schema().indexLabel("locationindex").onE("read1").by("length4").shard().ifNotExist().create();
        hugegraph.schema().edgeLabel("edge1").sourceLabel("vertex1").targetLabel("vertex1").properties("prop1", "prop2").ifNotExist().create();
hugegraph.schema().edgeLabel("edge2").sourceLabel("vertex2").targetLabel("vertex2").properties("prop1", "prop2").ifNotExist().create();
hugegraph.schema().edgeLabel("edge3").sourceLabel("vertex3").targetLabel("vertex3").properties("prop1", "prop2").ifNotExist().create();
hugegraph.schema().edgeLabel("edge4").sourceLabel("vertex4").targetLabel("vertex4").properties("prop1", "prop2").ifNotExist().create();

String query = “g.V().inE('edge2','edge3','edge4').has('location','8672904391940353816')”;

When the query becomes "g.V().E().has('location','8672904391940353816')" or "g.V().inE('edge2','edge3','edge4')",system goes well.

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

No response

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

No response
@choeoe choeoe added the bug Something isn't working label Jan 20, 2022
javeme added a commit that referenced this issue Jan 20, 2022
fix: #1735 #1736
Change-Id: I28e3a209074abaab8c8271775679d54845e6e785
@javeme
Copy link
Contributor

javeme commented Jan 20, 2022

Currently it can query like this: g.V().inE('edge2').has('location','8672904391940353816')

Thanks for the feedback, we will fix it soon.

@choeoe
Copy link
Author

choeoe commented Jan 21, 2022

Thanks for response

javeme added a commit that referenced this issue Jan 21, 2022
* fix: can't query edges by multi labels + properties

fix: #1735 #1736
Change-Id: I28e3a209074abaab8c8271775679d54845e6e785
@javeme javeme closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants