JanusGraph / JanusGraph/janusgraph

hasId does not convert int to Long

Open
#1,554 2 comments 0 reactions 0 assignees View on GitHub
area/core help wanted kind/enhancement
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

If an int is passed instead of a String or a Long to `hasId()` it does not get converted and results won't be yielded. This behavior has been report in issue #706, but I think this would be a nice improvement.

I think looking at the [HasStepFolder.foldInIds()](https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/HasStepFolder.java#L118) method might be a good place to start.

Additional info can be found in this [stack overflow question](https://stackoverflow.com/questions/55912624/get-all-edges-between-multiple-vertices-janusgraph/55929179#55929179) and this
[tinkerpop issue](https://issues.apache.org/jira/browse/TINKERPOP-2209)

Contributor guide

Open the contributing guide

Research direction

Start in janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/HasStepFolder.java, particularly foldInIds(), and compare how int, String, and Long values are handled by hasId(). Reproduce the integer-id case using the linked context, then verify that integer inputs yield the same results as equivalent Long inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.