use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.
the class RangePredicateHelperTest method endRowExclusiveForward.
@Test
public void endRowExclusiveForward() {
FullQuery.Builder builder = FullQuery.builder();
RangePredicateHelper.create(false, DBType.ORACLE, builder).endRowExclusive(ROW_NAME);
FullQuery query = builder.build();
assertThat(query.getQuery(), equalTo(" AND row_name < ? "));
assertThat(query.getArgs(), arrayContaining((Object) ROW_NAME));
}
use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.
the class RangePredicateHelperTest method startCellTsInclusiveForwardOracle.
@Test
public void startCellTsInclusiveForwardOracle() {
FullQuery.Builder builder = FullQuery.builder();
RangePredicateHelper.create(false, DBType.ORACLE, builder).startCellTsInclusive(ROW_NAME, COL_NAME, TS);
FullQuery query = builder.build();
assertThat(query.getQuery(), equalTo(" AND (row_name >= ? AND (row_name > ? OR col_name > ? OR (col_name = ? AND ts >= ?)))"));
assertThat(query.getArgs(), arrayContaining(ROW_NAME, ROW_NAME, COL_NAME, COL_NAME, TS));
}
use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.
the class RangePredicateHelperTest method columnSelection.
@Test
public void columnSelection() {
byte[] colTwo = new byte[] { 7, 8, 9 };
FullQuery.Builder builder = FullQuery.builder();
RangePredicateHelper.create(false, DBType.ORACLE, builder).columnSelection(ImmutableList.of(COL_NAME, colTwo));
FullQuery query = builder.build();
assertThat(query.getQuery(), equalTo(" AND (col_name = ? OR col_name = ?) "));
assertThat(query.getArgs(), arrayContaining(COL_NAME, colTwo));
}
use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.
the class RangePredicateHelperTest method startCellInclusiveForwardPostgres.
@Test
public void startCellInclusiveForwardPostgres() {
FullQuery.Builder builder = FullQuery.builder();
RangePredicateHelper.create(false, DBType.POSTGRESQL, builder).startCellInclusive(ROW_NAME, COL_NAME);
FullQuery query = builder.build();
assertThat(query.getQuery(), equalTo(" AND (row_name, col_name) >= (?, ?)"));
assertThat(query.getArgs(), arrayContaining(ROW_NAME, COL_NAME));
}
use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.
the class RangePredicateHelperTest method startCellInclusiveEmptyColName.
@Test
public void startCellInclusiveEmptyColName() {
FullQuery.Builder builder = FullQuery.builder();
RangePredicateHelper.create(false, DBType.ORACLE, builder).startCellInclusive(ROW_NAME, PtBytes.EMPTY_BYTE_ARRAY);
FullQuery query = builder.build();
assertThat(query.getQuery(), equalTo(" AND row_name >= ? "));
assertThat(query.getArgs(), arrayContaining((Object) ROW_NAME));
}
Aggregations