Search code examples
gremlinjanusgraphgremlinpython

Mismatch between janusgraph date value and gremlin query result


I have some graph data with date type values. My gremlin query for the date type property is working, but output value is not the date value.

Environment:

  • Janusgraph 0.3.1
  • gremlinpython 3.4.3

Below is my example:

  • Data (JanusGraph): {"ID": "doc_1", "MY_DATE": [Tue Jan 10 00:00:00 KST 1079]}
  • Query: g.V().has("ID", "doc_1").valueMap("MY_DATE")
  • Output (gremlinpython): datetime(1079, 1, 16)

The error is 6 days (1079.1.10 -> 1079.1.16). This mismatch does not occur when the years are above 1600. Does the timestamp have some serialization/deserialization problems between janusgraph and gremlinpython?

Thanks


Solution

  • There were some issue with Python and dates but I would have them fixed for 3.4.3, which is the version you stated you were using. The issue is described here at TINKERPOP-2264 along with the fix, but basically there were some issues with timezones. From your example data, it looks like you store your date with a timezone (i.e. KST). I'm not completely sure, but I would imagine things would work as expected if the date was stored as UTC.