Skip to content

Commit ffef3fc

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

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

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/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/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)