Skip to content

Double index problems? #135

Open
Open
@rtfpessoa

Description

@rtfpessoa

I am having problems running this query:

graph
  .V()
  .has("V_Foo", "prop2", "4ab25da0-3602-4f4a-bc5e-28bfefa5ca4c")
  .outE("edge1", "edge2")
  .inV()
  .toList
  .map(_.property("prop3"))

when I have an index like this:

fooClass.createIndex("V_Foo", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "prop1", "prop2")

it seems that he is trying to convert the value of the second field of the index to the type of the first element of the index giving this exception:

Exception in thread "main" java.lang.NumberFormatException: For input string: "4ab25da0-3602-4f4a-bc5e-28bfefa5ca4c"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:589)
	at java.lang.Long.parseLong(Long.java:631)
	at com.orientechnologies.orient.core.metadata.schema.OType.convert(OType.java:344)
	at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.convertValue(OrientGraph.java:256)
	at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.lambda$null$6(OrientGraph.java:282)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.lambda$elements$4(OrientGraphStep.java:98)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.elements(OrientGraphStep.java:93)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.vertices(OrientGraphStep.java:54)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.lambda$new$0(OrientGraphStep.java:46)
	at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:139)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
	at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:177)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:115)
	at gremlin.scala.GremlinScala.toList(GremlinScala.scala:30)

If I change the index to:

fooClass.createIndex("V_Foo", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "prop2", "prop1")

The error changes to:

Exception in thread "main" com.orientechnologies.orient.core.index.OIndexException: Impossible add as key of a CompositeIndex a value of type class java.lang.String
	DB name="test-1501851693982"
	at com.orientechnologies.orient.core.index.OCompositeCollate.transform(OCompositeCollate.java:62)
	at com.orientechnologies.orient.core.index.OIndexAbstract.getCollatingValue(OIndexAbstract.java:894)
	at com.orientechnologies.orient.core.index.OIndexOneValue.get(OIndexOneValue.java:47)
	at com.orientechnologies.orient.core.index.OIndexOneValue.get(OIndexOneValue.java:40)
	at com.orientechnologies.orient.core.index.OIndexAbstractDelegate.get(OIndexAbstractDelegate.java:58)
	at com.orientechnologies.orient.core.index.OIndexTxAwareOneValue.get(OIndexTxAwareOneValue.java:262)
	at com.orientechnologies.orient.core.index.OIndexTxAwareOneValue.get(OIndexTxAwareOneValue.java:40)
	at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.lookupInIndex(OrientGraph.java:292)
	at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.lambda$null$7(OrientGraph.java:283)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.lambda$elements$4(OrientGraphStep.java:98)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.elements(OrientGraphStep.java:93)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.vertices(OrientGraphStep.java:54)
	at org.apache.tinkerpop.gremlin.orientdb.traversal.step.sideEffect.OrientGraphStep.lambda$new$0(OrientGraphStep.java:46)
	at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:139)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
	at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:177)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:115)
	at gremlin.scala.GremlinScala.toList(GremlinScala.scala:30)

I noticed this two (#126 #110) similar issues but not sure if it can be the same problem.
Any ideas what can be wrong?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions