Skip to content

Commit 617c57f

Browse files
committed
Merge branch 'master' into add-rename-table
2 parents fa0dc44 + 98ffa4d commit 617c57f

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ subprojects {
2929
cassandraDriverVersion = '3.11.5'
3030
azureCosmosVersion = '4.74.0'
3131
jooqVersion = '3.14.16'
32-
awssdkVersion = '2.33.0'
32+
awssdkVersion = '2.34.0'
3333
commonsDbcp2Version = '2.13.0'
3434
mysqlDriverVersion = '8.4.0'
35-
postgresqlDriverVersion = '42.7.7'
35+
postgresqlDriverVersion = '42.7.8'
3636
oracleDriverVersion = '23.9.0.25.07'
3737
sqlserverDriverVersion = '12.8.1.jre8'
3838
sqliteDriverVersion = '3.50.3.0'
@@ -43,7 +43,7 @@ subprojects {
4343
commonsTextVersion = '1.14.0'
4444
junitVersion = '5.13.4'
4545
commonsLangVersion = '3.18.0'
46-
assertjVersion = '3.27.4'
46+
assertjVersion = '3.27.5'
4747
mockitoVersion = '4.11.0'
4848
spotbugsVersion = '4.8.6'
4949
errorproneVersion = '2.10.0'

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -736,12 +736,18 @@ public enum CoreError implements ScalarDbError {
736736
"The BOOLEAN type is not supported for index columns in DynamoDB. Column: %s",
737737
"",
738738
""),
739+
CASSANDRA_TIMESTAMP_TYPE_NOT_SUPPORTED(
740+
Category.USER_ERROR,
741+
"0227",
742+
"The TIMESTAMP type is not supported in Cassandra. Column: %s",
743+
"",
744+
""),
739745
CASSANDRA_RENAME_TABLE_NOT_SUPPORTED(
740-
Category.USER_ERROR, "0227", "Renaming tables is not supported in Cassandra", "", ""),
746+
Category.USER_ERROR, "0228", "Renaming tables is not supported in Cassandra", "", ""),
741747
COSMOS_RENAME_TABLE_NOT_SUPPORTED(
742-
Category.USER_ERROR, "0228", "Renaming tables is not supported in Cosmos DB", "", ""),
748+
Category.USER_ERROR, "0229", "Renaming tables is not supported in Cosmos DB", "", ""),
743749
DYNAMO_RENAME_TABLE_NOT_SUPPORTED(
744-
Category.USER_ERROR, "0229", "Renaming tables is not supported in DynamoDB", "", ""),
750+
Category.USER_ERROR, "0230", "Renaming tables is not supported in DynamoDB", "", ""),
745751

746752
//
747753
// Errors for the concurrency error category
@@ -1036,12 +1042,6 @@ public enum CoreError implements ScalarDbError {
10361042
"Renaming a column failed. Table: %s; Old column name: %s; New column name: %s",
10371043
"",
10381044
""),
1039-
RENAMING_TABLE_FAILED(
1040-
Category.INTERNAL_ERROR,
1041-
"0061",
1042-
"Renaming a table failed. Old table name: %s; New table name: %s",
1043-
"",
1044-
""),
10451045

10461046
//
10471047
// Errors for the unknown transaction status error category

core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void createTable(
7777
for (String column : metadata.getColumnNames()) {
7878
if (metadata.getColumnDataTypes().get(column).equals(DataType.TIMESTAMP)) {
7979
throw new UnsupportedOperationException(
80-
"The TIMESTAMP data type is not supported in Cassandra. column: " + column);
80+
CoreError.CASSANDRA_TIMESTAMP_TYPE_NOT_SUPPORTED.buildMessage(column));
8181
}
8282
}
8383
try {
@@ -394,7 +394,7 @@ public void addNewColumnToTable(
394394
throws ExecutionException {
395395
if (columnType == DataType.TIMESTAMP) {
396396
throw new UnsupportedOperationException(
397-
"The TIMESTAMP data type is not supported in Cassandra. column: " + columnName);
397+
CoreError.CASSANDRA_TIMESTAMP_TYPE_NOT_SUPPORTED.buildMessage(columnName));
398398
}
399399
try {
400400
String alterTableQuery =

core/src/main/java/com/scalar/db/storage/cassandra/ResultInterpreter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.datastax.driver.core.Row;
44
import com.scalar.db.api.Result;
55
import com.scalar.db.api.TableMetadata;
6+
import com.scalar.db.common.CoreError;
67
import com.scalar.db.common.ResultImpl;
78
import com.scalar.db.io.BigIntColumn;
89
import com.scalar.db.io.BlobColumn;
@@ -86,7 +87,7 @@ private Column<?> convert(Row row, String name, DataType type) {
8687
: TimeColumn.of(name, LocalTime.ofNanoOfDay(row.getTime(name)));
8788
case TIMESTAMP:
8889
throw new UnsupportedOperationException(
89-
"The TIMESTAMP type is not supported with Cassandra.");
90+
CoreError.CASSANDRA_TIMESTAMP_TYPE_NOT_SUPPORTED.buildMessage(name));
9091
case TIMESTAMPTZ:
9192
return row.isNull(name)
9293
? TimestampTZColumn.ofNull(name)

core/src/main/java/com/scalar/db/storage/cassandra/ValueBinder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static com.google.common.base.Preconditions.checkNotNull;
44

55
import com.datastax.driver.core.BoundStatement;
6+
import com.scalar.db.common.CoreError;
67
import com.scalar.db.io.BigIntColumn;
78
import com.scalar.db.io.BlobColumn;
89
import com.scalar.db.io.BooleanColumn;
@@ -134,7 +135,8 @@ public void visit(TimeColumn column) {
134135

135136
@Override
136137
public void visit(TimestampColumn column) {
137-
throw new UnsupportedOperationException("The TIMESTAMP type is not supported with Cassandra");
138+
throw new UnsupportedOperationException(
139+
CoreError.CASSANDRA_TIMESTAMP_TYPE_NOT_SUPPORTED.buildMessage(column.getName()));
138140
}
139141

140142
@Override

0 commit comments

Comments
 (0)