Skip to content

Commit 86c26d3

Browse files
authored
Add time related types (#2468)
1 parent 029ad09 commit 86c26d3

File tree

193 files changed

+10740
-1818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+10740
-1818
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ subprojects {
3131
commonsDbcp2Version = '2.13.0'
3232
mysqlDriverVersion = '8.4.0'
3333
postgresqlDriverVersion = '42.7.5'
34-
oracleDriverVersion = '21.16.0.0'
35-
sqlserverDriverVersion = '11.2.3.jre8'
34+
oracleDriverVersion = '23.6.0.24.10'
35+
sqlserverDriverVersion = '12.8.1.jre8'
3636
sqliteDriverVersion = '3.48.0.0'
3737
yugabyteDriverVersion = '42.7.3-yb-2'
3838
mariadDbDriverVersion = '3.5.1'

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ protected Map<String, String> getCreationOptions() {
2121
protected AdminTestUtils getAdminTestUtils(String testName) {
2222
return new CassandraAdminTestUtils(getProperties(testName));
2323
}
24+
25+
@Override
26+
protected boolean isTimestampTypeSupported() {
27+
return false;
28+
}
2429
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminRepairIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ protected void initialize(String testName) {
2828
admin = new CassandraAdmin(clusterManager, new DatabaseConfig(properties));
2929
adminTestUtils = new CassandraAdminTestUtils(properties, clusterManager);
3030
}
31+
32+
@Override
33+
protected boolean isTimestampTypeSupported() {
34+
return false;
35+
}
3136
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraColumnValueIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ protected Properties getProperties(String testName) {
1616
protected Map<String, String> getCreationOptions() {
1717
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1818
}
19+
20+
@Override
21+
protected boolean isTimestampTypeSupported() {
22+
return false;
23+
}
1924
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraConditionalMutationIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ protected boolean shouldMutate(
3232
return super.shouldMutate(initialColumn, columnToCompare, operator);
3333
}
3434
}
35+
36+
@Override
37+
protected boolean isTimestampTypeSupported() {
38+
return false;
39+
}
3540
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraCrossPartitionScanIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ protected Map<String, String> getCreationOptions() {
2424
@Override
2525
@Disabled("Cross partition scan with ordering is not supported in Cassandra")
2626
public void scan_WithOrderingForNonPrimaryColumns_ShouldReturnProperResult() {}
27+
28+
@Override
29+
protected boolean isTimestampTypeSupported() {
30+
return false;
31+
}
2732
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraMultipleClusteringKeyScanIntegrationTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.scalar.db.storage.cassandra;
22

33
import com.scalar.db.api.DistributedStorageMultipleClusteringKeyScanIntegrationTestBase;
4+
import com.scalar.db.io.DataType;
45
import java.util.Collections;
6+
import java.util.List;
57
import java.util.Map;
68
import java.util.Properties;
9+
import java.util.stream.Collectors;
710

811
public class CassandraMultipleClusteringKeyScanIntegrationTest
912
extends DistributedStorageMultipleClusteringKeyScanIntegrationTestBase {
@@ -17,4 +20,11 @@ protected Properties getProperties(String testName) {
1720
protected Map<String, String> getCreationOptions() {
1821
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1922
}
23+
24+
@Override
25+
protected List<DataType> getDataTypes() {
26+
return super.getDataTypes().stream()
27+
.filter(type -> type != DataType.TIMESTAMP)
28+
.collect(Collectors.toList());
29+
}
2030
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraMultiplePartitionKeyIntegrationTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.scalar.db.storage.cassandra;
22

33
import com.scalar.db.api.DistributedStorageMultiplePartitionKeyIntegrationTestBase;
4+
import com.scalar.db.io.DataType;
45
import java.util.Collections;
6+
import java.util.List;
57
import java.util.Map;
68
import java.util.Properties;
9+
import java.util.stream.Collectors;
710

811
public class CassandraMultiplePartitionKeyIntegrationTest
912
extends DistributedStorageMultiplePartitionKeyIntegrationTestBase {
@@ -16,4 +19,11 @@ protected Properties getProperties(String testName) {
1619
protected Map<String, String> getCreationOptions() {
1720
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1821
}
22+
23+
@Override
24+
protected List<DataType> getDataTypes() {
25+
return super.getDataTypes().stream()
26+
.filter(type -> type != DataType.TIMESTAMP)
27+
.collect(Collectors.toList());
28+
}
1929
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraSchemaLoaderIntegrationTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ protected List<String> getCommandArgsForUpgrade(Path configFilePath) {
5454
.add("--replication-factor=1")
5555
.build();
5656
}
57+
58+
@Override
59+
protected boolean isTimestampTypeSupported() {
60+
return false;
61+
}
5762
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraSecondaryIndexIntegrationTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.scalar.db.storage.cassandra;
22

33
import com.scalar.db.api.DistributedStorageSecondaryIndexIntegrationTestBase;
4+
import com.scalar.db.io.DataType;
45
import java.util.Collections;
56
import java.util.Map;
67
import java.util.Properties;
8+
import java.util.Set;
9+
import java.util.stream.Collectors;
710

811
public class CassandraSecondaryIndexIntegrationTest
912
extends DistributedStorageSecondaryIndexIntegrationTestBase {
@@ -16,4 +19,11 @@ protected Properties getProperties(String testName) {
1619
protected Map<String, String> getCreationOptions() {
1720
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1821
}
22+
23+
@Override
24+
protected Set<DataType> getSecondaryIndexTypes() {
25+
return super.getSecondaryIndexTypes().stream()
26+
.filter(type -> type != DataType.TIMESTAMP)
27+
.collect(Collectors.toSet());
28+
}
1929
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraSingleClusteringKeyScanIntegrationTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.scalar.db.storage.cassandra;
22

33
import com.scalar.db.api.DistributedStorageSingleClusteringKeyScanIntegrationTestBase;
4+
import com.scalar.db.io.DataType;
45
import java.util.Collections;
6+
import java.util.List;
57
import java.util.Map;
68
import java.util.Properties;
9+
import java.util.stream.Collectors;
710

811
public class CassandraSingleClusteringKeyScanIntegrationTest
912
extends DistributedStorageSingleClusteringKeyScanIntegrationTestBase {
@@ -16,4 +19,11 @@ protected Properties getProperties(String testName) {
1619
protected Map<String, String> getCreationOptions() {
1720
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1821
}
22+
23+
@Override
24+
protected List<DataType> getClusteringKeyTypes() {
25+
return super.getClusteringKeyTypes().stream()
26+
.filter(type -> type != DataType.TIMESTAMP)
27+
.collect(Collectors.toList());
28+
}
1929
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraSinglePartitionKeyIntegrationTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.scalar.db.storage.cassandra;
22

33
import com.scalar.db.api.DistributedStorageSinglePartitionKeyIntegrationTestBase;
4+
import com.scalar.db.io.DataType;
45
import java.util.Collections;
6+
import java.util.List;
57
import java.util.Map;
68
import java.util.Properties;
9+
import java.util.stream.Collectors;
710

811
public class CassandraSinglePartitionKeyIntegrationTest
912
extends DistributedStorageSinglePartitionKeyIntegrationTestBase {
@@ -16,4 +19,11 @@ protected Properties getProperties(String testName) {
1619
protected Map<String, String> getCreationOptions() {
1720
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1821
}
22+
23+
@Override
24+
protected List<DataType> getPartitionKeyTypes() {
25+
return super.getPartitionKeyTypes().stream()
26+
.filter(type -> type != DataType.TIMESTAMP)
27+
.collect(Collectors.toList());
28+
}
1929
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/ConsensusCommitAdminIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ protected Map<String, String> getCreationOptions() {
2222
protected AdminTestUtils getAdminTestUtils(String testName) {
2323
return new CassandraAdminTestUtils(getProperties(testName));
2424
}
25+
26+
@Override
27+
protected boolean isTimestampTypeSupported() {
28+
return false;
29+
}
2530
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/ConsensusCommitAdminRepairIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ protected void initialize(String testName) {
3030
admin = new ConsensusCommitAdmin(storageAdmin, new DatabaseConfig(properties));
3131
adminTestUtils = new CassandraAdminTestUtils(getProperties(testName), clusterManager);
3232
}
33+
34+
@Override
35+
protected boolean isTimestampTypeSupported() {
36+
return false;
37+
}
3338
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/ConsensusCommitIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ protected Properties getProps(String testName) {
1616
protected Map<String, String> getCreationOptions() {
1717
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1818
}
19+
20+
@Override
21+
protected boolean isTimestampTypeSupported() {
22+
return false;
23+
}
1924
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/SingleCrudOperationTransactionAdminIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ protected Properties getProps(String testName) {
1717
protected Map<String, String> getCreationOptions() {
1818
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1919
}
20+
21+
@Override
22+
protected boolean isTimestampTypeSupported() {
23+
return false;
24+
}
2025
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/SingleCrudOperationTransactionIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ protected Properties getProps(String testName) {
1717
protected Map<String, String> getCreationOptions() {
1818
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1919
}
20+
21+
@Override
22+
protected boolean isTimestampTypeSupported() {
23+
return false;
24+
}
2025
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/TwoPhaseConsensusCommitIntegrationTestWithCassandra.java

+5
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ protected Properties getProps1(String testName) {
1616
protected Map<String, String> getCreationOptions() {
1717
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
1818
}
19+
20+
@Override
21+
protected boolean isTimestampTypeSupported() {
22+
return false;
23+
}
1924
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void repairTable_ForTableWithoutStoredProcedure_ShouldCreateStoredProcedu
3535
cosmosAdminTestUtils.getTableStoredProcedure(getNamespace(), getTable()).delete();
3636

3737
// Act
38-
admin.repairTable(getNamespace(), getTable(), TABLE_METADATA, getCreationOptions());
38+
admin.repairTable(getNamespace(), getTable(), getTableMetadata(), getCreationOptions());
3939

4040
// Assert
4141
assertThatCode(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void repairTable_ForTableWithoutStoredProcedure_ShouldCreateStoredProcedu
3535
cosmosAdminTestUtils.getTableStoredProcedure(getNamespace(), getTable()).delete();
3636

3737
// Act
38-
admin.repairTable(getNamespace(), getTable(), TABLE_METADATA, getCreationOptions());
38+
admin.repairTable(getNamespace(), getTable(), getTableMetadata(), getCreationOptions());
3939

4040
// Assert
4141
assertThatCode(

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

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.scalar.db.storage.cosmos;
22

3-
import com.google.common.collect.ArrayListMultimap;
4-
import com.google.common.collect.ListMultimap;
53
import com.scalar.db.api.DistributedStorageMultipleClusteringKeyScanIntegrationTestBase;
64
import com.scalar.db.io.DataType;
5+
import java.util.List;
76
import java.util.Map;
87
import java.util.Properties;
8+
import java.util.stream.Collectors;
99

1010
public class CosmosMultipleClusteringKeyScanIntegrationTest
1111
extends DistributedStorageMultipleClusteringKeyScanIntegrationTestBase {
@@ -16,21 +16,11 @@ protected Properties getProperties(String testName) {
1616
}
1717

1818
@Override
19-
protected ListMultimap<DataType, DataType> getClusteringKeyTypes() {
19+
protected List<DataType> getDataTypes() {
2020
// Return types without BLOB because blob is not supported for clustering key for now
21-
ListMultimap<DataType, DataType> clusteringKeyTypes = ArrayListMultimap.create();
22-
for (DataType firstClusteringKeyType : DataType.values()) {
23-
if (firstClusteringKeyType == DataType.BLOB) {
24-
continue;
25-
}
26-
for (DataType secondClusteringKeyType : DataType.values()) {
27-
if (secondClusteringKeyType == DataType.BLOB) {
28-
continue;
29-
}
30-
clusteringKeyTypes.put(firstClusteringKeyType, secondClusteringKeyType);
31-
}
32-
}
33-
return clusteringKeyTypes;
21+
return super.getDataTypes().stream()
22+
.filter(type -> type != DataType.BLOB)
23+
.collect(Collectors.toList());
3424
}
3525

3626
@Override

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import com.scalar.db.api.DistributedStorageSingleClusteringKeyScanIntegrationTestBase;
44
import com.scalar.db.io.DataType;
5-
import java.util.HashSet;
5+
import java.util.ArrayList;
6+
import java.util.List;
67
import java.util.Map;
78
import java.util.Properties;
8-
import java.util.Set;
99

1010
public class CosmosSingleClusteringKeyScanIntegrationTest
1111
extends DistributedStorageSingleClusteringKeyScanIntegrationTestBase {
@@ -15,9 +15,9 @@ protected Properties getProperties(String testName) {
1515
}
1616

1717
@Override
18-
protected Set<DataType> getClusteringKeyTypes() {
18+
protected List<DataType> getClusteringKeyTypes() {
1919
// Return types without BLOB because blob is not supported for clustering key for now
20-
Set<DataType> clusteringKeyTypes = new HashSet<>();
20+
List<DataType> clusteringKeyTypes = new ArrayList<>();
2121
for (DataType dataType : DataType.values()) {
2222
if (dataType == DataType.BLOB) {
2323
continue;

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

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.scalar.db.storage.dynamo;
22

3-
import com.google.common.collect.ArrayListMultimap;
4-
import com.google.common.collect.ListMultimap;
53
import com.scalar.db.api.DistributedStorageMultipleClusteringKeyScanIntegrationTestBase;
64
import com.scalar.db.io.Column;
75
import com.scalar.db.io.DataType;
6+
import java.util.List;
87
import java.util.Map;
98
import java.util.Properties;
109
import java.util.Random;
10+
import java.util.stream.Collectors;
1111

1212
public class DynamoMultipleClusteringKeyScanIntegrationTest
1313
extends DistributedStorageMultipleClusteringKeyScanIntegrationTestBase {
@@ -18,21 +18,11 @@ protected Properties getProperties(String testName) {
1818
}
1919

2020
@Override
21-
protected ListMultimap<DataType, DataType> getClusteringKeyTypes() {
21+
protected List<DataType> getDataTypes() {
2222
// Return types without BLOB because blob is not supported for clustering key for now
23-
ListMultimap<DataType, DataType> clusteringKeyTypes = ArrayListMultimap.create();
24-
for (DataType firstClusteringKeyType : DataType.values()) {
25-
if (firstClusteringKeyType == DataType.BLOB) {
26-
continue;
27-
}
28-
for (DataType secondClusteringKeyType : DataType.values()) {
29-
if (secondClusteringKeyType == DataType.BLOB) {
30-
continue;
31-
}
32-
clusteringKeyTypes.put(firstClusteringKeyType, secondClusteringKeyType);
33-
}
34-
}
35-
return clusteringKeyTypes;
23+
return super.getDataTypes().stream()
24+
.filter(type -> type != DataType.BLOB)
25+
.collect(Collectors.toList());
3626
}
3727

3828
@Override

0 commit comments

Comments
 (0)