use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class DistributedStorageSingleClusteringKeyScanIntegrationTestBase method scan_WithClusteringKeyRange_ShouldReturnProperResult.
@Test
public void scan_WithClusteringKeyRange_ShouldReturnProperResult() throws ExecutionException, IOException {
for (DataType clusteringKeyType : clusteringKeyTypes) {
for (Order clusteringOrder : Order.values()) {
truncateTable(clusteringKeyType, clusteringOrder);
List<Value<?>> clusteringKeyValues = prepareRecords(clusteringKeyType, clusteringOrder);
for (boolean startInclusive : Arrays.asList(true, false)) {
for (boolean endInclusive : Arrays.asList(true, false)) {
for (OrderingType orderingType : OrderingType.values()) {
for (boolean withLimit : Arrays.asList(false, true)) {
scan_WithClusteringKeyRange_ShouldReturnProperResult(clusteringKeyValues, clusteringKeyType, clusteringOrder, startInclusive, endInclusive, orderingType, withLimit);
}
}
}
}
}
}
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class DistributedStorageSingleClusteringKeyScanIntegrationTestBase method scan_WithClusteringKeyStartRangeWithMinValue_ShouldReturnProperResult.
@Test
public void scan_WithClusteringKeyStartRangeWithMinValue_ShouldReturnProperResult() throws ExecutionException, IOException {
for (DataType clusteringKeyType : clusteringKeyTypes) {
for (Order clusteringOrder : Order.values()) {
truncateTable(clusteringKeyType, clusteringOrder);
List<Value<?>> clusteringKeyValues = prepareRecords(clusteringKeyType, clusteringOrder);
for (boolean startInclusive : Arrays.asList(true, false)) {
for (OrderingType orderingType : OrderingType.values()) {
for (boolean withLimit : Arrays.asList(false, true)) {
scan_WithClusteringKeyStartRangeWithMinValue_ShouldReturnProperResult(clusteringKeyValues, clusteringKeyType, clusteringOrder, startInclusive, orderingType, withLimit);
}
}
}
}
}
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class DistributedStorageSingleClusteringKeyScanIntegrationTestBase method createTables.
private void createTables() throws ExecutionException {
Map<String, String> options = getCreateOptions();
admin.createNamespace(namespace, true, options);
for (DataType clusteringKeyType : clusteringKeyTypes) {
for (Order clusteringOrder : Order.values()) {
createTable(clusteringKeyType, clusteringOrder, options);
}
}
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class KeyBytesEncoderTest method encode_SingleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder.
@Test
public void encode_SingleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder() {
RANDOM.setSeed(seed);
runTest(() -> {
for (DataType col1Type : KEY_TYPES) {
for (Order col1Order : ORDERS) {
encode_SingleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder(col1Type, col1Order);
}
}
});
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class KeyBytesEncoderTest method encode_DoubleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder.
@Test
public void encode_DoubleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder() {
RANDOM.setSeed(seed);
runTest(() -> {
for (DataType col1Type : KEY_TYPES) {
// the BLOB type is supported only for the last key
if (col1Type == DataType.BLOB) {
continue;
}
for (DataType col2Type : KEY_TYPES) {
for (Order col1Order : ORDERS) {
for (Order col2Order : ORDERS) {
encode_DoubleKeysGiven_ShouldEncodeProperlyWithPreservingSortOrder(col1Type, col2Type, col1Order, col2Order);
}
}
}
}
});
}
Aggregations