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

OIndexException when trying to use index partially #7484

Closed
karolmie1 opened this issue Jun 12, 2017 · 2 comments
Closed

OIndexException when trying to use index partially #7484

karolmie1 opened this issue Jun 12, 2017 · 2 comments
Labels
Milestone

Comments

@karolmie1
Copy link

karolmie1 commented Jun 12, 2017

OrientDB Version: 2.2.21

Java Version: 1.8

OS: linux

Scenario:

CREATE CLASS User extends V
CREATE PROPERTY User.login STRING (MANDATORY TRUE, NOTNULL)
CREATE PROPERTY User.permissions EMBEDDEDSET STRING (MANDATORY TRUE, NOTNULL)
CREATE INDEX User_Login_Perm on User(login, permissions) UNIQUE

// not entirely sure if a few vertices needed to reproduce. If not getting an error, please insert one or 2.

graph.getVertices("User", ["login"], ["admin"])

Result:

! com.orientechnologies.orient.core.index.OIndexException: Impossible add as key of a CompositeIndex a value of type class java.lang.String
! DB name="fragaria"
! at com.orientechnologies.orient.core.index.OCompositeCollate.transform(OCompositeCollate.java:62)
! at com.orientechnologies.orient.core.index.OIndexAbstract.getCollatingValue(OIndexAbstract.java:945)
! 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 com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getVertices(OrientBaseGraph.java:907)

@karolmie1
Copy link
Author

karolmie1 commented Jun 13, 2017

By the way, I have other index: CREATE INDEX User.login UNIQUE_HASH_INDEX

I try to circumvent the problem above, by using this index directly: graph.getIndex("User.login", Vertex::class.java), but this returns null.

After debugging I've found, that index is found, but it has metadata = null, and that causes the function to return null.

@andrii0lomakin
Copy link
Member

Fixed

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

No branches or pull requests

3 participants