Skip to content

Commit 0a73daf

Browse files
committed
Fix to remove BLOB type limitations
1 parent 4811884 commit 0a73daf

File tree

7 files changed

+0
-99
lines changed

7 files changed

+0
-99
lines changed

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ConsensusCommitIntegrationTestWithObjectStorage.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ protected Properties getProps(String testName) {
1111
return ConsensusCommitObjectStorageEnv.getProperties(testName);
1212
}
1313

14-
@Override
15-
protected boolean isTimestampTypeSupported() {
16-
return false;
17-
}
18-
1914
@Override
2015
@Disabled("Object Storage does not support index-related operations")
2116
public void get_GetGivenForIndexColumn_ShouldReturnRecords() {}
Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,12 @@
11
package com.scalar.db.storage.objectstorage;
22

3-
import com.scalar.db.api.ConditionalExpression;
43
import com.scalar.db.api.DistributedStorageConditionalMutationIntegrationTestBase;
5-
import com.scalar.db.io.DataType;
6-
import java.util.List;
74
import java.util.Properties;
8-
import java.util.stream.Collectors;
95

106
public class ObjectStorageConditionalMutationIntegrationTest
117
extends DistributedStorageConditionalMutationIntegrationTestBase {
128
@Override
139
protected Properties getProperties(String testName) {
1410
return ObjectStorageEnv.getProperties(testName);
1511
}
16-
17-
@Override
18-
protected int getThreadNum() {
19-
return 3;
20-
}
21-
22-
@Override
23-
protected List<OperatorAndDataType> getOperatorAndDataTypeListForTest() {
24-
return super.getOperatorAndDataTypeListForTest().stream()
25-
.filter(
26-
operatorAndDataType -> {
27-
// Object Storage only supports EQ, NE, IS_NULL, and IS_NOT_NULL conditions for BLOB
28-
// type
29-
if (operatorAndDataType.getDataType() == DataType.BLOB) {
30-
return operatorAndDataType.getOperator() == ConditionalExpression.Operator.EQ
31-
|| operatorAndDataType.getOperator() == ConditionalExpression.Operator.NE
32-
|| operatorAndDataType.getOperator() == ConditionalExpression.Operator.IS_NULL
33-
|| operatorAndDataType.getOperator()
34-
== ConditionalExpression.Operator.IS_NOT_NULL;
35-
}
36-
return true;
37-
})
38-
.collect(Collectors.toList());
39-
}
4012
}

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageCrossPartitionScanIntegrationTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ protected Properties getProperties(String testName) {
1313
return ObjectStorageEnv.getProperties(testName);
1414
}
1515

