You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unique indexes on edges on a datetime are not being enforced, and the issue can be replicated using the following test case:
create class test extends V
create property test.test string
create index idx_test_test on test (test) unique
create vertex test content {"test": "test"}
create vertex test content {"test": "test2"}
create class test_edge extends E
create property test_edge.date datetime
create index idx_unique_test_edge on test_edge (date) unique
create edge test_edge from (select from test where test = 'test') to (select from test where test = 'test2') content {"date": "2015-03-24 08:54:49"}
create edge test_edge from (select from test where test = 'test') to (select from test where test = 'test2') content {"date": "2015-03-24 08:54:49"}
In the above example, the two edges are successfully created with the same date, violating the unique index idx_unique_test_edge:
However, if I create a new edge class using string instead of datetime, the index works correctly:
create class test_edge2 extends E
create property test_edge2.date string
create index idx_unique_test_edge2 on test_edge2 (date) unique
create edge test_edge2 from (select from test where test = 'test') to (select from test where test = 'test2') content {"date": "2015-03-24 08:54:49"}
create edge test_edge2 from (select from test where test = 'test') to (select from test where test = 'test2') content {"date": "2015-03-24 08:54:49"}
The second command results in a duplicate exception:
Error: com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot index record #14:1: found duplicated key 'OCompositeKey{keys=[#12:1, #12:0, 2015-03-24 08:54:49]}' in index 'idx_unique_test_edge2' previously assigned to the record #14:0 RID=#14:0
The text was updated successfully, but these errors were encountered:
for some reason index is not used at all (first example). If you try java code, it just works TM
see for example:
select expand(indexes) from metadata:indexmanager
and try to run:
rebuild index *
it will throw exception:
Rebuilding index(es)...
Error: com.orientechnologies.orient.core.index.OIndexException: Error on rebuilding the index for clusters: [test_edge]
Error: com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot index record #14:1: found duplicated key 'Tue Mar 24 08:54:49 CET 2015' in index 'idx_unique_test_edge' previously assigned to the record #14:0 RID=#14:0
orientdb-community-2.0.5
CentOS 6.5
Unique indexes on edges on a datetime are not being enforced, and the issue can be replicated using the following test case:
In the above example, the two edges are successfully created with the same date, violating the unique index idx_unique_test_edge:
However, if I create a new edge class using string instead of datetime, the index works correctly:
The second command results in a duplicate exception:
The text was updated successfully, but these errors were encountered: