Skip to content

Commit 55ec710

Browse files
committed
Disable drop column tests for Cosmos DB and DynamoDB
1 parent a848e63 commit 55ec710

10 files changed

+187
-3
lines changed

core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminIntegrationTestWithCosmos.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class ConsensusCommitAdminIntegrationTestWithCosmos
910
extends ConsensusCommitAdminIntegrationTestBase {
@@ -22,4 +23,25 @@ protected Map<String, String> getCreationOptions() {
2223
protected AdminTestUtils getAdminTestUtils(String testName) {
2324
return new CosmosAdminTestUtils(getProperties(testName));
2425
}
26+
27+
@Override
28+
@Disabled("Cosmos DB does not support dropping columns")
29+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
30+
31+
@Override
32+
@Disabled("Cosmos DB does not support dropping columns")
33+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
34+
35+
@Override
36+
@Disabled("Cosmos DB does not support dropping columns")
37+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
38+
39+
@Override
40+
@Disabled("Cosmos DB does not support dropping columns")
41+
public void
42+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
43+
44+
@Override
45+
@Disabled("Cosmos DB does not support dropping columns")
46+
public void dropColumnFromTable_IfNotExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
2547
}

core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminCaseSensitivityIntegrationTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class CosmosAdminCaseSensitivityIntegrationTest
910
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
@@ -22,4 +23,25 @@ protected Map<String, String> getCreationOptions() {
2223
protected AdminTestUtils getAdminTestUtils(String testName) {
2324
return new CosmosAdminTestUtils(getProperties(testName));
2425
}
26+
27+
@Disabled("Cosmos DB does not support dropping columns")
28+
@Override
29+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
30+
31+
@Disabled("Cosmos DB does not support dropping columns")
32+
@Override
33+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
34+
35+
@Disabled("Cosmos DB does not support dropping columns")
36+
@Override
37+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
38+
39+
@Disabled("Cosmos DB does not support dropping columns")
40+
@Override
41+
public void
42+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
43+
44+
@Disabled("Cosmos DB does not support dropping columns")
45+
@Override
46+
public void dropColumnFromTable_IfExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
2547
}

core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminIntegrationTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class CosmosAdminIntegrationTest extends DistributedStorageAdminIntegrationTestBase {
910

@@ -21,4 +22,25 @@ protected Map<String, String> getCreationOptions() {
2122
protected AdminTestUtils getAdminTestUtils(String testName) {
2223
return new CosmosAdminTestUtils(getProperties(testName));
2324
}
25+
26+
@Disabled("Cosmos DB does not support dropping columns")
27+
@Override
28+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
29+
30+
@Disabled("Cosmos DB does not support dropping columns")
31+
@Override
32+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
33+
34+
@Disabled("Cosmos DB does not support dropping columns")
35+
@Override
36+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
37+
38+
@Disabled("Cosmos DB does not support dropping columns")
39+
@Override
40+
public void
41+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
42+
43+
@Disabled("Cosmos DB does not support dropping columns")
44+
@Override
45+
public void dropColumnFromTable_IfExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
2446
}

core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionAdminIntegrationTestWithCosmos.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
44
import java.util.Map;
55
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
67

78
public class SingleCrudOperationTransactionAdminIntegrationTestWithCosmos
89
extends SingleCrudOperationTransactionAdminIntegrationTestBase {
@@ -16,4 +17,25 @@ protected Properties getProps(String testName) {
1617
protected Map<String, String> getCreationOptions() {
1718
return CosmosEnv.getCreationOptions();
1819
}
20+
21+
@Override
22+
@Disabled("Cosmos DB does not support dropping columns")
23+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
24+
25+
@Override
26+
@Disabled("Cosmos DB does not support dropping columns")
27+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
28+
29+
@Override
30+
@Disabled("Cosmos DB does not support dropping columns")
31+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
32+
33+
@Override
34+
@Disabled("Cosmos DB does not support dropping columns")
35+
public void
36+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
37+
38+
@Override
39+
@Disabled("Cosmos DB does not support dropping columns")
40+
public void dropColumnFromTable_IfNotExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
1941
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/ConsensusCommitAdminIntegrationTestWithDynamo.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class ConsensusCommitAdminIntegrationTestWithDynamo
910
extends ConsensusCommitAdminIntegrationTestBase {
@@ -27,4 +28,25 @@ protected boolean isIndexOnBooleanColumnSupported() {
2728
protected AdminTestUtils getAdminTestUtils(String testName) {
2829
return new DynamoAdminTestUtils(getProperties(testName));
2930
}
31+
32+
@Override
33+
@Disabled("DynamoDB does not support dropping columns")
34+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
35+
36+
@Override
37+
@Disabled("DynamoDB does not support dropping columns")
38+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
39+
40+
@Override
41+
@Disabled("DynamoDB does not support dropping columns")
42+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
43+
44+
@Override
45+
@Disabled("DynamoDB does not support dropping columns")
46+
public void
47+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
48+
49+
@Override
50+
@Disabled("DynamoDB does not support dropping columns")
51+
public void dropColumnFromTable_IfNotExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
3052
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminCaseSensitivityIntegrationTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class DynamoAdminCaseSensitivityIntegrationTest
910
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
@@ -27,4 +28,25 @@ protected boolean isIndexOnBooleanColumnSupported() {
2728
protected AdminTestUtils getAdminTestUtils(String testName) {
2829
return new DynamoAdminTestUtils(getProperties(testName));
2930
}
31+
32+
@Disabled("DynamoDB does not support dropping columns")
33+
@Override
34+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
35+
36+
@Disabled("DynamoDB does not support dropping columns")
37+
@Override
38+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
39+
40+
@Disabled("DynamoDB does not support dropping columns")
41+
@Override
42+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
43+
44+
@Disabled("DynamoDB does not support dropping columns")
45+
@Override
46+
public void
47+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
48+
49+
@Disabled("DynamoDB does not support dropping columns")
50+
@Override
51+
public void dropColumnFromTable_IfExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
3052
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminIntegrationTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.scalar.db.util.AdminTestUtils;
55
import java.util.Map;
66
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
78

89
public class DynamoAdminIntegrationTest extends DistributedStorageAdminIntegrationTestBase {
910

@@ -26,4 +27,25 @@ protected boolean isIndexOnBooleanColumnSupported() {
2627
protected AdminTestUtils getAdminTestUtils(String testName) {
2728
return new DynamoAdminTestUtils(getProperties(testName));
2829
}
30+
31+
@Disabled("DynamoDB does not support dropping columns")
32+
@Override
33+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
34+
35+
@Disabled("DynamoDB does not support dropping columns")
36+
@Override
37+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
38+
39+
@Disabled("DynamoDB does not support dropping columns")
40+
@Override
41+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
42+
43+
@Disabled("DynamoDB does not support dropping columns")
44+
@Override
45+
public void
46+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
47+
48+
@Disabled("DynamoDB does not support dropping columns")
49+
@Override
50+
public void dropColumnFromTable_IfExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
2951
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminPermissionIntegrationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ public void addRawColumnToTable_WithSufficientPermission_ShouldSucceed() {}
5959
@Override
6060
@Disabled("Import-related functionality is not supported in DynamoDB")
6161
public void importTable_WithSufficientPermission_ShouldSucceed() {}
62+
63+
@Test
64+
@Override
65+
@Disabled("DynamoDB does not support dropping columns")
66+
public void dropColumnFromTable_WithSufficientPermission_ShouldSucceed() {}
6267
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/SingleCrudOperationTransactionAdminIntegrationTestWithDynamo.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase;
44
import java.util.Map;
55
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
67

78
public class SingleCrudOperationTransactionAdminIntegrationTestWithDynamo
89
extends SingleCrudOperationTransactionAdminIntegrationTestBase {
@@ -21,4 +22,25 @@ protected Map<String, String> getCreationOptions() {
2122
protected boolean isIndexOnBooleanColumnSupported() {
2223
return false;
2324
}
25+
26+
@Override
27+
@Disabled("DynamoDB does not support dropping columns")
28+
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}
29+
30+
@Override
31+
@Disabled("DynamoDB does not support dropping columns")
32+
public void dropColumnFromTable_ForNonExistingTable_ShouldThrowIllegalArgumentException() {}
33+
34+
@Override
35+
@Disabled("DynamoDB does not support dropping columns")
36+
public void dropColumnFromTable_ForNonExistingColumn_ShouldThrowIllegalArgumentException() {}
37+
38+
@Override
39+
@Disabled("DynamoDB does not support dropping columns")
40+
public void
41+
dropColumnFromTable_ForPrimaryOrIndexKeyColumn_ShouldThrowIllegalArgumentException() {}
42+
43+
@Override
44+
@Disabled("DynamoDB does not support dropping columns")
45+
public void dropColumnFromTable_IfNotExists_ForNonExistingColumn_ShouldNotThrowAnyException() {}
2446
}

core/src/main/java/com/scalar/db/api/Admin.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,14 @@ default void addNewColumnToTable(
443443
}
444444

445445
/**
446-
* Drops a column from an existing table. The column cannot be a partition or clustering key.
446+
* Drops a column from an existing table. The column cannot be a partition key, clustering key, or
447+
* indexed.
447448
*
448449
* @param namespace the table namespace
449450
* @param table the table name
450451
* @param columnName the name of the column to drop
451-
* @throws IllegalArgumentException if the table does not exist or the column does not exist
452+
* @throws IllegalArgumentException if the table or column does not exist, or the column is a
453+
* partition key column, clustering key column, or is indexed
452454
* @throws ExecutionException if the operation fails
453455
*/
454456
void dropColumnFromTable(String namespace, String table, String columnName)
@@ -462,7 +464,8 @@ void dropColumnFromTable(String namespace, String table, String columnName)
462464
* @param columnName the name of the column to drop
463465
* @param IfExists if set to true, the column will be dropped only if it exists. If set to false,
464466
* it will throw an exception if it does not exist
465-
* @throws IllegalArgumentException if the table does not exist
467+
* @throws IllegalArgumentException if the table does not exist, or the column is a partition key
468+
* column, clustering key column, or is indexed
466469
* @throws ExecutionException if the operation fails
467470
*/
468471
default void dropColumnFromTable(

0 commit comments

Comments
 (0)