use of com.palantir.atlasdb.keyvalue.api.RangeRequest in project atlasdb by palantir.
the class WhereClausesTest method usesDifferentTableIdentifier.
@Test
public void usesDifferentTableIdentifier() {
RangeRequest request = RangeRequest.builder().startRowInclusive(START).endRowExclusive(END).retainColumns(ColumnSelection.create(ImmutableList.of(COL1))).build();
WhereClauses whereClauses = WhereClauses.create("other", request);
List<String> expectedClauses = ImmutableList.of("other.row_name >= ?", "other.row_name < ?", "other.col_name IN (?)");
assertEquals(whereClauses.getClauses(), expectedClauses);
checkWhereArguments(whereClauses, ImmutableList.of(START, END, COL1));
}
use of com.palantir.atlasdb.keyvalue.api.RangeRequest in project atlasdb by palantir.
the class WhereClausesTest method whereClausesMultiColumn.
@Test
public void whereClausesMultiColumn() {
RangeRequest request = RangeRequest.builder().startRowInclusive(START).endRowExclusive(END).retainColumns(ColumnSelection.create(ImmutableList.of(COL1, COL2, COL3))).build();
WhereClauses whereClauses = WhereClauses.create("i", request);
List<String> expectedClauses = ImmutableList.of("i.row_name >= ?", "i.row_name < ?", "i.col_name IN (?,?,?)");
assertEquals(whereClauses.getClauses(), expectedClauses);
checkWhereArguments(whereClauses, ImmutableList.of(START, END, COL1, COL2, COL3));
}
use of com.palantir.atlasdb.keyvalue.api.RangeRequest in project atlasdb by palantir.
the class WhereClausesTest method startOnly.
@Test
public void startOnly() {
RangeRequest request = RangeRequest.builder().startRowInclusive(START).build();
WhereClauses whereClauses = WhereClauses.create("i", request);
List<String> expectedClauses = ImmutableList.of("i.row_name >= ?");
assertEquals(whereClauses.getClauses(), expectedClauses);
checkWhereArguments(whereClauses, ImmutableList.of(START));
}
use of com.palantir.atlasdb.keyvalue.api.RangeRequest in project atlasdb by palantir.
the class WhereClausesTest method whereClausesOneColumn.
@Test
public void whereClausesOneColumn() {
RangeRequest request = RangeRequest.builder().startRowInclusive(START).endRowExclusive(END).retainColumns(ColumnSelection.create(ImmutableList.of(COL1))).build();
WhereClauses whereClauses = WhereClauses.create("i", request);
List<String> expectedClauses = ImmutableList.of("i.row_name >= ?", "i.row_name < ?", "i.col_name IN (?)");
assertEquals(whereClauses.getClauses(), expectedClauses);
checkWhereArguments(whereClauses, ImmutableList.of(START, END, COL1));
}
use of com.palantir.atlasdb.keyvalue.api.RangeRequest in project atlasdb by palantir.
the class AbstractKeyValueServiceTest method testGetRangeOfTimestampsReturnsAllRows.
@Test
public void testGetRangeOfTimestampsReturnsAllRows() {
keyValueService.put(TEST_TABLE, ImmutableMap.of(Cell.create(row0, column0), value0_t0, Cell.create(row1, column0), value0_t0, Cell.create(row2, column0), value0_t0), TEST_TIMESTAMP);
RangeRequest range = RangeRequest.all().withBatchHint(1);
List<RowResult<Set<Long>>> results = ImmutableList.copyOf(keyValueService.getRangeOfTimestamps(TEST_TABLE, range, TEST_TIMESTAMP + 1));
assertEquals(3, results.size());
assertArrayEquals(row0, results.get(0).getRowName());
assertArrayEquals(row1, results.get(1).getRowName());
assertArrayEquals(row2, results.get(2).getRowName());
}
Aggregations