Problem up-front: AWS Neptune seems to break when using a .sack(__.sum).by()
operation.
Background:
- Here is a small bit of data on which to test
- The query in question works fine via the Gremlin console
- I came across this tackling a larger problem, but the length of that post (and my multiple updates to it...) were burying the problem, so I'm posting this here, separately.
Conditions
- Data store: AWS Neptune
- Querying from / runtime: AWS Lambda running Node.js
Given the above, this query will execute:
return await g.withSack(120)
.V(fromPortId)
.repeat(
(__.outE().hasLabel('VOYAGES_TO'))
.inV()
.simplePath()
)
.until(
__.has('code', toPortId).and()
.sack().is(lte(travelTimeBudget))
)
.order().by(__.sack(), __.desc)
.local(
__.union(__.path().by('code')
.by('duration'), __.sack()).fold()
)
.local(
__.unfold().unfold().fold()
)
.toList()
.then(data => {
return data
})
.catch(error => {
console.log('ERROR', error);
});
... but this query will not:
return await g.withSack(120)
.V(fromPortId)
.repeat(
(__.outE().hasLabel('VOYAGES_TO').sack(__.sum).by('duration'))
.sack(__.sum).by(__.constant(45))
.inV()
.simplePath()
)
.until(
__.has('code', toPortId).and()
.sack().is(lte(travelTimeBudget))
)
.order().by(__.sack(), __.desc)
.local(
__.union(__.path().by('code')
.by('duration'), __.sack()).fold()
)
.local(
__.unfold().unfold().fold()
)
.toList()
.then(data => {
return data
})
.catch(error => {
console.log('ERROR', error);
});
... and the only difference between the two is the presence of the .sack(__.sum).by()
operators.
Any thoughts or suggestions?