Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use and require Java 22 #441

Merged
merged 2 commits into from
Sep 3, 2024
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: [21, 22]
java-version: [22, 23-ea]
timeout-minutes: 20
steps:
- name: Checkout source
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.0
22
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Build requirements

* Mac OS X or Linux
* Java 21+, 64-bit
* Java 22+, 64-bit
* Docker

#### Running Trino Gateway in your IDE
Expand All @@ -21,7 +21,7 @@ or execute the following command:

#### Locally

This project requires Java 21. Note that higher version of Java have not been
This project requires Java 22. Note that higher version of Java have not been
verified and may run into unexpected issues.

Run `./mvnw clean install` to build `trino-gateway`. VM options required for
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Consider the following requirements for your Trino Gateway installation.

### Java

Trino Gateway requires a Java 21 runtime. Older versions of Java can not be
Trino Gateway requires a Java 22 runtime. Older versions of Java can not be
used. Newer versions might work but are not tested.

Verify the Java version on your system with `java -version`.
Expand Down
8 changes: 4 additions & 4 deletions gateway-ha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<optional>true</optional>
<version>${dep.errorprone.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -191,7 +191,7 @@
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-parser</artifactId>
<version>440</version>
<version>${dep.trino.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -292,7 +292,7 @@
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-jdbc</artifactId>
<version>449</version>
<version>${dep.trino.version}</version>
<scope>runtime</scope>
</dependency>

Expand Down Expand Up @@ -335,7 +335,7 @@
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-client</artifactId>
<version>444</version>
<version>${dep.trino.version}</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import io.trino.sql.tree.Execute;
import io.trino.sql.tree.Identifier;
import io.trino.sql.tree.Node;
import io.trino.sql.tree.NodeLocation;
import io.trino.sql.tree.QualifiedName;
import io.trino.sql.tree.RenameMaterializedView;
import io.trino.sql.tree.RenameSchema;
Expand Down Expand Up @@ -75,6 +76,7 @@
import static com.google.common.io.BaseEncoding.base64Url;
import static io.airlift.json.JsonCodec.jsonCodec;
import static java.lang.Math.toIntExact;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;
import static java.util.Objects.requireNonNullElse;
Expand Down Expand Up @@ -199,7 +201,7 @@ private void processRequestBody(HttpServletRequest request, RequestAnalyzerConfi
schemaBuilder.addAll(tables.stream().map(q -> q.getParts().get(1)).iterator());
schemas = schemaBuilder.build();
catalogSchemaBuilder.addAll(
tables.stream().map(qualifiedName -> String.format("%s.%s", qualifiedName.getParts().getFirst(), qualifiedName.getParts().get(1))).iterator());
tables.stream().map(qualifiedName -> format("%s.%s", qualifiedName.getParts().getFirst(), qualifiedName.getParts().get(1))).iterator());
catalogSchemas = catalogSchemaBuilder.build();
isQueryParsingSuccessful = true;
}
Expand Down Expand Up @@ -230,7 +232,7 @@ private Map<String, String> getPreparedStatements(HttpServletRequest request)
for (String preparedStatement : preparedStatementsArray) {
String[] nameValue = preparedStatement.split("=");
if (nameValue.length != 2) {
throw new RequestParsingException(String.format("preparedStatement must be formatted as name=value, but is %s", preparedStatement));
throw new RequestParsingException(format("preparedStatement must be formatted as name=value, but is %s", preparedStatement));
}
preparedStatementsMapBuilder.put(URLDecoder.decode(nameValue[0], UTF_8), URLDecoder.decode(decodePreparedStatementFromHeader(nameValue[1]), UTF_8));
}
Expand Down Expand Up @@ -350,19 +352,19 @@ private void setCatalogAndSchemaNameFromSchemaQualifiedName(
if (schemaOptional.isEmpty()) {
schemaBuilder.add(defaultSchema.orElseThrow(this::unsetDefaultExceptionSupplier));
catalogBuilder.add(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier));
catalogSchemaBuilder.add(String.format("%s.%s", defaultCatalog, defaultSchema));
catalogSchemaBuilder.add(format("%s.%s", defaultCatalog, defaultSchema));
}
else {
QualifiedName schema = schemaOptional.orElseThrow();
switch (schema.getParts().size()) {
case 1:
schemaBuilder.add(schema.getParts().getFirst());
catalogBuilder.add(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier));
catalogSchemaBuilder.add(String.format("%s.%s", defaultCatalog, schema.getParts().getFirst()));
catalogSchemaBuilder.add(format("%s.%s", defaultCatalog, schema.getParts().getFirst()));
case 2:
schemaBuilder.add(schema.getParts().get(1));
catalogBuilder.add(schema.getParts().getFirst());
catalogSchemaBuilder.add(String.format("%s.%s", schema.getParts().getFirst(), schema.getParts().getLast()));
catalogSchemaBuilder.add(format("%s.%s", schema.getParts().getFirst(), schema.getParts().getLast()));
default:
log.error("Schema has >2 parts: " + schema);
}
Expand Down Expand Up @@ -433,7 +435,7 @@ private QualifiedName parseIdentifierStringToQualifiedName(String name)
if (!inQuotes) {
if (i != start) {
log.error("Illegal position for first quote character in table name: %s", name);
throw new ParsingException("Illegal position for first quote character in table name: %s");
throw new ParsingException(format("Illegal position for first quote character in table name: %s", name), new NodeLocation(1, i));
}
start = start + 1;
partQuoted = true;
Expand Down
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.targetJdk>21</project.build.targetJdk>
<air.java.version>21</air.java.version>
<project.build.targetJdk>22</project.build.targetJdk>
<air.java.version>22</air.java.version>
<air.check.skip-spotbugs>true</air.check.skip-spotbugs>
<air.check.skip-pmd>true</air.check.skip-pmd>
<air.release.preparation-goals>clean verify -DskipTests</air.release.preparation-goals>

<!-- Dependency versions, keep sorted -->
<dep.errorprone.version>2.29.2</dep.errorprone.version>
<dep.trino.version>454</dep.trino.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -103,7 +107,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.24.0</version>
<version>${dep.errorprone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down