janusgraph icon indicating copy to clipboard operation
janusgraph copied to clipboard

Unexpected result for indexed property

Open vitaliishandra opened this issue 1 year ago • 1 comments

We have the following query: g.E().hasId('pwrc-159kw-74l-1b8h4').inV().valueMap() The result of the query is: {EntityId=[12], uid=[User:12], AccountId=[15]} When I try to run the following: g.E().hasId('pwrc-159kw-74l-1b8h4').inV().valueMap('AccountId') I receive the {AccountId=[15]}. It is correct. However when I run the following query: g.E().hasId('pwrc-159kw-74l-1b8h4').inV().valueMap('uid') I receive the empty result {} Also the following queries returns incorrect results: g.E().hasId('pwrc-159kw-74l-1b8h4').inV().has('uid') - empty gremlin> g.E().hasId('pwrc-159kw-74l-1b8h4').inV().hasNot('uid') - v[2203816] image

It is just reproduced for few vertexes of thousands vertexes we have in Graph.

The 'uid' property has the unique index 'byUniqueId' created. Is it possible that index was broken? However as it is graph index, we suppose it doesn't matter image

Any ideas how to fix it?

vitaliishandra avatar Apr 09 '23 09:04 vitaliishandra

Can you please show the profile() output of these traversals? (So, please execute the traversals again, but append .profile() to them.) Also, please copy your input and the output from the Gremlin Console and paste it here instead of making a screenshot. That makes it easier to read and possible copy your code. That code should also be properly formatted as code by putting it into a block surrounded by ```. Like this: ``` <code comes here> ```

which will be formatted like this:

<code comes here>

FlorianHockmann avatar Apr 11 '23 09:04 FlorianHockmann