Skip to content

Inconsistent behavior when querying with explicit gremlin #5714

@obi1kenobi

Description

@obi1kenobi

With OrientDB 2.1.9 and a database that has some data (both vertices and edges, specifics are not relevant):

select * from V where count(gremlin('g.V.next()')) = 0

This returns no records.

select * from V where count(gremlin('g.V.next()')) > 0

This returns all the vertices in the database.

g.V.next()

In Studio, this returns one vertex.

select gremlin('g.V.next()')

This throws:

java.lang.IllegalArgumentException: Cannot determine the graph element type because the document class is null. Probably this is a projection, use the EXPAND() function
select count(gremlin('g.V.next()'))

This throws the same error as above.

select expand(gremlin('g.V.next()'))

This returns no records.

There are several problems here:

  • The queries are internally inconsistent -- the count can't be both invalid and greater than 0.
  • The perfectly valid select gremlin(...) query doesn't work when the gremlin query entered directly works fine.
  • I'd expect expand to throw an error if the argument it's called with is invalid, not return no records and swallow the problem.

Metadata

Metadata

Labels

buglegacy not used anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions