use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class SQLSelectCompositeIndexDirectSearchTest method testEqualsPartialPrimitive.
@Test
public void testEqualsPartialPrimitive() {
final List<ODocument> resultList = database.command(new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key = 2")).execute();
Assert.assertEquals(resultList.size(), 10);
final List<ORID> expectedRIDs = rids.subList(20, 30);
for (final ODocument d : resultList) {
Assert.assertTrue(d.containsField("rid"));
Assert.assertTrue(expectedRIDs.contains(d.<ORID>field("rid")));
}
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class SQLSelectCompositeIndexDirectSearchTest method testMinorEqualsPartialPrimitive.
@Test
public void testMinorEqualsPartialPrimitive() {
final List<ODocument> resultList = database.command(new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key <= 4")).execute();
Assert.assertEquals(resultList.size(), 50);
final List<ORID> expectedRIDs = rids.subList(0, 50);
for (final ODocument d : resultList) {
Assert.assertTrue(d.containsField("rid"));
Assert.assertTrue(expectedRIDs.contains(d.<ORID>field("rid")));
}
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class SQLSelectCompositeIndexDirectSearchTest method testMinor.
@Test
public void testMinor() throws Exception {
final List<ODocument> resultList = database.command(new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key < [2, 5]")).execute();
Assert.assertEquals(resultList.size(), 25);
final List<ORID> expectedRIDs = rids.subList(0, 26);
for (final ODocument d : resultList) {
Assert.assertTrue(d.containsField("rid"));
Assert.assertTrue(expectedRIDs.contains(d.<ORID>field("rid")));
}
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class SQLSelectCompositeIndexDirectSearchTest method testBetweenPartialPrimitive.
@Test
public void testBetweenPartialPrimitive() throws Exception {
final List<ODocument> resultList = database.command(new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key between 2 and 5")).execute();
Assert.assertEquals(resultList.size(), 40);
final List<ORID> expectedRIDs = rids.subList(20, 60);
for (final ODocument d : resultList) {
Assert.assertTrue(d.containsField("rid"));
Assert.assertTrue(expectedRIDs.contains(d.<ORID>field("rid")));
}
}
use of com.orientechnologies.orient.core.sql.OCommandSQL in project orientdb by orientechnologies.
the class SQLSelectCompositeIndexDirectSearchTest method testInPartialComposite.
@Test(enabled = false)
public void testInPartialComposite() {
final List<ODocument> resultList = database.command(new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key in [[2], [3], [7]]")).execute();
Assert.assertEquals(resultList.size(), 30);
final List<ORID> expectedRIDs = rids.subList(20, 40);
expectedRIDs.addAll(rids.subList(70, 80));
for (final ODocument d : resultList) {
Assert.assertTrue(d.containsField("rid"));
Assert.assertTrue(expectedRIDs.contains(d.<ORID>field("rid")));
}
}
Aggregations