From 98d47c5ef7edc3cd1a6a6e6ca523aa5893698865 Mon Sep 17 00:00:00 2001 From: Henry Mai Date: Wed, 19 Apr 2023 23:58:02 -0400 Subject: [PATCH] GH-35245: [Java][Arrow Dataset][Linux] Enable GCS Enables GCS when building the Arrow Dataset for Java and also fixes various java build failures. Without the changes to flight-sql-jdbc-driver/pom.xml the flight-sql-jdbc-driver build will fail with the following errors: [WARNING] Used undeclared dependencies found: [WARNING] org.bouncycastle:bcpkix-jdk15on:jar:1.61:runtime [WARNING] org.apache.arrow:arrow-memory-core:jar:12.0.0-SNAPSHOT:runtime [WARNING] org.hamcrest:hamcrest:jar:2.2:runtime [WARNING] org.apache.arrow:flight-sql:jar:12.0.0-SNAPSHOT:runtime [WARNING] org.mockito:mockito-core:jar:2.25.1:test [WARNING] org.apache.arrow:flight-core:jar:12.0.0-SNAPSHOT:runtime [WARNING] org.slf4j:slf4j-api:jar:1.7.25:runtime [WARNING] io.netty:netty-common:jar:4.1.82.Final:runtime [WARNING] joda-time:joda-time:jar:2.10.14:runtime [WARNING] org.apache.calcite.avatica:avatica:jar:1.18.0:runtime [WARNING] com.google.protobuf:protobuf-java:jar:3.21.6:runtime [WARNING] org.apache.arrow:arrow-vector:jar:12.0.0-SNAPSHOT:runtime [WARNING] com.google.guava:guava:jar:31.1-jre:runtime [...] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.0.1:analyze-only (analyze) on project flight-sql-jdbc-driver: Dependency problems found -> [Help 1] And also fail with: Caused by: java.lang.NullPointerException: Could not find test data path. Set the environment variable ARROW_TEST_DATA or the JVM property arrow.test.dataRoot. at java.util.Objects.requireNonNull(Objects.java:228) at org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates.getTestDataRoot(FlightSqlTestCertificates.java:40) at org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates.getFlightTestDataRoot(FlightSqlTestCertificates.java:51) at org.apache.arrow.driver.jdbc.utils.FlightSqlTestCertificates.exampleTlsCerts(FlightSqlTestCertificates.java:60) at org.apache.arrow.driver.jdbc.ConnectionTlsTest.(ConnectionTlsTest.java:59) --- ci/docker/java-jni-manylinux-201x.dockerfile | 4 + ci/scripts/java_jni_manylinux_build.sh | 2 + java/flight/flight-sql-jdbc-driver/pom.xml | 123 +++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/ci/docker/java-jni-manylinux-201x.dockerfile b/ci/docker/java-jni-manylinux-201x.dockerfile index 810949ab268..6374e40641c 100644 --- a/ci/docker/java-jni-manylinux-201x.dockerfile +++ b/ci/docker/java-jni-manylinux-201x.dockerfile @@ -37,6 +37,10 @@ ARG java=1.8.0 RUN yum install -y java-$java-openjdk-devel rh-maven35 && yum clean all ENV JAVA_HOME=/usr/lib/jvm/java-$java-openjdk/ +# Install the gcs testbench +COPY ci/scripts/install_gcs_testbench.sh /arrow/ci/scripts/ +RUN PYTHON=python /arrow/ci/scripts/install_gcs_testbench.sh default + # For ci/scripts/{cpp,java}_*.sh ENV ARROW_HOME=/tmp/local \ ARROW_JAVA_CDATA=ON \ diff --git a/ci/scripts/java_jni_manylinux_build.sh b/ci/scripts/java_jni_manylinux_build.sh index 7480aa75aeb..3aadc71ebb4 100755 --- a/ci/scripts/java_jni_manylinux_build.sh +++ b/ci/scripts/java_jni_manylinux_build.sh @@ -39,6 +39,7 @@ export ARROW_ACERO export ARROW_DATASET : ${ARROW_GANDIVA:=ON} export ARROW_GANDIVA +: ${ARROW_GCS:=ON} : ${ARROW_JEMALLOC:=ON} : ${ARROW_RPATH_ORIGIN:=ON} : ${ARROW_ORC:=ON} @@ -75,6 +76,7 @@ cmake \ -DARROW_DEPENDENCY_USE_SHARED=OFF \ -DARROW_GANDIVA_PC_CXX_FLAGS=${GANDIVA_CXX_FLAGS} \ -DARROW_GANDIVA=${ARROW_GANDIVA} \ + -DARROW_GCS=${ARROW_GCS} \ -DARROW_JEMALLOC=${ARROW_JEMALLOC} \ -DARROW_ORC=${ARROW_ORC} \ -DARROW_PARQUET=${ARROW_PARQUET} \ diff --git a/java/flight/flight-sql-jdbc-driver/pom.xml b/java/flight/flight-sql-jdbc-driver/pom.xml index 0f8ccd43e3f..1f2a08547ee 100644 --- a/java/flight/flight-sql-jdbc-driver/pom.xml +++ b/java/flight/flight-sql-jdbc-driver/pom.xml @@ -28,16 +28,139 @@ https://arrow.apache.org + + + org.hamcrest + hamcrest-core + 1.3 + test + + org.apache.arrow flight-sql-jdbc-core ${project.version} runtime + + + org.bouncycastle + bcpkix-jdk15on + 1.61 + runtime + + + + + org.apache.arrow + arrow-memory-core + ${project.version} + runtime + + + + org.apache.arrow + flight-sql + ${project.version} + runtime + + + + org.mockito + mockito-core + 3.12.4 + test + + + + org.mockito + mockito-inline + 3.12.4 + test + + + + org.apache.arrow + flight-core + ${project.version} + + + io.netty + netty-transport-native-kqueue + + + io.netty + netty-transport-native-epoll + + + runtime + + + + org.slf4j + slf4j-api + runtime + + + + io.netty + netty-common + runtime + + + + joda-time + joda-time + 2.10.14 + runtime + + + + org.apache.calcite.avatica + avatica + 1.18.0 + runtime + + + + com.google.protobuf + protobuf-java + runtime + + + + org.apache.arrow + arrow-vector + ${project.version} + ${arrow.vector.classifier} + runtime + + + + com.google.guava + guava + runtime + + + + commons-io + commons-io + 2.7 + test + + + maven-surefire-plugin + + false + + ${project.basedir}/../../../testing/data + + + org.apache.maven.plugins maven-shade-plugin