Skip to content

Commit

Permalink
chore(java): bump arrow to 18.0.0 (#2293)
Browse files Browse the repository at this point in the history
Update arrow dependency from 15.0.0 to 18.0.0.

As Apache Arrow now requires Java 11, Apache Arrow ADBC also now
requires Java 11.

Update Apache Parent pom to version 33 and take advantage of Java 9+
support.

Clean up pom.xml files to remove duplicate or conflicting plugin version
definition and/or configuration

Update FlightSQL tests to use the FlightSQL Junit 5 extension.

Update build and dev scripts, and documentation
  • Loading branch information
laurentgo authored Nov 6, 2024
1 parent 4909022 commit 12a74af
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ARCH_SHORT=amd64
ARCH_CONDA_FORGE=linux_64_

# Default versions for various dependencies
JDK=8
JDK=11
MANYLINUX=2-28
MAVEN=3.6.3
PLATFORM=linux/amd64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8', '11', '17', '21', '22']
java: ['11', '17', '21', '22']
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
docs.tgz
java:
name: "Java 1.8"
name: "Java 11"
runs-on: ubuntu-latest
needs:
- source
Expand Down
4 changes: 0 additions & 4 deletions ci/scripts/java_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ main() {
pushd ${source_dir}/java
mvn -B clean \
install \
assembly:single \
source:jar \
javadoc:jar \
-Papache-release \
-DdescriptorId=source-release \
-T 2C \
-DskipTests \
-Dgpg.skip
Expand Down
2 changes: 1 addition & 1 deletion dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Requirements
# - Ruby >= 2.3
# - Maven >= 3.3.9
# - JDK >=7
# - JDK >= 11
# - gcc >= 4.8
# - Go >= 1.21
# - Docker
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development/releasing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ How to Verify Release Candidates
- GLib and gobject-introspection with headers
- pkg-config or cmake must be able to find libarrow-glib.so
- GI_TYPELIB_PATH should be set to the path to the girepository-1.0 directory
- Java JRE and JDK (Java 8+)
- Java JRE and JDK (Java 11+)
- the javadoc command must also be accessible
- Go
- CMake, ninja-build, libpq (with headers), SQLite (with headers)
Expand Down
7 changes: 0 additions & 7 deletions java/driver/flight-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<!-- To use FlightSeverTestRule from arrow-flight-sql-jdbc-core -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>flight-sql-jdbc-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.apache.arrow.adbc.core.AdbcDriver;
import org.apache.arrow.adbc.core.AdbcException;
import org.apache.arrow.adbc.drivermanager.AdbcDriverManager;
import org.apache.arrow.driver.jdbc.FlightServerTestRule;
import org.apache.arrow.driver.jdbc.FlightServerTestExtension;
import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer;
import org.apache.arrow.flight.FlightProducer;
import org.apache.arrow.flight.sql.FlightSqlProducer;
Expand All @@ -58,19 +58,19 @@
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.Schema;
import org.apache.arrow.vector.util.Text;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

/** Test functions for returning database catalog information. */
public class GetObjectsTests {
private static final BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
private static final MockFlightSqlProducer FLIGHT_SQL_PRODUCER = new MockFlightSqlProducer();

@ClassRule
public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE =
FlightServerTestRule.createStandardTestRule(FLIGHT_SQL_PRODUCER);
@RegisterExtension
public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION =
FlightServerTestExtension.createStandardTestExtension(FLIGHT_SQL_PRODUCER);

private static final int BASE_ROW_COUNT = 10;
private static AdbcConnection connection;
Expand All @@ -82,13 +82,14 @@ private enum ExpectedColumnSelection {
ALL_COLUMNS
}

@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws AdbcException {
String uri = String.format("grpc+tcp://%s:%d", "localhost", FLIGHT_SERVER_TEST_RULE.getPort());
String uri =
String.format("grpc+tcp://%s:%d", "localhost", FLIGHT_SERVER_TEST_EXTENSION.getPort());
Map<String, Object> params = new HashMap<>();
params.put(AdbcDriver.PARAM_URI.getKey(), uri);
params.put(AdbcDriver.PARAM_USERNAME.getKey(), FlightServerTestRule.DEFAULT_USER);
params.put(AdbcDriver.PARAM_PASSWORD.getKey(), FlightServerTestRule.DEFAULT_PASSWORD);
params.put(AdbcDriver.PARAM_USERNAME.getKey(), FlightServerTestExtension.DEFAULT_USER);
params.put(AdbcDriver.PARAM_PASSWORD.getKey(), FlightServerTestExtension.DEFAULT_PASSWORD);
params.put(FlightSqlConnectionProperties.WITH_COOKIE_MIDDLEWARE.getKey(), true);
AdbcDatabase db =
AdbcDriverManager.getInstance()
Expand Down Expand Up @@ -291,7 +292,7 @@ public static void setUpBeforeClass() throws AdbcException {
commandGetTablesWithSchema, commandGetTablesWithSchemaResultProducer);
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
AutoCloseables.close(connection, FLIGHT_SQL_PRODUCER, allocator);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
import org.apache.arrow.adbc.core.AdbcException;
import org.apache.arrow.adbc.core.AdbcStatusCode;
import org.apache.arrow.adbc.drivermanager.AdbcDriverManager;
import org.apache.arrow.driver.jdbc.FlightServerTestRule;
import org.apache.arrow.driver.jdbc.FlightServerTestExtension;
import org.apache.arrow.driver.jdbc.authentication.UserPasswordAuthentication;
import org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates;
import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.util.AutoCloseables;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class MutualTlsTest {

@ClassRule public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE;
@RegisterExtension public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION;

private static final String USER_1 = "user1";
private static final String PASS_1 = "pass1";
Expand All @@ -67,8 +67,8 @@ public class MutualTlsTest {
UserPasswordAuthentication authentication =
new UserPasswordAuthentication.Builder().user(USER_1, PASS_1).build();

FLIGHT_SERVER_TEST_RULE =
new FlightServerTestRule.Builder()
FLIGHT_SERVER_TEST_EXTENSION =
new FlightServerTestExtension.Builder()
.authentication(authentication)
.useEncryption(certKey.cert, certKey.key)
.useMTlsClientVerification(FlightSqlTestCertificates.exampleCACert())
Expand All @@ -79,15 +79,15 @@ public class MutualTlsTest {
private BufferAllocator allocator;
private Map<String, Object> params;

@Before
@BeforeEach
public void setUp() {
allocator = new RootAllocator(Long.MAX_VALUE);
params = new HashMap<>();
params.put(AdbcDriver.PARAM_USERNAME.getKey(), USER_1);
params.put(AdbcDriver.PARAM_PASSWORD.getKey(), PASS_1);
}

@After
@AfterEach
public void tearDown() throws Exception {
AutoCloseables.close(allocator);
}
Expand Down Expand Up @@ -147,6 +147,6 @@ private String getUri(boolean withTls) {
String protocol = String.format("grpc%s", withTls ? "+tls" : "+tcp");
return String.format(
"%s://%s:%d",
protocol, FLIGHT_SERVER_TEST_RULE.getHost(), FLIGHT_SERVER_TEST_RULE.getPort());
protocol, FLIGHT_SERVER_TEST_EXTENSION.getHost(), FLIGHT_SERVER_TEST_EXTENSION.getPort());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
import org.apache.arrow.adbc.core.AdbcException;
import org.apache.arrow.adbc.core.AdbcStatusCode;
import org.apache.arrow.adbc.drivermanager.AdbcDriverManager;
import org.apache.arrow.driver.jdbc.FlightServerTestRule;
import org.apache.arrow.driver.jdbc.FlightServerTestExtension;
import org.apache.arrow.driver.jdbc.authentication.UserPasswordAuthentication;
import org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates;
import org.apache.arrow.driver.jdbc.utils.MockFlightSqlProducer;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.util.AutoCloseables;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class TlsTest {

@ClassRule public static final FlightServerTestRule FLIGHT_SERVER_TEST_RULE;
@RegisterExtension public static FlightServerTestExtension FLIGHT_SERVER_TEST_EXTENSION;

private static final String USER_1 = "user1";
private static final String PASS_1 = "pass1";
Expand All @@ -59,8 +59,8 @@ public class TlsTest {
UserPasswordAuthentication authentication =
new UserPasswordAuthentication.Builder().user(USER_1, PASS_1).build();

FLIGHT_SERVER_TEST_RULE =
new FlightServerTestRule.Builder()
FLIGHT_SERVER_TEST_EXTENSION =
new FlightServerTestExtension.Builder()
.authentication(authentication)
.useEncryption(certKey.cert, certKey.key)
.producer(new MockFlightSqlProducer())
Expand All @@ -70,15 +70,15 @@ public class TlsTest {
private BufferAllocator allocator;
private Map<String, Object> params;

@Before
@BeforeEach
public void setUp() {
allocator = new RootAllocator(Long.MAX_VALUE);
params = new HashMap<>();
params.put(AdbcDriver.PARAM_USERNAME.getKey(), USER_1);
params.put(AdbcDriver.PARAM_PASSWORD.getKey(), PASS_1);
}

@After
@AfterEach
public void tearDown() throws Exception {
AutoCloseables.close(allocator);
}
Expand Down Expand Up @@ -160,7 +160,7 @@ public void testClientTlsOnGoodHostnameOverride() throws Exception {
params.put(AdbcDriver.PARAM_URI.getKey(), getUri(true));
params.put(
FlightSqlConnectionProperties.TLS_OVERRIDE_HOSTNAME.getKey(),
FLIGHT_SERVER_TEST_RULE.getHost());
FLIGHT_SERVER_TEST_EXTENSION.getHost());
try (InputStream stream = Files.newInputStream(Paths.get(TLS_ROOT_CERTS_PATH))) {
params.put(FlightSqlConnectionProperties.TLS_ROOT_CERTS.getKey(), stream);
AdbcDatabase db =
Expand All @@ -174,6 +174,6 @@ private String getUri(boolean withTls) {
String protocol = String.format("grpc%s", withTls ? "+tls" : "+tcp");
return String.format(
"%s://%s:%d",
protocol, FLIGHT_SERVER_TEST_RULE.getHost(), FLIGHT_SERVER_TEST_RULE.getPort());
protocol, FLIGHT_SERVER_TEST_EXTENSION.getHost(), FLIGHT_SERVER_TEST_EXTENSION.getPort());
}
}
13 changes: 0 additions & 13 deletions java/driver/jdbc-validation-mssqlserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>

<properties>
<dep.mssql-jdbc.version>12.4.1.jre8</dep.mssql-jdbc.version>
</properties>
</profile>
</profiles>
</project>
Loading

0 comments on commit 12a74af

Please sign in to comment.