Neptune's implementation of .order().by() incorrectly filters out objects

36 views
Skip to first unread message

Daniel C. Weber

unread,
Sep 21, 2022, 11:55:38 AM9/21/22
to Gremlin-users
Hello,

In Tinkerpop version 3.5, the handling of empty traversals in the by-modulators of order steps has been changed to not fail the entire query but to assume some notion of null for the value that is compared.

This works well in Gremlin Server 3.5.x: Ordering some vertices on a non-existent property will neither fail nor filter out any of those vertices, but instead produce some ordering of the vertices.

Neptune, however, in Engine release 1.2.0.0 (and at least 1.1.0.0) will also not fail but filter out the vertices. But order() must not act as a filter-step.

This is easy to reproduce:

- g.addV().addV()
- g.V().count() -> 2
- g.V().order().by('key').count() -> 0

This is also the case with both values for "Neptune#useDFE".

Can anybody confirm this behaviour?

Thanks a lot
Daniel

Stephen Mallette

unread,
Sep 22, 2022, 8:34:16 AM9/22/22
to gremli...@googlegroups.com
Neptune is behaving with 3.6.x logic in this case (despite there not being specific 3.6.x support just yet):




--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/2952d8e3-816e-4d0f-b774-caebbea7eef3n%40googlegroups.com.

Daniel C. Weber

unread,
Sep 23, 2022, 5:35:55 AM9/23/22
to Gremlin-users
This is unfortunate since Neptune advertises 3.5.2 as compatibility level. I'm not questioning the design decisions and I am usually able to work around these things, but I think having an OrderGlobalStep behave like a filter step is going to cause trouble for a lot of people.

Do you have an ETA for 3.6 on Neptune?

Thanks a lot




Phil Crosland

unread,
Sep 23, 2022, 10:36:41 AM9/23/22
to Gremlin-users
is it possible to add a parameter to order() to allow inclusion of all items?

Stephen Mallette

unread,
Sep 26, 2022, 6:47:16 AM9/26/22
to gremli...@googlegroups.com
> Do you have an ETA for 3.6 on Neptune?

I dont really - I can just say it's under development.

> is it possible to add a parameter to order() to allow inclusion of all items?

it depends on whether or not the graph supports ProductiveByStrategy. adding that in should produce nulls: 


Neptune doesn't support that which is part of the reason why it is exhibiting the 3.6.x behavior. You could also always just be explicit about it in your Gremlin:

g.V().order().by(coalesce(values('lang'),constant(null)))



Reply all
Reply to author
Forward
0 new messages