JanusGraph / JanusGraph/janusgraph

JanusGraphVertexDeserializer discards vertices without properties and edges

Open
#1,002 0 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

The `JanusGraphVertexDeserializer` has the following logic in the `readHadoopVertex` method that causes vertices without edges and properties to be ignored.

```
/*Since we are filtering out system relation types, we might end up with vertices that have no incident relations.
This is especially true for schema vertices. Those are filtered out. */
if (!tv.edges(Direction.BOTH).hasNext() && !tv.properties().hasNext()) {
log.trace("Vertex {} has no relations", vertexId);
return null;
}
```

```
gremlin> graph = JanusGraphFactory.open('conf/janusgraph-cassandra.properties')
==>standardjanusgraph[cassandrathrift:[127.0.0.1]]
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[cassandrathrift:[127.0.0.1]], standard]
gremlin> g.V().count()
19:56:44 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [()]. For better performance, use indexes
==>100
gremlin>
gremlin> graph = GraphFactory.open('conf/hadoop-graph/read-cassandra.properties')
==>hadoopgraph[cassandrainputformat->gryooutputformat]
gremlin> g = graph.traversal().withComputer(SparkGraphComputer)
==>graphtraversalsource[hadoopgraph[cassandrainputformat->gryooutputformat], sparkgraphcomputer]
gremlin> cnt = g.V().count().next()
==>0e 0:===================================> (3 + 2) / 5]
gremlin> cnt
==>0
```

Contributor guide

Open the contributing guide

Research direction

Start in JanusGraphVertexDeserializer.readHadoopVertex and inspect the guard that returns null for vertices without edges or properties. Reproduce the discrepancy using conf/janusgraph-cassandra.properties and conf/hadoop-graph/read-cassandra.properties, then verify that the Hadoop traversal no longer drops those vertices and that the vertex count reflects the source graph.

Written by the indexing model from the issue text.

Assessment

Tech stack
cassandra, hadoop, java
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.