16-
@Override
17-
protected int getThreadNum() {
18-
return 3;
19-
}
20-
2116
@Override
2217
protected boolean isParallelDdlSupported() {
2318
return false;

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageMultipleClusteringKeyScanIntegrationTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package com.scalar.db.storage.objectstorage;
22

33
import com.scalar.db.api.DistributedStorageMultipleClusteringKeyScanIntegrationTestBase;
4-
import com.scalar.db.io.DataType;
5-
import java.util.List;
64
import java.util.Properties;
7-
import java.util.stream.Collectors;
85

96
public class ObjectStorageMultipleClusteringKeyScanIntegrationTest
107
extends DistributedStorageMultipleClusteringKeyScanIntegrationTestBase {
@@ -14,14 +11,6 @@ protected Properties getProperties(String testName) {
1411
return ObjectStorageEnv.getProperties(testName);
1512
}
1613

17-
@Override
18-
protected List<DataType> getDataTypes() {
19-
// Return types without BLOB because blob is not supported for clustering key for now
20-
return super.getDataTypes().stream()
21-
.filter(type -> type != DataType.BLOB)
22-
.collect(Collectors.toList());
23-
}
24-
2514
@Override
2615
protected boolean isParallelDdlSupported() {
2716
return false;
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.scalar.db.storage.objectstorage;
22

33
import com.scalar.db.api.DistributedStorageSingleClusteringKeyScanIntegrationTestBase;
4-
import com.scalar.db.io.DataType;
5-
import java.util.ArrayList;
6-
import java.util.List;
74
import java.util.Properties;
85

96
public class ObjectStorageSingleClusteringKeyScanIntegrationTest
@@ -12,17 +9,4 @@ public class ObjectStorageSingleClusteringKeyScanIntegrationTest
129
protected Properties getProperties(String testName) {
1310
return ObjectStorageEnv.getProperties(testName);
1411
}
15-
16-
@Override
17-
protected List<DataType> getClusteringKeyTypes() {
18-
// Return types without BLOB because blob is not supported for clustering key for now
19-
List<DataType> clusteringKeyTypes = new ArrayList<>();
20-
for (DataType dataType : DataType.values()) {
21-
if (dataType == DataType.BLOB) {
22-
continue;
23-
}
24-
clusteringKeyTypes.add(dataType);
25-
}
26-
return clusteringKeyTypes;
27-
}
2812
}

core/src/main/java/com/scalar/db/common/CoreError.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,6 @@ public enum CoreError implements ScalarDbError {
901901
"The value of the column %s in the primary key contains an illegal character.",
902902
"",
903903
""),
904-
OBJECT_STORAGE_CONDITION_OPERATION_NOT_SUPPORTED_FOR_BLOB_TYPE(
905-
Category.USER_ERROR,
906-
"0258",
907-
"Object Storage supports only EQ, NE, IS_NULL, and IS_NOT_NULL operations for the BLOB type in conditions. Mutation: %s",
908-
"",
909-
""),
910904

911905
//
912906
// Errors for the concurrency error category

core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageOperationChecker.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package com.scalar.db.storage.objectstorage;
22

3-
import com.scalar.db.api.ConditionalExpression;
43
import com.scalar.db.api.Delete;
54
import com.scalar.db.api.Get;
6-
import com.scalar.db.api.Mutation;
75
import com.scalar.db.api.Operation;
86
import com.scalar.db.api.Put;
97
import com.scalar.db.api.Scan;
10-
import com.scalar.db.api.TableMetadata;
118
import com.scalar.db.common.CoreError;
129
import com.scalar.db.common.StorageInfoProvider;
1310
import com.scalar.db.common.TableMetadataManager;
@@ -18,7 +15,6 @@
1815
import com.scalar.db.io.BlobColumn;
1916
import com.scalar.db.io.BooleanColumn;
2017
import com.scalar.db.io.ColumnVisitor;
21-
import com.scalar.db.io.DataType;
2218
import com.scalar.db.io.DateColumn;
2319
import com.scalar.db.io.DoubleColumn;
2420
import com.scalar.db.io.FloatColumn;
@@ -109,18 +105,12 @@ public void check(Scan scan) throws ExecutionException {
109105
public void check(Put put) throws ExecutionException {
110106
super.check(put);
111107
checkPrimaryKey(put);
112-
113-
TableMetadata metadata = getTableMetadata(put);
114-
checkCondition(put, metadata);
115108
}
116109

117110
@Override
118111
public void check(Delete delete) throws ExecutionException {
119112
super.check(delete);
120113
checkPrimaryKey(delete);
121-
122-
TableMetadata metadata = getTableMetadata(delete);
123-
checkCondition(delete, metadata);
124114
}
125115

126116
private void checkPrimaryKey(Operation operation) {
@@ -133,22 +123,4 @@ private void checkPrimaryKey(Operation operation) {
133123
.ifPresent(
134124
c -> c.getColumns().forEach(column -> column.accept(PRIMARY_KEY_COLUMN_CHECKER)));
135125
}
136-
137-
private void checkCondition(Mutation mutation, TableMetadata metadata) {
138-
if (!mutation.getCondition().isPresent()) {
139-
return;
140-
}
141-
for (ConditionalExpression expression : mutation.getCondition().get().getExpressions()) {
142-
if (metadata.getColumnDataType(expression.getColumn().getName()) == DataType.BLOB) {
143-
if (expression.getOperator() != ConditionalExpression.Operator.EQ
144-
&& expression.getOperator() != ConditionalExpression.Operator.NE
145-
&& expression.getOperator() != ConditionalExpression.Operator.IS_NULL
146-
&& expression.getOperator() != ConditionalExpression.Operator.IS_NOT_NULL) {
147-
throw new IllegalArgumentException(
148-
CoreError.OBJECT_STORAGE_CONDITION_OPERATION_NOT_SUPPORTED_FOR_BLOB_TYPE.buildMessage(
149-
mutation));
150-
}
151-
}
152-
}
153-
}
154126
}

0 commit comments

Comments
 (0)