Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 38 additions & 30 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ subprojects {
apply from: rootProject.file('gradle/testing.gradle')

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

def publishBuild = Boolean.parseBoolean(findProperty('publishBuild') ?: 'false')
Expand Down Expand Up @@ -233,7 +233,7 @@ subprojects {
// It would be good to have more coverage, but this allows us to move forward with incomplete docs
options.addBooleanOption('Xdoclint:none', true)

options.addStringOption('source', '11')
options.addStringOption('source', '17')
options.with {
overview "src/main/javadoc/overview.html"

Expand All @@ -257,8 +257,8 @@ subprojects {
//enable incremental compilation
options.incremental = true

//target byte-code compatibility with Java 11 (regardless of build JDK)
options.release = 11
//target byte-code compatibility with Java 17 (regardless of build JDK)
options.release = 17
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void insertNonOverlappingRanges() {
Range fullRange = new Range(new byte[]{1}, new byte[]{(byte) (transactionCount + 1)});
List<Range> gaps = IntStream.range(0, transactionCount)
.mapToObj(i -> new Range(new byte[]{(byte)(i + 1), 0x00}, new byte[]{(byte)(i + 2)}))
.collect(Collectors.toList());
.toList();
assertGaps(fullRange, gaps, new byte[]{(byte)(transactionCount), 0x00});
}

Expand Down Expand Up @@ -386,7 +386,7 @@ void insertOverlappingRanges() {
List<Range> gaps = IntStream.range(0, transactionCount)
.filter(i -> i % 2 != 0)
.mapToObj(i -> new Range(new byte[]{(byte)(i + 1), 0x00}, new byte[]{(byte)(i + 2)}))
.collect(Collectors.toList());
.toList();
assertGaps(fullRange, gaps, new byte[]{(byte)(transactionCount), 0x00});
}

Expand Down Expand Up @@ -432,7 +432,7 @@ private void assertGaps(Range fullRange, List<Range> gaps, byte[] lastInRange) {
void concurrentlyReadAndFillInGaps() {
List<Range> ranges = IntStream.range(0, 10)
.mapToObj(i -> new Range(new byte[]{(byte) (2 * i + 1)}, new byte[]{(byte) (2 * i + 2)}))
.collect(Collectors.toList());
.toList();
try (Transaction tr = db.createTransaction()) {
for (Range r : ranges) {
rs.insertRange(tr, r, true).join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ public class SqlInsertTest {

@RegisterExtension
@Order(1)
public final SimpleDatabaseRule database = new SimpleDatabaseRule(
BasicMetadataTest.class, "CREATE TABLE simple (rest_no bigint, name string, primary key(rest_no)) " +
"CREATE TYPE AS STRUCT location (address string, latitude string, longitude string) " +
"CREATE TABLE with_loc (rest_no bigint, name string, loc location, primary key(rest_no))");
public final SimpleDatabaseRule database = new SimpleDatabaseRule(BasicMetadataTest.class,
"""
CREATE TABLE simple (rest_no bigint, name string, primary key(rest_no))
CREATE TYPE AS STRUCT location (address string, latitude string, longitude string)
CREATE TABLE with_loc (rest_no bigint, name string, loc location, primary key(rest_no))
"""
);

@ParameterizedTest
@ValueSource(booleans = {true, false})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
*/
public class CaseSensitiveDbObjectsTest {
@Nonnull
private static final String SCHEMA_TEMPLATE = "CREATE TABLE \"t1\" (\"group\" bigint, \"id\" string, \"val\" " +
"bigint, PRIMARY KEY(\"group\", \"id\")) ";
private static final String SCHEMA_TEMPLATE =
"""
CREATE TABLE "t1" ("group" bigint, "id" string, "val" bigint, PRIMARY KEY("group", "id"))
""";

@RegisterExtension
@Order(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
* has records that share a single primary key extent.
*/
public class DeleteRangeNoMetadataKeyTest {
private static final String SCHEMA_TEMPLATE = " CREATE TABLE t1 (id bigint, a string, b string, c string, d string, PRIMARY KEY(id, a, b)) " +
"CREATE TABLE t2 (id bigint, a string, b string, e bigint, f boolean, PRIMARY KEY(id, a, b))";
private static final String SCHEMA_TEMPLATE =
"""
CREATE TABLE t1 (id bigint, a string, b string, c string, d string, PRIMARY KEY(id, a, b))
CREATE TABLE t2 (id bigint, a string, b string, e bigint, f boolean, PRIMARY KEY(id, a, b))
""";

@RegisterExtension
@Order(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
* and thus different types share the same extent.
*/
public class IntermingledTablesTest {
private static final String SCHEMA_TEMPLATE = " " +
"CREATE TABLE t1 (group bigint, id string, val bigint, PRIMARY KEY(group, id)) " +
"CREATE TABLE t2 (group bigint, id string, val2 string, PRIMARY KEY(group, id))";
private static final String SCHEMA_TEMPLATE =
"""
CREATE TABLE t1 (group bigint, id string, val bigint, PRIMARY KEY(group, id))
CREATE TABLE t2 (group bigint, id string, val2 string, PRIMARY KEY(group, id))
""";

@RegisterExtension
@Order(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ public class JoinWithLimitTest {
public final EmbeddedRelationalExtension relationalExtension = new EmbeddedRelationalExtension();

private static final String getTemplate_definition =
"CREATE TABLE R(rpk bigint, ra bigint, primary key(rpk))" +
"CREATE TABLE S(spk bigint, sa bigint, primary key(spk))" +
"CREATE TYPE AS STRUCT D ( e bigint )" +
"CREATE TABLE Q(qpk bigint, d D array, PRIMARY KEY(qpk))";
"""
CREATE TABLE R(rpk bigint, ra bigint, primary key(rpk))
CREATE TABLE S(spk bigint, sa bigint, primary key(spk))
CREATE TYPE AS STRUCT D ( e bigint )
CREATE TABLE Q(qpk bigint, d D array, PRIMARY KEY(qpk))
""";

@RegisterExtension
@Order(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ public class RecordTypeKeyTest {
@Order(1)
public final SimpleDatabaseRule database = new SimpleDatabaseRule(
RecordTypeKeyTest.class,
"CREATE TABLE restaurant_review (reviewer bigint, rating bigint, SINGLE ROW ONLY)" +
" CREATE TABLE restaurant_tag (tag string, weight bigint, PRIMARY KEY(tag))" +
" CREATE INDEX record_rt_covering_idx as select reviewer from restaurant_review");
"""
CREATE TABLE restaurant_review (reviewer bigint, rating bigint, SINGLE ROW ONLY)
CREATE TABLE restaurant_tag (tag string, weight bigint, PRIMARY KEY(tag))
CREATE INDEX record_rt_covering_idx as select reviewer from restaurant_review
"""
);

@RegisterExtension
@Order(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,34 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

public class RelationalArrayTest {

// "enumeration_null enumeration array, enumeration_not_null enumeration array not null, " +
private static final String SCHEMA_TEMPLATE =
"""
CREATE TYPE AS STRUCT STRUCTURE(a integer, b string)
CREATE TYPE as enum enumeration('a', 'b')
CREATE TABLE T(
pk integer,
boolean_null boolean array, boolean_not_null boolean array not null,
integer_null integer array, integer_not_null integer array not null,
bigint_null bigint array, bigint_not_null bigint array not null,
float_null float array, float_not_null float array not null,
double_null double array, double_not_null double array not null,
string_null string array, string_not_null string array not null,
bytes_null bytes array, bytes_not_null bytes array not null,
struct_null structure array, struct_not_null structure array not null,
uuid_null uuid array, uuid_not_null uuid array not null,
primary key(pk))
CREATE TABLE B(pk integer, uuid_null uuid array, primary key(pk))
""";

@RegisterExtension
@Order(0)
public final EmbeddedRelationalExtension relationalExtension = new EmbeddedRelationalExtension();

@RegisterExtension
@Order(1)
public final SimpleDatabaseRule database = new SimpleDatabaseRule(RelationalArrayTest.class, SCHEMA);

private static final String SCHEMA = "CREATE TYPE AS STRUCT STRUCTURE(a integer, b string) " +
"CREATE TYPE as enum enumeration('a', 'b') " +
"CREATE TABLE T(" +
"pk integer, " +
"boolean_null boolean array, boolean_not_null boolean array not null, " +
"integer_null integer array, integer_not_null integer array not null, " +
"bigint_null bigint array, bigint_not_null bigint array not null, " +
"float_null float array, float_not_null float array not null, " +
"double_null double array, double_not_null double array not null, " +
"string_null string array, string_not_null string array not null, " +
"bytes_null bytes array, bytes_not_null bytes array not null, " +
"struct_null structure array, struct_not_null structure array not null, " +
"uuid_null uuid array, uuid_not_null uuid array not null, " +
// "enumeration_null enumeration array, enumeration_not_null enumeration array not null, " +
"primary key(pk)) " +
"CREATE TABLE B(pk integer, uuid_null uuid array, primary key(pk))";
public final SimpleDatabaseRule database = new SimpleDatabaseRule(RelationalArrayTest.class, SCHEMA_TEMPLATE);

public void insertQuery(@Nonnull String q) throws SQLException {
try (final var conn = DriverManager.getConnection(database.getConnectionUri().toString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@

public class SqlFunctionsTest {
@Nonnull
private static final String SCHEMA_TEMPLATE = " " +
"create table t1(col1 bigint, col2 string, col3 integer, primary key(col1))\n" +
"create function f1 ( in a bigint, in b string )\n" +
"as select col1, col2 from t1 where col1 < a and col2 = b\n" +
"create function f2 ( in k bigint )\n" +
"as select col1, col2 from f1(102, 'b')\n" +
"create function f3 (in x bigint, in y string)\n" +
"as select a.col1 as col1a, a.col2 as col2a, b.col1 as col1b, b.col2 as col2b from f2(x) as a, f1(x, y) as b\n" +
"create function f4 (in x bigint, in y string)\n" +
"as select col1a + col1b as s, col2a, col2b from f3(x, y)\n";
private static final String SCHEMA_TEMPLATE =
"""
create table t1(col1 bigint, col2 string, col3 integer, primary key(col1))
create function f1 ( in a bigint, in b string )
as select col1, col2 from t1 where col1 < a and col2 = b
create function f2 ( in k bigint )
as select col1, col2 from f1 (102, 'b')
create function f3 (in x bigint, in y string)
as select a.col1 as col1a, a.col2 as col2a, b.col1 as col1b, b.col2 as col2b from f2(x) as a, f1(x, y) as b
create function f4 (in x bigint, in y string)
as select col1a + col1b as s, col2a, col2b from f3(x, y)
""";

@RegisterExtension
@Order(0)
Expand Down
Loading
Loading