Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Sack not initialising properly. #297

Open
karlmvwaugh opened this issue Mar 15, 2021 · 1 comment
Open

With Sack not initialising properly. #297

karlmvwaugh opened this issue Mar 15, 2021 · 1 comment

Comments

@karlmvwaugh
Copy link

I'm using gremlin-scala to talk to a Neptune instance.
Trying to use WithSack in a traversal I kept getting the error

Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: An error occurred during serialization of this request [RequestMessage{, requestId=f2258d63-4265-499e-9684-dde9b007e0d1, op='bytecode', processor='traversal', args={gremlin=[[withSack(gremlin.scala.package$$anon$1@19e943ef)], [V(), limit(5)]], aliases={g=g}}}] - it could not be sent to the server - Reason: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IllegalArgumentException: Class is not registered: gremlin.scala.package$$anon$1

I attempted multiple variations on syntax to get it to work.
traversalSource.withSack(1.0)
is my intended usage.

In the end I can get it working by emulating the underlying call but without using a lambda. That is:

TraversalSource(traversalSource.underlying.withSack[Double](1.0))

but if I try this with a lambda that returns a double it doesn't work and the libraries implementation of the constant version falls back on the lambda version.

@jeremysears
Copy link
Collaborator

jeremysears commented Mar 15, 2021

I think this is a bug in TraversalSource.withSack[A](initial: A). I think this:

def withSack[A](initialValue: A): TraversalSource =
    withSack(() => initialValue)

Should be:

def withSack[A](initialValue: A) =
    TraversalSource(underlying.withSack(initialValue))

Feel free to submit a PR.

I haven't worked with Neptune, but for lambdas in general, it would be nice if gremlin-scala had some support for something like this, even if it wasn't type safe. I may evaluate JanusGraph with BigTable at some point, and if I do, I may poke at lambda support w/ remote DBs.
https://tinkerpop.apache.org/docs/current/reference/#gremlin-java-lambda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants