Jupyter profile parameter for %%gremlin doesn't work when the query contains "withBulk(false)" step

0

I've been trying to develop a query that uses the sack, which seems to require turning off the bulking for accurate traversal merging. If I add the withBulk() step the query returns the following when trying to profile:

{
  "detailedMessage": "When specified, the profile()-Step must be the last step or followed only by the cap()-step.",
  "requestId": "5078e1e8-0671-4a7a-94df-4fead2650e19",
  "code": "InternalFailureException"
}

Update:

I'm not particularly familiar with the airports dataset, but I whipped out this query which seems to demonstrate my problem.

g.withBulk(false).withSack(1.0d,sum).V().has('code','SAF').out().in().barrier()
.project("airport","sack").by(__.identity().values("code")).by(__.sack()).order().by(__.select("sack"),desc)

The withBulk(false) with sack() usage is unfortunately very briefly touched upon in the documentation, so I can't exactly understand what is happening, but my guess is that traversal merging is not performed properly with bulking enabled. If I run the query as is, I get the expected output: Without bulk output

If I remove it I get a lot of duplicates: With bulk output

As for Neptune actually allowing this configuration, I have no clue, I just noticed the difference which seems to align with the very brief and confusing explanation given in the TinkerPop docs: "There is now a single traverser with bulk of 2 and sack of 1.0 and thus, setting withBulk(false) yields the expected 1.0"

  • You should be able to use the sack() step without doing anything with the withBulk() configuration (which Neptune does not expose the ability to change those configurations, anyways). If you can provide more details on the type of query you're trying to write, we maybe able to help you with some examples.

  • Thank you for the response Taylor, I've just updated the question with more information on the issue

asked a year ago264 views
1 Answer
-1

For profiling queries, you should really use Neptune's Gremlin Profile API [1] instead of the profile() step.

If you use the following at the beginning of the cell:

%%gremlin profile

<query>

This will provide you with the profile details.

[1] https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html

profile pictureAWS
answered a year ago
  • The error is returned using %%gremlin profile

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions