Cosmosdb error with gremlin coin filter. Is there an alternative?

0

Using gremlin g.V().coin(0.5) against CosmosDB throws an error. Is there another way to randomly filter out a traverser?

ExceptionType : GraphCompileException ExceptionMessage : Gremlin Query Compilation Error: Unable to bind to method 'coin', with arguments of type: (Decimal) 1 Error(s) Source : Microsoft.Azure.Graphs Context : graphcompute Scope : graphparse-translate-csharpexpressionbinding GraphStatusCode : ScriptEvaluationError HResult : 0x80131500

azure-cosmosdb
gremlin
asked on Stack Overflow May 1, 2018 by Rick JN

1 Answer

2

According to your description, I checked the Gremlin steps supported by Azure Cosmos DB and found that the Coin Step is not listed. Then, I checked the whole reference on Gremlin about Coin Step:

To randomly filter out a traverser, use the coin()-step (filter). The provided double argument biases the "coin toss."

default GraphTraversal coin(double probability)

From the error response you provided mentioned as follows:

ExceptionType : GraphCompileException ExceptionMessage : Gremlin Query Compilation Error: Unable to bind to method 'coin', with arguments of type: (Decimal) 1 Error(s) Source : Microsoft.Azure.Graphs Context : graphcompute Scope : graphparse-translate-csharpexpressionbinding GraphStatusCode : ScriptEvaluationError HResult : 0x80131500

I just tried to execute the following Gremlin query on Azure Portal and found it could work.

g.V().coin(0.5d)

answered on Stack Overflow May 3, 2018 by Bruce Chen

User contributions licensed under CC BY-SA 3.0