Skip to content

Commit 9ba2206

Browse files
committed
Apply suggestions
1 parent d55d595 commit 9ba2206

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ default void addNewColumnToTable(
487487
* @param table the table name
488488
* @param columnName the name of the column to drop
489489
* @throws IllegalArgumentException if the table or column does not exist, or the column is a
490-
* partition key column, clustering key column, or is indexed
490+
* partition key column or clustering key column
491491
* @throws ExecutionException if the operation fails
492492
*/
493493
void dropColumnFromTable(String namespace, String table, String columnName)
@@ -503,7 +503,7 @@ void dropColumnFromTable(String namespace, String table, String columnName)
503503
* @param IfExists if set to true, the column will be dropped only if it exists. If set to false,
504504
* it will throw an exception if it does not exist
505505
* @throws IllegalArgumentException if the table does not exist, or the column is a partition key
506-
* column, clustering key column, or is indexed
506+
* column or clustering key column
507507
* @throws ExecutionException if the operation fails
508508
*/
509509
default void dropColumnFromTable(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public void dropColumnFromTable(String namespace, String table, String columnNam
313313
if (tableMetadata.getPartitionKeyNames().contains(columnName)
314314
|| tableMetadata.getClusteringKeyNames().contains(columnName)) {
315315
throw new IllegalArgumentException(
316-
CoreError.COLUMN_SPECIFIED_AS_PRIMARY_KEY.buildMessage(
316+
CoreError.DROP_PRIMARY_KEY_COLUMN_NOT_SUPPORTED.buildMessage(
317317
ScalarDbUtils.getFullTableName(namespace, table), columnName));
318318
}
319319

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -678,24 +678,20 @@ public enum CoreError implements ScalarDbError {
678678
"Mutations across multiple storages are not allowed. Mutations: %s",
679679
"",
680680
""),
681-
COLUMN_SPECIFIED_AS_PRIMARY_KEY(
681+
DROP_PRIMARY_KEY_COLUMN_NOT_SUPPORTED(
682682
Category.USER_ERROR,
683683
"0216",
684-
"The column is specified as a primary key. Table: %s; Column: %s",
684+
"Primary key columns cannot be dropped. Table: %s; Column: %s",
685685
"",
686686
""),
687687
COSMOS_DROP_COLUMN_NOT_SUPPORTED(
688688
Category.USER_ERROR,
689689
"0217",
690-
"Drop column functionality is not supported in Cosmos DB",
690+
"Cosmos DB does not support the dropping column feature",
691691
"",
692692
""),
693693
DYNAMO_DROP_COLUMN_NOT_SUPPORTED(
694-
Category.USER_ERROR,
695-
"0218",
696-
"Drop column functionality is not supported in DynamoDB",
697-
"",
698-
""),
694+
Category.USER_ERROR, "0218", "DynamoDB does not support the dropping column feature", "", ""),
699695

700696
//
701697
// Errors for the concurrency error category

0 commit comments

Comments
 (0)