diff --git a/ci/scripts/integration_arrow_build.sh b/ci/scripts/integration_arrow_build.sh index 02f593bf77b23..e5c31527aedff 100755 --- a/ci/scripts/integration_arrow_build.sh +++ b/ci/scripts/integration_arrow_build.sh @@ -46,7 +46,7 @@ if [ "${ARROW_INTEGRATION_JAVA}" == "ON" ]; then export ARROW_JAVA_CDATA="ON" export JAVA_JNI_CMAKE_ARGS="-DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF -DARROW_JAVA_JNI_ENABLE_C=ON" - ${arrow_dir}/ci/scripts/java_jni_build.sh ${arrow_dir} ${ARROW_HOME} ${build_dir} /tmp/dist/java/$(arch) + ${arrow_dir}/ci/scripts/java_jni_build.sh ${arrow_dir} ${ARROW_HOME} ${build_dir} /tmp/dist/java ${arrow_dir}/ci/scripts/java_build.sh ${arrow_dir} ${build_dir} /tmp/dist/java fi diff --git a/ci/scripts/java_jni_build.sh b/ci/scripts/java_jni_build.sh index 320c98c04df1e..d989351ab7e4d 100755 --- a/ci/scripts/java_jni_build.sh +++ b/ci/scripts/java_jni_build.sh @@ -24,7 +24,6 @@ arrow_install_dir=${2} build_dir=${3}/java_jni # The directory where the final binaries will be stored when scripts finish dist_dir=${4} - prefix_dir="${build_dir}/java-jni" echo "=== Clear output directories and leftovers ===" @@ -56,7 +55,6 @@ cmake \ -DBUILD_TESTING=${ARROW_JAVA_BUILD_TESTS} \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -DCMAKE_PREFIX_PATH=${arrow_install_dir} \ - -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=${prefix_dir} \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \ -DProtobuf_USE_STATIC_LIBS=ON \ diff --git a/ci/scripts/java_jni_macos_build.sh b/ci/scripts/java_jni_macos_build.sh index d66c39a37c5bd..4ecc029bdd3c2 100755 --- a/ci/scripts/java_jni_macos_build.sh +++ b/ci/scripts/java_jni_macos_build.sh @@ -31,7 +31,7 @@ case ${normalized_arch} in ;; esac # The directory where the final binaries will be stored when scripts finish -dist_dir=${3}/${normalized_arch} +dist_dir=${3} echo "=== Clear output directories and leftovers ===" # Clear output directories and leftovers @@ -82,7 +82,6 @@ cmake \ -DARROW_S3=${ARROW_S3} \ -DARROW_USE_CCACHE=${ARROW_USE_CCACHE} \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=${install_dir} \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -DGTest_SOURCE=BUNDLED \ @@ -138,8 +137,8 @@ archery linking check-dependencies \ --allow libncurses \ --allow libobjc \ --allow libz \ - libarrow_cdata_jni.dylib \ - libarrow_dataset_jni.dylib \ - libarrow_orc_jni.dylib \ - libgandiva_jni.dylib + arrow_cdata_jni/${normalized_arch}/libarrow_cdata_jni.dylib \ + arrow_dataset_jni/${normalized_arch}/libarrow_dataset_jni.dylib \ + arrow_orc_jni/${normalized_arch}/libarrow_orc_jni.dylib \ + gandiva_jni/${normalized_arch}/libgandiva_jni.dylib popd diff --git a/ci/scripts/java_jni_manylinux_build.sh b/ci/scripts/java_jni_manylinux_build.sh index 03939715e390f..da4987d307ce4 100755 --- a/ci/scripts/java_jni_manylinux_build.sh +++ b/ci/scripts/java_jni_manylinux_build.sh @@ -28,7 +28,7 @@ case ${normalized_arch} in ;; esac # The directory where the final binaries will be stored when scripts finish -dist_dir=${3}/${normalized_arch} +dist_dir=${3} echo "=== Clear output directories and leftovers ===" # Clear output directories and leftovers @@ -91,7 +91,6 @@ cmake \ -DARROW_S3=${ARROW_S3} \ -DARROW_USE_CCACHE=${ARROW_USE_CCACHE} \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=${ARROW_HOME} \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -DGTest_SOURCE=BUNDLED \ @@ -164,8 +163,8 @@ archery linking check-dependencies \ --allow libstdc++ \ --allow libz \ --allow linux-vdso \ - libarrow_cdata_jni.so \ - libarrow_dataset_jni.so \ - libarrow_orc_jni.so \ - libgandiva_jni.so + arrow_cdata_jni/${normalized_arch}/libarrow_cdata_jni.so \ + arrow_dataset_jni/${normalized_arch}/libarrow_dataset_jni.so \ + arrow_orc_jni/${normalized_arch}/libarrow_orc_jni.so \ + gandiva_jni/${normalized_arch}/libgandiva_jni.so popd diff --git a/ci/scripts/java_jni_windows_build.sh b/ci/scripts/java_jni_windows_build.sh index 778ee9696790e..39288f4a9d0ce 100755 --- a/ci/scripts/java_jni_windows_build.sh +++ b/ci/scripts/java_jni_windows_build.sh @@ -22,7 +22,7 @@ set -ex arrow_dir=${1} build_dir=${2} # The directory where the final binaries will be stored when scripts finish -dist_dir=${3}/x86_64 +dist_dir=${3} echo "=== Clear output directories and leftovers ===" # Clear output directories and leftovers @@ -72,7 +72,6 @@ cmake \ -DARROW_WITH_SNAPPY=ON \ -DARROW_WITH_ZSTD=ON \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=${install_dir} \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -GNinja \ diff --git a/dev/archery/archery/integration/tester_java.py b/dev/archery/archery/integration/tester_java.py index 857fe0c50af06..8e7a0bb99f9de 100644 --- a/dev/archery/archery/integration/tester_java.py +++ b/dev/archery/archery/integration/tester_java.py @@ -259,6 +259,8 @@ def __init__(self, *args, **kwargs): self._java_opts.append( '--add-opens=java.base/java.nio=' 'org.apache.arrow.memory.core,ALL-UNNAMED') + self._java_opts.append( + '--add-reads=org.apache.arrow.flight.core=ALL-UNNAMED') def _run(self, arrow_path=None, json_path=None, command='VALIDATE'): cmd = ( diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml index 7ee68e77ee637..086d1fdbe811f 100644 --- a/dev/tasks/java-jars/github.yml +++ b/dev/tasks/java-jars/github.yml @@ -208,29 +208,29 @@ jobs: run: | set -x - test -f arrow/java-dist/x86_64/libarrow_cdata_jni.so - test -f arrow/java-dist/x86_64/libarrow_dataset_jni.so - test -f arrow/java-dist/x86_64/libarrow_orc_jni.so - test -f arrow/java-dist/x86_64/libgandiva_jni.so + test -f arrow/java-dist/arrow_cdata_jni/x86_64/libarrow_cdata_jni.so + test -f arrow/java-dist/arrow_dataset_jni/x86_64/libarrow_dataset_jni.so + test -f arrow/java-dist/arrow_orc_jni/x86_64/libarrow_orc_jni.so + test -f arrow/java-dist/gandiva_jni/x86_64/libgandiva_jni.so - test -f arrow/java-dist/aarch_64/libarrow_cdata_jni.so - test -f arrow/java-dist/aarch_64/libarrow_dataset_jni.so - test -f arrow/java-dist/aarch_64/libarrow_orc_jni.so - test -f arrow/java-dist/aarch_64/libgandiva_jni.so + test -f arrow/java-dist/arrow_cdata_jni/aarch_64/libarrow_cdata_jni.so + test -f arrow/java-dist/arrow_dataset_jni/aarch_64/libarrow_dataset_jni.so + test -f arrow/java-dist/arrow_orc_jni/aarch_64/libarrow_orc_jni.so + test -f arrow/java-dist/gandiva_jni/aarch_64/libgandiva_jni.so - test -f arrow/java-dist/x86_64/libarrow_cdata_jni.dylib - test -f arrow/java-dist/x86_64/libarrow_dataset_jni.dylib - test -f arrow/java-dist/x86_64/libarrow_orc_jni.dylib - test -f arrow/java-dist/x86_64/libgandiva_jni.dylib + test -f arrow/java-dist/arrow_cdata_jni/x86_64/libarrow_cdata_jni.dylib + test -f arrow/java-dist/arrow_dataset_jni/x86_64/libarrow_dataset_jni.dylib + test -f arrow/java-dist/arrow_orc_jni/x86_64/libarrow_orc_jni.dylib + test -f arrow/java-dist/gandiva_jni/x86_64/libgandiva_jni.dylib - test -f arrow/java-dist/aarch_64/libarrow_cdata_jni.dylib - test -f arrow/java-dist/aarch_64/libarrow_dataset_jni.dylib - test -f arrow/java-dist/aarch_64/libarrow_orc_jni.dylib - test -f arrow/java-dist/aarch_64/libgandiva_jni.dylib + test -f arrow/java-dist/arrow_cdata_jni/aarch_64/libarrow_cdata_jni.dylib + test -f arrow/java-dist/arrow_dataset_jni/aarch_64/libarrow_dataset_jni.dylib + test -f arrow/java-dist/arrow_orc_jni/aarch_64/libarrow_orc_jni.dylib + test -f arrow/java-dist/gandiva_jni/aarch_64/libgandiva_jni.dylib - test -f arrow/java-dist/x86_64/arrow_cdata_jni.dll - test -f arrow/java-dist/x86_64/arrow_dataset_jni.dll - test -f arrow/java-dist/x86_64/arrow_orc_jni.dll + test -f arrow/java-dist/arrow_cdata_jni/x86_64/arrow_cdata_jni.dll + test -f arrow/java-dist/arrow_dataset_jni/x86_64/arrow_dataset_jni.dll + test -f arrow/java-dist/arrow_orc_jni/x86_64/arrow_orc_jni.dll - name: Build bundled jar run: | set -e diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 04faef427e281..ca45d48bcd470 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -810,13 +810,6 @@ tasks: - flight-core-{no_rc_snapshot_version}-tests.jar - flight-core-{no_rc_snapshot_version}.jar - flight-core-{no_rc_snapshot_version}.pom - - flight-grpc-{no_rc_snapshot_version}-cyclonedx.json - - flight-grpc-{no_rc_snapshot_version}-cyclonedx.xml - - flight-grpc-{no_rc_snapshot_version}-javadoc.jar - - flight-grpc-{no_rc_snapshot_version}-sources.jar - - flight-grpc-{no_rc_snapshot_version}-tests.jar - - flight-grpc-{no_rc_snapshot_version}.jar - - flight-grpc-{no_rc_snapshot_version}.pom - flight-integration-tests-{no_rc_snapshot_version}-cyclonedx.json - flight-integration-tests-{no_rc_snapshot_version}-cyclonedx.xml - flight-integration-tests-{no_rc_snapshot_version}-jar-with-dependencies.jar diff --git a/docker-compose.yml b/docker-compose.yml index 14eff67f38971..a08345c198fa0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1343,7 +1343,7 @@ services: command: [ "/arrow/ci/scripts/cpp_build.sh /arrow /build && /arrow/ci/scripts/python_build.sh /arrow /build && - /arrow/ci/scripts/java_jni_build.sh /arrow $${ARROW_HOME} /build /tmp/dist/java/$$(arch) && + /arrow/ci/scripts/java_jni_build.sh /arrow $${ARROW_HOME} /build /tmp/dist/java/ && /arrow/ci/scripts/java_build.sh /arrow /build /tmp/dist/java && /arrow/ci/scripts/java_cdata_integration.sh /arrow /tmp/dist/java" ] diff --git a/docs/source/developers/java/building.rst b/docs/source/developers/java/building.rst index 0e831915e09b9..27e2de97328c3 100644 --- a/docs/source/developers/java/building.rst +++ b/docs/source/developers/java/building.rst @@ -115,9 +115,8 @@ Maven $ export JAVA_HOME= $ java --version $ mvn generate-resources -Pgenerate-libs-cdata-all-os -N - $ ls -latr ../java-dist/lib/ - |__ libarrow_cdata_jni.dylib - |__ libarrow_cdata_jni.so + $ ls -latr ../java-dist/lib + |__ arrow_cdata_jni/ - To build only the JNI C Data Interface library (Windows): @@ -125,8 +124,8 @@ Maven $ cd arrow/java $ mvn generate-resources -Pgenerate-libs-cdata-all-os -N - $ dir "../java-dist/bin/x86_64" - |__ arrow_cdata_jni.dll + $ dir "../java-dist/bin" + |__ arrow_cdata_jni/ - To build all JNI libraries (macOS / Linux) except the JNI C Data Interface library: @@ -136,10 +135,10 @@ Maven $ export JAVA_HOME= $ java --version $ mvn generate-resources -Pgenerate-libs-jni-macos-linux -N - $ ls -latr java-dist/lib//*_{jni,java}.* - |__ libarrow_dataset_jni.dylib - |__ libarrow_orc_jni.dylib - |__ libgandiva_jni.dylib + $ ls -latr java-dist/lib + |__ arrow_dataset_jni/ + |__ arrow_orc_jni/ + |__ gandiva_jni/ - To build all JNI libraries (Windows) except the JNI C Data Interface library: @@ -147,8 +146,8 @@ Maven $ cd arrow/java $ mvn generate-resources -Pgenerate-libs-jni-windows -N - $ dir "../java-dist/bin/x86_64" - |__ arrow_dataset_jni.dll + $ dir "../java-dist/bin" + |__ arrow_dataset_jni/ CMake ~~~~~ @@ -166,12 +165,10 @@ CMake -DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF \ -DBUILD_TESTING=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBDIR=lib/ \ -DCMAKE_INSTALL_PREFIX=java-dist $ cmake --build java-cdata --target install --config Release $ ls -latr java-dist/lib - |__ libarrow_cdata_jni.dylib - |__ libarrow_cdata_jni.so + |__ arrow_cdata_jni/ - To build only the JNI C Data Interface library (Windows): @@ -186,11 +183,10 @@ CMake -DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF ^ -DBUILD_TESTING=OFF ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^ -DCMAKE_INSTALL_PREFIX=java-dist $ cmake --build java-cdata --target install --config Release $ dir "java-dist/bin" - |__ arrow_cdata_jni.dll + |__ arrow_cdata_jni/ - To build all JNI libraries (macOS / Linux) except the JNI C Data Interface library: @@ -222,7 +218,6 @@ CMake -DARROW_SUBSTRAIT=ON \ -DARROW_USE_CCACHE=ON \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBDIR=lib/ \ -DCMAKE_INSTALL_PREFIX=java-dist \ -DCMAKE_UNITY_BUILD=ON $ cmake --build cpp-jni --target install --config Release @@ -233,16 +228,15 @@ CMake -DARROW_JAVA_JNI_ENABLE_DEFAULT=ON \ -DBUILD_TESTING=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBDIR=lib/ \ -DCMAKE_INSTALL_PREFIX=java-dist \ -DCMAKE_PREFIX_PATH=$PWD/java-dist \ -DProtobuf_ROOT=$PWD/../cpp-jni/protobuf_ep-install \ -DProtobuf_USE_STATIC_LIBS=ON $ cmake --build java-jni --target install --config Release - $ ls -latr java-dist/lib//*_{jni,java}.* - |__ libarrow_dataset_jni.dylib - |__ libarrow_orc_jni.dylib - |__ libgandiva_jni.dylib + $ ls -latr java-dist/lib/ + |__ arrow_dataset_jni/ + |__ arrow_orc_jni/ + |__ gandiva_jni/ - To build all JNI libraries (Windows) except the JNI C Data Interface library: @@ -271,7 +265,6 @@ CMake -DARROW_WITH_ZLIB=ON ^ -DARROW_WITH_ZSTD=ON ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^ -DCMAKE_INSTALL_PREFIX=java-dist ^ -DCMAKE_UNITY_BUILD=ON ^ -GNinja @@ -288,13 +281,12 @@ CMake -DARROW_JAVA_JNI_ENABLE_ORC=ON ^ -DBUILD_TESTING=OFF ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^ -DCMAKE_INSTALL_PREFIX=java-dist ^ -DCMAKE_PREFIX_PATH=$PWD/java-dist $ cmake --build java-jni --target install --config Release $ dir "java-dist/bin" - |__ arrow_orc_jni.dll - |__ arrow_dataset_jni.dll + |__ arrow_orc_jni/ + |__ arrow_dataset_jni/ Archery ~~~~~~~ @@ -303,11 +295,11 @@ Archery $ cd arrow $ archery docker run java-jni-manylinux-2014 - $ ls -latr java-dist// - |__ libarrow_cdata_jni.so - |__ libarrow_dataset_jni.so - |__ libarrow_orc_jni.so - |__ libgandiva_jni.so + $ ls -latr java-dist + |__ arrow_cdata_jni/ + |__ arrow_dataset_jni/ + |__ arrow_orc_jni/ + |__ gandiva_jni/ Building Java JNI Modules ------------------------- diff --git a/docs/source/java/install.rst b/docs/source/java/install.rst index b7484536f2367..783687fb1f773 100644 --- a/docs/source/java/install.rst +++ b/docs/source/java/install.rst @@ -43,7 +43,40 @@ adding ``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED $ env _JAVA_OPTIONS="--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java -jar ... Otherwise, you may see errors like ``module java.base does not "opens -java.nio" to unnamed module``. +java.nio" to unnamed module`` or ``module java.base does not "opens +java.nio" to org.apache.arrow.memory.core`` + +Note that the command has changed from Arrow 15 and earlier. If you are still using the flags from that version +(``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED``) you will see the +``module java.base does not "opens java.nio" to org.apache.arrow.memory.core`` error. + +If you are using flight-core or dependent modules, you will need to mark that flight-core can read unnamed modules. +Modifying the command above for Flight: + +.. code-block:: shell + + # Directly on the command line + $ java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -jar ... + # Indirectly via environment variables + $ env _JAVA_OPTIONS="--add-reads=org.apache.arrow.flight.core=ALL-UNNAMED --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java -jar ... + +Otherwise, you may see errors like ``java.lang.IllegalAccessError: superclass access check failed: class +org.apache.arrow.flight.ArrowMessage$ArrowBufRetainingCompositeByteBuf (in module org.apache.arrow.flight.core) +cannot access class io.netty.buffer.CompositeByteBuf (in unnamed module ...) because module +org.apache.arrow.flight.core does not read unnamed module ... + +Finally, if you are using arrow-dataset, you'll also need to report that JDK internals need to be exposed. +Modifying the command above for arrow-memory: +.. code-block:: shell + + # Directly on the command line + $ java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -jar ... + # Indirectly via environment variables + $ env _JAVA_OPTIONS="--add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED" java -jar ... + +Otherwise you may see errors such as ``java.lang.RuntimeException: java.lang.reflect.InaccessibleObjectException: +Unable to make static void java.nio.Bits.reserveMemory(long,long) accessible: module +java.base does not "opens java.nio" to module org.apache.arrow.dataset`` If using Maven and Surefire for unit testing, :ref:`this argument must be added to Surefire as well `. diff --git a/docs/source/java/overview.rst b/docs/source/java/overview.rst index 4b30b8e000f12..9d9cbad8a26c1 100644 --- a/docs/source/java/overview.rst +++ b/docs/source/java/overview.rst @@ -56,9 +56,6 @@ but some modules are JNI bindings to the C++ library. * - flight-core - (Experimental) An RPC mechanism for transferring ValueVectors. - Native - * - flight-grpc - - (Experimental) Contains utility class to expose Flight gRPC service and client. - - Native * - flight-sql - (Experimental) Contains utility classes to expose Flight SQL semantics for clients and servers over Arrow Flight. - Native diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 04fa51ff98ca0..8b29f37d80a1b 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -74,6 +74,23 @@ if(BUILD_TESTING) GTest::gtest_main) endif() +# The ARROW_JAVA_JNI_ARCH_DIR will automatically be derived the normalized +# operating system from system processor. The user can override this variable +# if auto-detection fails. +if("${ARROW_JAVA_JNI_ARCH_DIR}" STREQUAL "") + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") + set(ARROW_JAVA_JNI_ARCH_DIR "aarch_64") + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386") + set(ARROW_JAVA_JNI_ARCH_DIR "x86_64") + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") + set(ARROW_JAVA_JNI_ARCH_DIR "aarch_64") + elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") + set(ARROW_JAVA_JNI_ARCH_DIR "x86_64") + else() + set(ARROW_JAVA_JNI_ARCH_DIR "${CMAKE_SYSTEM_PROCESSOR}") + endif() +endif() + if(ARROW_JAVA_JNI_ENABLE_C) add_subdirectory(c) endif() diff --git a/java/adapter/avro/pom.xml b/java/adapter/avro/pom.xml index c0410ea4c2314..90864eab006a2 100644 --- a/java/adapter/avro/pom.xml +++ b/java/adapter/avro/pom.xml @@ -46,6 +46,11 @@ arrow-vector + + org.immutables + value + + org.apache.avro avro diff --git a/java/adapter/avro/src/main/java/module-info.java b/java/adapter/avro/src/main/java/module-info.java new file mode 100644 index 0000000000000..5c6204be60e9c --- /dev/null +++ b/java/adapter/avro/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.adapter.avro { + exports org.apache.arrow.adapter.avro.consumers; + exports org.apache.arrow.adapter.avro.consumers.logical; + exports org.apache.arrow.adapter.avro; + + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.apache.avro; +} diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrow.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrow.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrow.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrow.java index 33f180393780e..8baa60a72ddc3 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrow.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrow.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfig.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfig.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfig.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfig.java index 4f59ef3843dda..f9210fb012523 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfig.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import java.util.Set; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfigBuilder.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfigBuilder.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfigBuilder.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfigBuilder.java index 474c1eb5ca7c2..41e486d0a1ce0 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowConfigBuilder.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowConfigBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import java.util.HashSet; import java.util.Set; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowUtils.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowUtils.java similarity index 95% rename from java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowUtils.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowUtils.java index 80293c8b85c8b..1f5ad9e768950 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowUtils.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.apache.arrow.vector.types.FloatingPointPrecision.DOUBLE; import static org.apache.arrow.vector.types.FloatingPointPrecision.SINGLE; @@ -31,30 +31,30 @@ import java.util.Set; import java.util.stream.Collectors; -import org.apache.arrow.consumers.AvroArraysConsumer; -import org.apache.arrow.consumers.AvroBooleanConsumer; -import org.apache.arrow.consumers.AvroBytesConsumer; -import org.apache.arrow.consumers.AvroDoubleConsumer; -import org.apache.arrow.consumers.AvroEnumConsumer; -import org.apache.arrow.consumers.AvroFixedConsumer; -import org.apache.arrow.consumers.AvroFloatConsumer; -import org.apache.arrow.consumers.AvroIntConsumer; -import org.apache.arrow.consumers.AvroLongConsumer; -import org.apache.arrow.consumers.AvroMapConsumer; -import org.apache.arrow.consumers.AvroNullConsumer; -import org.apache.arrow.consumers.AvroStringConsumer; -import org.apache.arrow.consumers.AvroStructConsumer; -import org.apache.arrow.consumers.AvroUnionsConsumer; -import org.apache.arrow.consumers.CompositeAvroConsumer; -import org.apache.arrow.consumers.Consumer; -import org.apache.arrow.consumers.SkipConsumer; -import org.apache.arrow.consumers.SkipFunction; -import org.apache.arrow.consumers.logical.AvroDateConsumer; -import org.apache.arrow.consumers.logical.AvroDecimalConsumer; -import org.apache.arrow.consumers.logical.AvroTimeMicroConsumer; -import org.apache.arrow.consumers.logical.AvroTimeMillisConsumer; -import org.apache.arrow.consumers.logical.AvroTimestampMicrosConsumer; -import org.apache.arrow.consumers.logical.AvroTimestampMillisConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroArraysConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroBooleanConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroBytesConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroDoubleConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroEnumConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroFixedConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroFloatConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroIntConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroLongConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroMapConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroNullConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroStringConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroStructConsumer; +import org.apache.arrow.adapter.avro.consumers.AvroUnionsConsumer; +import org.apache.arrow.adapter.avro.consumers.CompositeAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.Consumer; +import org.apache.arrow.adapter.avro.consumers.SkipConsumer; +import org.apache.arrow.adapter.avro.consumers.SkipFunction; +import org.apache.arrow.adapter.avro.consumers.logical.AvroDateConsumer; +import org.apache.arrow.adapter.avro.consumers.logical.AvroDecimalConsumer; +import org.apache.arrow.adapter.avro.consumers.logical.AvroTimeMicroConsumer; +import org.apache.arrow.adapter.avro.consumers.logical.AvroTimeMillisConsumer; +import org.apache.arrow.adapter.avro.consumers.logical.AvroTimestampMicrosConsumer; +import org.apache.arrow.adapter.avro.consumers.logical.AvroTimestampMillisConsumer; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.util.Preconditions; import org.apache.arrow.vector.BaseIntVector; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowVectorIterator.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowVectorIterator.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowVectorIterator.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowVectorIterator.java index 1faa7595c68b0..4a439ade81181 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/AvroToArrowVectorIterator.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/AvroToArrowVectorIterator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import java.io.EOFException; import java.util.ArrayList; @@ -23,7 +23,7 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.arrow.consumers.CompositeAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.CompositeAvroConsumer; import org.apache.arrow.util.Preconditions; import org.apache.arrow.vector.FieldVector; import org.apache.arrow.vector.VectorSchemaRoot; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroArraysConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroArraysConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroArraysConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroArraysConsumer.java index b9d0f84cfde4e..fd25986c32b95 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroArraysConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroArraysConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBooleanConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBooleanConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBooleanConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBooleanConsumer.java index 4ca5f24451f90..bf41828d19f7a 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBooleanConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBooleanConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBytesConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBytesConsumer.java index eede68ebd39dc..c8370e480608d 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroBytesConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroBytesConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroDoubleConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroDoubleConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroDoubleConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroDoubleConsumer.java index 356707a140b0a..7cc7dd33b15a9 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroDoubleConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroDoubleConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroEnumConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroEnumConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroEnumConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroEnumConsumer.java index 2f4443b741785..32a2c85f6fc50 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroEnumConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroEnumConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFixedConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFixedConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFixedConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFixedConsumer.java index a065466e395cf..16b70898fd36a 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFixedConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFixedConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFloatConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFloatConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFloatConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFloatConsumer.java index c8de4a21af448..b09d2881875b6 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroFloatConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroFloatConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroIntConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroIntConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroIntConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroIntConsumer.java index bc8d4de78abc3..ae5a2719c5642 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroIntConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroIntConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroLongConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroLongConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroLongConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroLongConsumer.java index b9016c58f05c8..4db836acc4586 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroLongConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroLongConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroMapConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroMapConsumer.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroMapConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroMapConsumer.java index b8e8bd585eef3..1ea97e63b61e5 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroMapConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroMapConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroNullConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroNullConsumer.java similarity index 96% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroNullConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroNullConsumer.java index 64768008a9571..4c7bb8c03bad3 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroNullConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroNullConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStringConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStringConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStringConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStringConsumer.java index 10fe234ac6cb8..072270aa6c081 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStringConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStringConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStructConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStructConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStructConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStructConsumer.java index 792d01ee502c3..a02b1577f9fa8 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroStructConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroStructConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroUnionsConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroUnionsConsumer.java similarity index 98% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroUnionsConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroUnionsConsumer.java index c0bb0200fcd71..76287543b0646 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/AvroUnionsConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/AvroUnionsConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/BaseAvroConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/BaseAvroConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/BaseAvroConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/BaseAvroConsumer.java index 303be8e504f54..66a6cda68401e 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/BaseAvroConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/BaseAvroConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import org.apache.arrow.vector.FieldVector; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/CompositeAvroConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/CompositeAvroConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/CompositeAvroConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/CompositeAvroConsumer.java index af476d27cb8f7..97812226180ac 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/CompositeAvroConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/CompositeAvroConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; import java.util.List; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/Consumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/Consumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/Consumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/Consumer.java index 8c4ee9a96e004..c2ae1ce77b282 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/Consumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/Consumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipConsumer.java similarity index 97% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipConsumer.java index 94c5b339d87f3..1ac0a6d71557b 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipConsumer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipFunction.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipFunction.java similarity index 95% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipFunction.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipFunction.java index 61938916a5eca..93fc4a7fede3f 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/SkipFunction.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/SkipFunction.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.consumers; +package org.apache.arrow.adapter.avro.consumers; import java.io.IOException; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDateConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDateConsumer.java similarity index 91% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDateConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDateConsumer.java index 3aa8970d9a97f..a5c36d88fb76a 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDateConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDateConsumer.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.vector.DateDayVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDecimalConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDecimalConsumer.java similarity index 95% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDecimalConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDecimalConsumer.java index 24d73cf829ffc..ebe5ca3884e5e 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroDecimalConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroDecimalConsumer.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; import java.nio.ByteBuffer; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.util.Preconditions; import org.apache.arrow.vector.DecimalVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMicroConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMicroConsumer.java similarity index 91% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMicroConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMicroConsumer.java index e68ba158ffaf3..89216d4ad1436 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMicroConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMicroConsumer.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.vector.TimeMicroVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMillisConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMillisConsumer.java similarity index 91% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMillisConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMillisConsumer.java index f76186fc3785a..ab5df8d4bc8ac 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimeMillisConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimeMillisConsumer.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.vector.TimeMilliVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMicrosConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMicrosConsumer.java similarity index 92% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMicrosConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMicrosConsumer.java index 82da0e8054b50..93b39d479ff0e 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMicrosConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMicrosConsumer.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.vector.TimeStampMicroVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMillisConsumer.java b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMillisConsumer.java similarity index 92% rename from java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMillisConsumer.java rename to java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMillisConsumer.java index 159f49e1480a6..9e651c3959f81 100644 --- a/java/adapter/avro/src/main/java/org/apache/arrow/consumers/logical/AvroTimestampMillisConsumer.java +++ b/java/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/consumers/logical/AvroTimestampMillisConsumer.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.arrow.consumers.logical; +package org.apache.arrow.adapter.avro.consumers.logical; import java.io.IOException; -import org.apache.arrow.consumers.BaseAvroConsumer; +import org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer; import org.apache.arrow.vector.TimeStampMilliVector; import org.apache.avro.io.Decoder; diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/AvroLogicalTypesTest.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java similarity index 99% rename from java/adapter/avro/src/test/java/org/apache/arrow/AvroLogicalTypesTest.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java index 050a50ddaeae4..6ee04e33a5ce1 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/AvroLogicalTypesTest.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static junit.framework.TestCase.assertNull; import static junit.framework.TestCase.assertTrue; diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/AvroSkipFieldTest.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroSkipFieldTest.java similarity index 99% rename from java/adapter/avro/src/test/java/org/apache/arrow/AvroSkipFieldTest.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroSkipFieldTest.java index b946dbd8653fd..a37eca6514e04 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/AvroSkipFieldTest.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroSkipFieldTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.junit.Assert.assertEquals; diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/AvroTestBase.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroTestBase.java similarity index 88% rename from java/adapter/avro/src/test/java/org/apache/arrow/AvroTestBase.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroTestBase.java index 16d8e52722c44..60a3a285db3aa 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/AvroTestBase.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroTestBase.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -24,9 +24,9 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.InputStream; +import java.lang.reflect.Method; import java.nio.ByteBuffer; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; @@ -62,11 +62,23 @@ public void init() { config = new AvroToArrowConfigBuilder(allocator).build(); } - protected Schema getSchema(String schemaName) throws Exception { - Path schemaPath = Paths.get(Paths.get(TestWriteReadAvroRecord.class.getResource("/").toURI()).toString(), - "schema", schemaName); - - return new Schema.Parser().parse(schemaPath.toFile()); + public static Schema getSchema(String schemaName) throws Exception { + try { + // Attempt to use JDK 9 behavior of getting the module then the resource stream from the module. + // Note that this code is caller-sensitive. + Method getModuleMethod = Class.class.getMethod("getModule"); + Object module = getModuleMethod.invoke(TestWriteReadAvroRecord.class); + Method getResourceAsStreamFromModule = module.getClass().getMethod("getResourceAsStream", String.class); + try (InputStream is = (InputStream) getResourceAsStreamFromModule.invoke(module, "/schema/" + schemaName)) { + return new Schema.Parser() + .parse(is); + } + } catch (NoSuchMethodException ex) { + // Use JDK8 behavior. + try (InputStream is = TestWriteReadAvroRecord.class.getResourceAsStream("/schema/" + schemaName)) { + return new Schema.Parser().parse(is); + } + } } protected VectorSchemaRoot writeAndRead(Schema schema, List data) throws Exception { diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowIteratorTest.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowIteratorTest.java similarity index 99% rename from java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowIteratorTest.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowIteratorTest.java index 2b05a19f38067..02f7a3733734c 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowIteratorTest.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowIteratorTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.junit.Assert.assertEquals; diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowTest.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowTest.java similarity index 99% rename from java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowTest.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowTest.java index c007e1ac7ebd2..1c64204191762 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/AvroToArrowTest.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroToArrowTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.junit.Assert.assertEquals; diff --git a/java/adapter/avro/src/test/java/org/apache/arrow/TestWriteReadAvroRecord.java b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/TestWriteReadAvroRecord.java similarity index 91% rename from java/adapter/avro/src/test/java/org/apache/arrow/TestWriteReadAvroRecord.java rename to java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/TestWriteReadAvroRecord.java index 0a153a28cbc2e..afbddaa6ed87a 100644 --- a/java/adapter/avro/src/test/java/org/apache/arrow/TestWriteReadAvroRecord.java +++ b/java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/TestWriteReadAvroRecord.java @@ -15,13 +15,11 @@ * limitations under the License. */ -package org.apache.arrow; +package org.apache.arrow.adapter.avro; import static org.junit.Assert.assertEquals; import java.io.File; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; @@ -48,10 +46,7 @@ public class TestWriteReadAvroRecord { public void testWriteAndRead() throws Exception { File dataFile = TMP.newFile(); - Path schemaPath = Paths.get( - Paths.get(TestWriteReadAvroRecord.class.getResource("/").toURI()).toString(), - "schema", "test.avsc"); - Schema schema = new Schema.Parser().parse(schemaPath.toFile()); + Schema schema = AvroTestBase.getSchema("test.avsc"); //write data to disk GenericRecord user1 = new GenericData.Record(schema); diff --git a/java/adapter/jdbc/pom.xml b/java/adapter/jdbc/pom.xml index f95956d1f61d5..e964aa1871a0e 100644 --- a/java/adapter/jdbc/pom.xml +++ b/java/adapter/jdbc/pom.xml @@ -47,6 +47,11 @@ ${arrow.vector.classifier} + + org.immutables + value + + com.h2database @@ -85,4 +90,27 @@ + + + jdk11+ + + [11,] + + !m2e.version + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-reads=org.apache.arrow.adapter.jdbc=com.fasterxml.jackson.dataformat.yaml --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + + + + + + diff --git a/java/adapter/jdbc/src/main/java/module-info.java b/java/adapter/jdbc/src/main/java/module-info.java new file mode 100644 index 0000000000000..5b59ce768472a --- /dev/null +++ b/java/adapter/jdbc/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.adapter.jdbc { + exports org.apache.arrow.adapter.jdbc.consumer; + exports org.apache.arrow.adapter.jdbc; + exports org.apache.arrow.adapter.jdbc.binder; + + requires com.fasterxml.jackson.databind; + requires java.sql; + requires jdk.unsupported; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; +} diff --git a/java/adapter/orc/CMakeLists.txt b/java/adapter/orc/CMakeLists.txt index a9b3a48027937..d29856ff8cd5e 100644 --- a/java/adapter/orc/CMakeLists.txt +++ b/java/adapter/orc/CMakeLists.txt @@ -37,6 +37,11 @@ set_property(TARGET arrow_java_jni_orc PROPERTY OUTPUT_NAME "arrow_orc_jni") target_link_libraries(arrow_java_jni_orc arrow_java_jni_orc_headers jni Arrow::arrow_static) +set(ARROW_JAVA_JNI_ORC_LIBDIR + "${CMAKE_INSTALL_PREFIX}/lib/arrow_orc_jni/${ARROW_JAVA_JNI_ARCH_DIR}") +set(ARROW_JAVA_JNI_ORC_BINDIR + "${CMAKE_INSTALL_PREFIX}/bin/arrow_orc_jni/${ARROW_JAVA_JNI_ARCH_DIR}") + install(TARGETS arrow_java_jni_orc - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + LIBRARY DESTINATION ${ARROW_JAVA_JNI_ORC_LIBDIR} + RUNTIME DESTINATION ${ARROW_JAVA_JNI_ORC_BINDIR}) diff --git a/java/adapter/orc/pom.xml b/java/adapter/orc/pom.xml index a42a458e2072a..605b9871639ea 100644 --- a/java/adapter/orc/pom.xml +++ b/java/adapter/orc/pom.xml @@ -31,6 +31,10 @@ compile ${arrow.vector.classifier} + + org.immutables + value + org.apache.orc orc-core diff --git a/java/adapter/orc/src/main/java/module-info.java b/java/adapter/orc/src/main/java/module-info.java new file mode 100644 index 0000000000000..d18a978e93fa8 --- /dev/null +++ b/java/adapter/orc/src/main/java/module-info.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +open module org.apache.arrow.adapter.orc { + exports org.apache.arrow.adapter.orc; + + requires hadoop.client.api; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; +} diff --git a/java/adapter/orc/src/main/java/org/apache/arrow/adapter/orc/OrcJniUtils.java b/java/adapter/orc/src/main/java/org/apache/arrow/adapter/orc/OrcJniUtils.java index 2701c228709c2..9b599234bdf51 100644 --- a/java/adapter/orc/src/main/java/org/apache/arrow/adapter/orc/OrcJniUtils.java +++ b/java/adapter/orc/src/main/java/org/apache/arrow/adapter/orc/OrcJniUtils.java @@ -39,7 +39,7 @@ static void loadOrcAdapterLibraryFromJar() synchronized (OrcJniUtils.class) { if (!isLoaded) { final String libraryToLoad = - getNormalizedArch() + "/" + System.mapLibraryName(LIBRARY_NAME); + LIBRARY_NAME + "/" + getNormalizedArch() + "/" + System.mapLibraryName(LIBRARY_NAME); final File libraryFile = moveFileFromJarToTemp(System.getProperty("java.io.tmpdir"), libraryToLoad, LIBRARY_NAME); System.load(libraryFile.getAbsolutePath()); diff --git a/java/algorithm/pom.xml b/java/algorithm/pom.xml index 3e32d955ec417..99740f2002847 100644 --- a/java/algorithm/pom.xml +++ b/java/algorithm/pom.xml @@ -42,6 +42,10 @@ arrow-memory-netty test + + org.immutables + value + diff --git a/java/algorithm/src/main/java/module-info.java b/java/algorithm/src/main/java/module-info.java new file mode 100644 index 0000000000000..b347f55aa4d00 --- /dev/null +++ b/java/algorithm/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.algorithm { + exports org.apache.arrow.algorithm.search; + exports org.apache.arrow.algorithm.deduplicate; + exports org.apache.arrow.algorithm.dictionary; + exports org.apache.arrow.algorithm.rank; + exports org.apache.arrow.algorithm.misc; + exports org.apache.arrow.algorithm.sort; + + requires jdk.unsupported; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; +} diff --git a/java/bom/pom.xml b/java/bom/pom.xml index 5c2ed33dadddf..7ffb833e7f6d7 100644 --- a/java/bom/pom.xml +++ b/java/bom/pom.xml @@ -82,11 +82,6 @@ flight-core ${project.version} - - org.apache.arrow - flight-grpc - ${project.version} - org.apache.arrow flight-integration-tests diff --git a/java/c/CMakeLists.txt b/java/c/CMakeLists.txt index 8ff208aaeb010..83909c5e13e1b 100644 --- a/java/c/CMakeLists.txt +++ b/java/c/CMakeLists.txt @@ -30,6 +30,11 @@ add_library(arrow_java_jni_cdata SHARED src/main/cpp/jni_wrapper.cc) set_property(TARGET arrow_java_jni_cdata PROPERTY OUTPUT_NAME "arrow_cdata_jni") target_link_libraries(arrow_java_jni_cdata arrow_java_jni_cdata_headers jni) +set(ARROW_JAVA_JNI_C_LIBDIR + "${CMAKE_INSTALL_PREFIX}/lib/arrow_cdata_jni/${ARROW_JAVA_JNI_ARCH_DIR}") +set(ARROW_JAVA_JNI_C_BINDIR + "${CMAKE_INSTALL_PREFIX}/bin/arrow_cdata_jni/${ARROW_JAVA_JNI_ARCH_DIR}") + install(TARGETS arrow_java_jni_cdata - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + LIBRARY DESTINATION ${ARROW_JAVA_JNI_C_LIBDIR} + RUNTIME DESTINATION ${ARROW_JAVA_JNI_C_BINDIR}) diff --git a/java/c/pom.xml b/java/c/pom.xml index 8fc3f36994d8a..a999292979d56 100644 --- a/java/c/pom.xml +++ b/java/c/pom.xml @@ -48,6 +48,10 @@ org.slf4j slf4j-api + + org.immutables + value + org.apache.arrow arrow-memory-unsafe diff --git a/java/c/src/main/java/module-info.java b/java/c/src/main/java/module-info.java new file mode 100644 index 0000000000000..0a62c9b9875b4 --- /dev/null +++ b/java/c/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +open module org.apache.arrow.c { + exports org.apache.arrow.c; + exports org.apache.arrow.c.jni; + + requires flatbuffers.java; + requires jdk.unsupported; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.slf4j; +} diff --git a/java/c/src/main/java/org/apache/arrow/c/Data.java b/java/c/src/main/java/org/apache/arrow/c/Data.java index a92853b3504f0..c90ce7604d6e7 100644 --- a/java/c/src/main/java/org/apache/arrow/c/Data.java +++ b/java/c/src/main/java/org/apache/arrow/c/Data.java @@ -19,8 +19,6 @@ import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.vector.FieldVector; -import org.apache.arrow.vector.StructVectorLoader; -import org.apache.arrow.vector.StructVectorUnloader; import org.apache.arrow.vector.VectorLoader; import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.VectorUnloader; diff --git a/java/c/src/main/java/org/apache/arrow/vector/StructVectorLoader.java b/java/c/src/main/java/org/apache/arrow/c/StructVectorLoader.java similarity index 98% rename from java/c/src/main/java/org/apache/arrow/vector/StructVectorLoader.java rename to java/c/src/main/java/org/apache/arrow/c/StructVectorLoader.java index 4a62be7851ac7..d9afd0189d807 100644 --- a/java/c/src/main/java/org/apache/arrow/vector/StructVectorLoader.java +++ b/java/c/src/main/java/org/apache/arrow/c/StructVectorLoader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.vector; +package org.apache.arrow.c; import static org.apache.arrow.util.Preconditions.checkArgument; @@ -27,6 +27,8 @@ import org.apache.arrow.memory.ArrowBuf; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.util.Collections2; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.TypeLayout; import org.apache.arrow.vector.complex.StructVector; import org.apache.arrow.vector.compression.CompressionCodec; import org.apache.arrow.vector.compression.CompressionUtil; diff --git a/java/c/src/main/java/org/apache/arrow/vector/StructVectorUnloader.java b/java/c/src/main/java/org/apache/arrow/c/StructVectorUnloader.java similarity index 97% rename from java/c/src/main/java/org/apache/arrow/vector/StructVectorUnloader.java rename to java/c/src/main/java/org/apache/arrow/c/StructVectorUnloader.java index e75156cf237bb..aa6d9b4d0f6a7 100644 --- a/java/c/src/main/java/org/apache/arrow/vector/StructVectorUnloader.java +++ b/java/c/src/main/java/org/apache/arrow/c/StructVectorUnloader.java @@ -15,12 +15,14 @@ * limitations under the License. */ -package org.apache.arrow.vector; +package org.apache.arrow.c; import java.util.ArrayList; import java.util.List; import org.apache.arrow.memory.ArrowBuf; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.TypeLayout; import org.apache.arrow.vector.complex.StructVector; import org.apache.arrow.vector.compression.CompressionCodec; import org.apache.arrow.vector.compression.CompressionUtil; diff --git a/java/c/src/main/java/org/apache/arrow/c/jni/JniLoader.java b/java/c/src/main/java/org/apache/arrow/c/jni/JniLoader.java index e435461349257..ef9f432cf0036 100644 --- a/java/c/src/main/java/org/apache/arrow/c/jni/JniLoader.java +++ b/java/c/src/main/java/org/apache/arrow/c/jni/JniLoader.java @@ -80,7 +80,7 @@ private synchronized void loadRemaining() { private void load(String name) { final String libraryToLoad = - getNormalizedArch() + "/" + System.mapLibraryName(name); + name + "/" + getNormalizedArch() + "/" + System.mapLibraryName(name); try { File temp = File.createTempFile("jnilib-", ".tmp", new File(System.getProperty("java.io.tmpdir"))); temp.deleteOnExit(); diff --git a/java/compression/pom.xml b/java/compression/pom.xml index 9a9f029fee137..e8008c9754374 100644 --- a/java/compression/pom.xml +++ b/java/compression/pom.xml @@ -35,6 +35,10 @@ arrow-memory-unsafe test + + org.immutables + value + org.apache.commons commons-compress diff --git a/java/compression/src/main/java/module-info.java b/java/compression/src/main/java/module-info.java new file mode 100644 index 0000000000000..6bf989e4c142e --- /dev/null +++ b/java/compression/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.compression { + exports org.apache.arrow.compression; + + requires com.github.luben.zstd_jni; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.apache.commons.compress; +} diff --git a/java/dataset/CMakeLists.txt b/java/dataset/CMakeLists.txt index ede3ee7330d21..348850c3be5da 100644 --- a/java/dataset/CMakeLists.txt +++ b/java/dataset/CMakeLists.txt @@ -47,6 +47,12 @@ if(BUILD_TESTING) add_test(NAME arrow-java-jni-dataset-test COMMAND arrow-java-jni-dataset-test) endif() +set(ARROW_JAVA_JNI_DATASET_LIBDIR + "${CMAKE_INSTALL_PREFIX}/lib/arrow_dataset_jni/${ARROW_JAVA_JNI_ARCH_DIR}") + +set(ARROW_JAVA_JNI_DATASET_BINDIR + "${CMAKE_INSTALL_PREFIX}/bin/arrow_dataset_jni/${ARROW_JAVA_JNI_ARCH_DIR}") + install(TARGETS arrow_java_jni_dataset - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + LIBRARY DESTINATION ${ARROW_JAVA_JNI_DATASET_LIBDIR} + RUNTIME DESTINATION ${ARROW_JAVA_JNI_DATASET_BINDIR}) diff --git a/java/dataset/pom.xml b/java/dataset/pom.xml index bb5636b745490..a18f443b7e15a 100644 --- a/java/dataset/pom.xml +++ b/java/dataset/pom.xml @@ -47,6 +47,10 @@ arrow-c-data compile + + org.immutables + value + org.apache.arrow arrow-memory-netty @@ -161,6 +165,15 @@ + + maven-surefire-plugin + + false + + ${project.basedir}/../../testing/data + + + org.xolstice.maven.plugins protobuf-maven-plugin @@ -182,4 +195,30 @@ + + + jdk11+ + + [11,] + + !m2e.version + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + ${project.basedir}/../../testing/data + + --add-reads=org.apache.arrow.dataset=com.fasterxml.jackson.databind --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + + + + + diff --git a/java/dataset/src/main/java/module-info.java b/java/dataset/src/main/java/module-info.java new file mode 100644 index 0000000000000..1672d12ffec69 --- /dev/null +++ b/java/dataset/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +open module org.apache.arrow.dataset { + exports org.apache.arrow.dataset.file; + exports org.apache.arrow.dataset.source; + exports org.apache.arrow.dataset.jni; + exports org.apache.arrow.dataset.substrait; + exports org.apache.arrow.dataset.scanner; + + requires org.apache.arrow.c; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; +} diff --git a/java/dataset/src/main/java/org/apache/arrow/dataset/jni/DirectReservationListener.java b/java/dataset/src/main/java/org/apache/arrow/dataset/jni/DirectReservationListener.java index eb26400cbf882..3922e90335da4 100644 --- a/java/dataset/src/main/java/org/apache/arrow/dataset/jni/DirectReservationListener.java +++ b/java/dataset/src/main/java/org/apache/arrow/dataset/jni/DirectReservationListener.java @@ -40,7 +40,12 @@ private DirectReservationListener() { methodUnreserve = this.getDeclaredMethodBaseOnJDKVersion(classBits, "unreserveMemory"); methodUnreserve.setAccessible(true); } catch (Exception e) { - throw new RuntimeException(e); + final RuntimeException failure = new RuntimeException( + "Failed to initialize DirectReservationListener. When starting Java you must include " + + "`--add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED` " + + "(See https://arrow.apache.org/docs/java/install.html)", e); + failure.printStackTrace(); + throw failure; } } diff --git a/java/dataset/src/main/java/org/apache/arrow/dataset/jni/JniLoader.java b/java/dataset/src/main/java/org/apache/arrow/dataset/jni/JniLoader.java index a3b31c73e8540..cf2f8fe29e8ba 100644 --- a/java/dataset/src/main/java/org/apache/arrow/dataset/jni/JniLoader.java +++ b/java/dataset/src/main/java/org/apache/arrow/dataset/jni/JniLoader.java @@ -79,7 +79,7 @@ private synchronized void loadRemaining() { private void load(String name) { final String libraryToLoad = - getNormalizedArch() + "/" + System.mapLibraryName(name); + name + "/" + getNormalizedArch() + "/" + System.mapLibraryName(name); try { File temp = File.createTempFile("jnilib-", ".tmp", new File(System.getProperty("java.io.tmpdir"))); temp.deleteOnExit(); diff --git a/java/dataset/src/test/java/org/apache/arrow/dataset/ParquetWriteSupport.java b/java/dataset/src/test/java/org/apache/arrow/dataset/ParquetWriteSupport.java index 75f905877cd1f..2352a65e8fb62 100644 --- a/java/dataset/src/test/java/org/apache/arrow/dataset/ParquetWriteSupport.java +++ b/java/dataset/src/test/java/org/apache/arrow/dataset/ParquetWriteSupport.java @@ -18,8 +18,8 @@ package org.apache.arrow.dataset; import java.io.File; -import java.nio.file.Path; -import java.nio.file.Paths; +import java.io.InputStream; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -47,7 +47,7 @@ public class ParquetWriteSupport implements AutoCloseable { public ParquetWriteSupport(String schemaName, File outputFolder) throws Exception { - avroSchema = readSchemaFromFile(schemaName); + avroSchema = getSchema(schemaName); path = outputFolder.getPath() + "/" + "generated-" + random.nextLong() + ".parquet"; uri = "file://" + path; writer = AvroParquetWriter @@ -56,10 +56,23 @@ public ParquetWriteSupport(String schemaName, File outputFolder) throws Exceptio .build(); } - private static Schema readSchemaFromFile(String schemaName) throws Exception { - Path schemaPath = Paths.get(ParquetWriteSupport.class.getResource("/").getPath(), - "avroschema", schemaName); - return new org.apache.avro.Schema.Parser().parse(schemaPath.toFile()); + public static Schema getSchema(String schemaName) throws Exception { + try { + // Attempt to use JDK 9 behavior of getting the module then the resource stream from the module. + // Note that this code is caller-sensitive. + Method getModuleMethod = Class.class.getMethod("getModule"); + Object module = getModuleMethod.invoke(ParquetWriteSupport.class); + Method getResourceAsStreamFromModule = module.getClass().getMethod("getResourceAsStream", String.class); + try (InputStream is = (InputStream) getResourceAsStreamFromModule.invoke(module, "/avroschema/" + schemaName)) { + return new Schema.Parser() + .parse(is); + } + } catch (NoSuchMethodException ex) { + // Use JDK8 behavior. + try (InputStream is = ParquetWriteSupport.class.getResourceAsStream("/avroschema/" + schemaName)) { + return new Schema.Parser().parse(is); + } + } } public static ParquetWriteSupport writeTempFile(String schemaName, File outputFolder, diff --git a/java/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java b/java/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java index 5293aca0c329b..13b247452348d 100644 --- a/java/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java +++ b/java/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java @@ -68,6 +68,7 @@ import org.apache.arrow.vector.complex.impl.UnionListWriter; import org.apache.arrow.vector.ipc.ArrowStreamReader; import org.apache.arrow.vector.ipc.ArrowStreamWriter; +import org.apache.arrow.vector.test.util.ArrowTestDataUtil; import org.apache.arrow.vector.types.DateUnit; import org.apache.arrow.vector.types.FloatingPointPrecision; import org.apache.arrow.vector.types.TimeUnit; @@ -75,7 +76,6 @@ import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.FieldType; import org.apache.arrow.vector.types.pojo.Schema; -import org.apache.arrow.vector.util.ArrowTestDataUtil; import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel; import org.apache.arrow.vector.util.Text; import org.junit.ClassRule; diff --git a/java/flight/flight-core/pom.xml b/java/flight/flight-core/pom.xml index 8f41d2b65b7d1..ec3034d14e271 100644 --- a/java/flight/flight-core/pom.xml +++ b/java/flight/flight-core/pom.xml @@ -95,6 +95,11 @@ grpc-services test + + io.grpc + grpc-inprocess + test + com.fasterxml.jackson.core @@ -108,6 +113,10 @@ javax.annotation javax.annotation-api + + org.immutables + value + com.google.api.grpc @@ -305,4 +314,32 @@ + + + + jdk11+ + + [11,] + + !m2e.version + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + false + + ${project.basedir}/../../../testing/data + + + + + + + + diff --git a/java/flight/flight-core/src/main/java/module-info.java b/java/flight/flight-core/src/main/java/module-info.java new file mode 100644 index 0000000000000..f6bf5b73b0972 --- /dev/null +++ b/java/flight/flight-core/src/main/java/module-info.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.flight.core { + exports org.apache.arrow.flight; + exports org.apache.arrow.flight.auth; + exports org.apache.arrow.flight.auth2; + exports org.apache.arrow.flight.client; + exports org.apache.arrow.flight.impl; + exports org.apache.arrow.flight.sql.impl; + + requires com.fasterxml.jackson.databind; + requires com.google.common; + requires com.google.errorprone.annotations; + requires io.grpc; + requires io.grpc.internal; + requires io.grpc.netty; + requires io.grpc.protobuf; + requires io.grpc.stub; + requires io.netty.common; + requires io.netty.handler; + requires io.netty.transport; + requires org.apache.arrow.format; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires protobuf.java; + requires org.slf4j; +} diff --git a/java/flight/flight-grpc/src/main/java/org/apache/arrow/flight/FlightGrpcUtils.java b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightGrpcUtils.java similarity index 100% rename from java/flight/flight-grpc/src/main/java/org/apache/arrow/flight/FlightGrpcUtils.java rename to java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightGrpcUtils.java diff --git a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java index f9def74b56d1b..11510dbd32058 100644 --- a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java +++ b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/FlightTestUtil.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Random; -import org.apache.arrow.vector.util.ArrowTestDataUtil; +import org.apache.arrow.vector.test.util.ArrowTestDataUtil; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.function.Executable; diff --git a/java/flight/flight-grpc/src/test/java/org/apache/arrow/flight/TestFlightGrpcUtils.java b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightGrpcUtils.java similarity index 100% rename from java/flight/flight-grpc/src/test/java/org/apache/arrow/flight/TestFlightGrpcUtils.java rename to java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestFlightGrpcUtils.java diff --git a/java/flight/flight-grpc/src/test/protobuf/test.proto b/java/flight/flight-core/src/test/protobuf/test.proto similarity index 100% rename from java/flight/flight-grpc/src/test/protobuf/test.proto rename to java/flight/flight-core/src/test/protobuf/test.proto diff --git a/java/flight/flight-grpc/pom.xml b/java/flight/flight-grpc/pom.xml deleted file mode 100644 index af765f8c436be..0000000000000 --- a/java/flight/flight-grpc/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - arrow-flight - org.apache.arrow - 15.0.0-SNAPSHOT - ../pom.xml - - 4.0.0 - - flight-grpc - Arrow Flight GRPC - (Experimental)Contains utility class to expose Flight gRPC service and client - jar - - - 1 - - - - - org.apache.arrow - flight-core - - - io.netty - netty-transport-native-unix-common - - - io.netty - netty-transport-native-kqueue - - - io.netty - netty-transport-native-epoll - - - - - io.grpc - grpc-stub - - - io.grpc - grpc-inprocess - test - - - org.apache.arrow - arrow-memory-core - compile - - - org.apache.arrow - arrow-memory-netty - runtime - - - io.grpc - grpc-protobuf - - - com.google.guava - guava - - - com.google.protobuf - protobuf-java - - - io.grpc - grpc-api - - - - - - - - kr.motd.maven - os-maven-plugin - 1.7.0 - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - com.google.protobuf:protoc:${dep.protobuf-bom.version}:exe:${os.detected.classifier} - false - grpc-java - io.grpc:protoc-gen-grpc-java:${dep.grpc-bom.version}:exe:${os.detected.classifier} - - - - test - - ${basedir}/src/test/protobuf - ${project.build.directory}/generated-test-sources//protobuf - - - compile - compile-custom - - - - - - - - diff --git a/java/flight/flight-grpc/src/test/resources/logback.xml b/java/flight/flight-grpc/src/test/resources/logback.xml deleted file mode 100644 index 4c54d18a210ff..0000000000000 --- a/java/flight/flight-grpc/src/test/resources/logback.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - diff --git a/java/flight/flight-sql/pom.xml b/java/flight/flight-sql/pom.xml index 3c7e4b3495e5a..5ae1a0a23f3c8 100644 --- a/java/flight/flight-sql/pom.xml +++ b/java/flight/flight-sql/pom.xml @@ -50,6 +50,10 @@ org.apache.arrow arrow-memory-core + + org.immutables + value + org.apache.arrow arrow-jdbc @@ -110,4 +114,27 @@ + + + jdk11+ + + [11,] + + !m2e.version + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-reads=org.apache.arrow.flight.sql=org.slf4j --add-reads=org.apache.arrow.flight.core=ALL-UNNAMED --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + + + + + + diff --git a/java/flight/flight-sql/src/main/java/module-info.java b/java/flight/flight-sql/src/main/java/module-info.java new file mode 100644 index 0000000000000..5514d5b870afd --- /dev/null +++ b/java/flight/flight-sql/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.flight.sql { + exports org.apache.arrow.flight.sql; + exports org.apache.arrow.flight.sql.example; + exports org.apache.arrow.flight.sql.util; + + requires com.google.common; + requires java.sql; + requires org.apache.arrow.flight.core; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires protobuf.java; +} diff --git a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSql.java similarity index 98% rename from java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java rename to java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSql.java index 948364a920004..a39736e939f0b 100644 --- a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java +++ b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSql.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.flight; +package org.apache.arrow.flight.sql.test; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; @@ -38,6 +38,15 @@ import java.util.Optional; import java.util.stream.IntStream; +import org.apache.arrow.flight.CancelFlightInfoRequest; +import org.apache.arrow.flight.FlightClient; +import org.apache.arrow.flight.FlightInfo; +import org.apache.arrow.flight.FlightRuntimeException; +import org.apache.arrow.flight.FlightServer; +import org.apache.arrow.flight.FlightStatusCode; +import org.apache.arrow.flight.FlightStream; +import org.apache.arrow.flight.Location; +import org.apache.arrow.flight.RenewFlightEndpointRequest; import org.apache.arrow.flight.sql.FlightSqlClient; import org.apache.arrow.flight.sql.FlightSqlClient.PreparedStatement; import org.apache.arrow.flight.sql.FlightSqlColumnMetadata; @@ -914,7 +923,7 @@ public void testCancelFlightInfo() { FlightInfo info = sqlClient.getSqlInfo(); CancelFlightInfoRequest request = new CancelFlightInfoRequest(info); FlightRuntimeException fre = assertThrows(FlightRuntimeException.class, () -> sqlClient.cancelFlightInfo(request)); - assertEquals(FlightStatusCode.UNIMPLEMENTED, fre.status().code()); + Assertions.assertEquals(FlightStatusCode.UNIMPLEMENTED, fre.status().code()); } @Test diff --git a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSqlStreams.java b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSqlStreams.java similarity index 96% rename from java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSqlStreams.java rename to java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSqlStreams.java index 1dd925eb53add..1dd96f0fd4e9c 100644 --- a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSqlStreams.java +++ b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/sql/test/TestFlightSqlStreams.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.flight; +package org.apache.arrow.flight.sql.test; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; @@ -28,6 +28,15 @@ import java.util.Collections; import java.util.List; +import org.apache.arrow.flight.CallStatus; +import org.apache.arrow.flight.FlightClient; +import org.apache.arrow.flight.FlightDescriptor; +import org.apache.arrow.flight.FlightEndpoint; +import org.apache.arrow.flight.FlightInfo; +import org.apache.arrow.flight.FlightServer; +import org.apache.arrow.flight.FlightStream; +import org.apache.arrow.flight.Location; +import org.apache.arrow.flight.Ticket; import org.apache.arrow.flight.sql.BasicFlightSqlProducer; import org.apache.arrow.flight.sql.FlightSqlClient; import org.apache.arrow.flight.sql.FlightSqlProducer; diff --git a/java/flight/pom.xml b/java/flight/pom.xml index 7ddda94f77b49..9ef01d07a7388 100644 --- a/java/flight/pom.xml +++ b/java/flight/pom.xml @@ -26,7 +26,6 @@ flight-core - flight-grpc flight-sql flight-sql-jdbc-core flight-sql-jdbc-driver diff --git a/java/gandiva/CMakeLists.txt b/java/gandiva/CMakeLists.txt index 2aa8d92959e42..369829d7a30d5 100644 --- a/java/gandiva/CMakeLists.txt +++ b/java/gandiva/CMakeLists.txt @@ -84,6 +84,11 @@ if(CXX_LINKER_SUPPORTS_VERSION_SCRIPT) ) endif() +set(ARROW_JAVA_JNI_GANDIVA_LIBDIR + "${CMAKE_INSTALL_PREFIX}/lib/gandiva_jni/${ARROW_JAVA_JNI_ARCH_DIR}") +set(ARROW_JAVA_JNI_GANDIVA_BINDIR + "${CMAKE_INSTALL_PREFIX}/bin/gandiva_jni/${ARROW_JAVA_JNI_ARCH_DIR}") + install(TARGETS arrow_java_jni_gandiva - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + LIBRARY DESTINATION ${ARROW_JAVA_JNI_GANDIVA_LIBDIR} + RUNTIME DESTINATION ${ARROW_JAVA_JNI_GANDIVA_BINDIR}) diff --git a/java/gandiva/pom.xml b/java/gandiva/pom.xml index e837a09ff8330..330c156a0346b 100644 --- a/java/gandiva/pom.xml +++ b/java/gandiva/pom.xml @@ -34,6 +34,10 @@ org.apache.arrow arrow-memory-core + + org.immutables + value + org.apache.arrow arrow-memory-netty diff --git a/java/gandiva/src/main/java/module-info.java b/java/gandiva/src/main/java/module-info.java new file mode 100644 index 0000000000000..533717d91f7f0 --- /dev/null +++ b/java/gandiva/src/main/java/module-info.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +open module org.apache.arrow.gandiva { + exports org.apache.arrow.gandiva.expression; + exports org.apache.arrow.gandiva.exceptions; + exports org.apache.arrow.gandiva.evaluator; + exports org.apache.arrow.gandiva.ipc; + + requires com.google.common; + requires org.apache.arrow.format; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.slf4j; + requires protobuf.java; +} \ No newline at end of file diff --git a/java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/JniLoader.java b/java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/JniLoader.java index 2528989f3784b..57748e9c8e1af 100644 --- a/java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/JniLoader.java +++ b/java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/JniLoader.java @@ -71,7 +71,7 @@ private static JniLoader setupInstance() throws GandivaException { private static void loadGandivaLibraryFromJar(final String tmpDir) throws IOException, GandivaException { final String libraryToLoad = - getNormalizedArch() + "/" + System.mapLibraryName(LIBRARY_NAME); + LIBRARY_NAME + "/" + getNormalizedArch() + "/" + System.mapLibraryName(LIBRARY_NAME); final File libraryFile = moveFileFromJarToTemp(tmpDir, libraryToLoad, LIBRARY_NAME); System.load(libraryFile.getAbsolutePath()); } diff --git a/java/performance/src/test/java/org/apache/arrow/adapter/AvroAdapterBenchmarks.java b/java/performance/src/test/java/org/apache/arrow/adapter/AvroAdapterBenchmarks.java index 884647b5af3ea..c07aeffafb10c 100644 --- a/java/performance/src/test/java/org/apache/arrow/adapter/AvroAdapterBenchmarks.java +++ b/java/performance/src/test/java/org/apache/arrow/adapter/AvroAdapterBenchmarks.java @@ -21,10 +21,10 @@ import java.io.ByteArrayOutputStream; import java.util.concurrent.TimeUnit; -import org.apache.arrow.AvroToArrow; -import org.apache.arrow.AvroToArrowConfig; -import org.apache.arrow.AvroToArrowConfigBuilder; -import org.apache.arrow.AvroToArrowVectorIterator; +import org.apache.arrow.adapter.avro.AvroToArrow; +import org.apache.arrow.adapter.avro.AvroToArrowConfig; +import org.apache.arrow.adapter.avro.AvroToArrowConfigBuilder; +import org.apache.arrow.adapter.avro.AvroToArrowVectorIterator; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.IntVector; diff --git a/java/pom.xml b/java/pom.xml index b2513d586268b..6fc4df67af3e7 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -1055,7 +1055,6 @@ -DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_LIBDIR=lib/${os.detected.arch} -DCMAKE_INSTALL_PREFIX=${arrow.c.jni.dist.dir} ../ @@ -1128,7 +1127,6 @@ -DARROW_SUBSTRAIT=${ARROW_DATASET} -DARROW_USE_CCACHE=ON -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_LIBDIR=lib/${os.detected.arch} -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_UNITY_BUILD=ON @@ -1169,7 +1167,6 @@ -DARROW_JAVA_JNI_ENABLE_DEFAULT=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_LIBDIR=lib/${os.detected.arch} -DCMAKE_INSTALL_PREFIX=${arrow.dataset.jni.dist.dir} -DCMAKE_PREFIX_PATH=${project.basedir}/../java-dist/lib/${os.detected.arch}/cmake -DProtobuf_USE_STATIC_LIBS=ON @@ -1248,7 +1245,6 @@ -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_LIBDIR=lib/${os.detected.arch} -DCMAKE_INSTALL_PREFIX=java-dist -DCMAKE_UNITY_BUILD=ON -GNinja @@ -1290,7 +1286,6 @@ -DARROW_JAVA_JNI_ENABLE_DEFAULT=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_LIBDIR=lib/${os.detected.arch} -DCMAKE_INSTALL_PREFIX=${arrow.dataset.jni.dist.dir} -DCMAKE_PREFIX_PATH=${project.basedir}/../java-dist/lib/${os.detected.arch}/cmake diff --git a/java/tools/pom.xml b/java/tools/pom.xml index 8df436bac9aef..0d7eacfe2ddce 100644 --- a/java/tools/pom.xml +++ b/java/tools/pom.xml @@ -34,6 +34,10 @@ org.apache.arrow arrow-compression + + org.immutables + value + com.google.guava guava diff --git a/java/tools/src/main/java/module-info.java b/java/tools/src/main/java/module-info.java new file mode 100644 index 0000000000000..6b4329eb84f2a --- /dev/null +++ b/java/tools/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module org.apache.arrow.tools { + exports org.apache.arrow.tools; + + requires com.fasterxml.jackson.databind; + requires com.google.common; + requires org.apache.arrow.compression; + requires org.apache.arrow.memory.core; + requires org.apache.arrow.vector; + requires org.slf4j; +} diff --git a/java/vector/src/test/java/org/apache/arrow/vector/util/ArrowTestDataUtil.java b/java/vector/src/test/java/org/apache/arrow/vector/test/util/ArrowTestDataUtil.java similarity index 97% rename from java/vector/src/test/java/org/apache/arrow/vector/util/ArrowTestDataUtil.java rename to java/vector/src/test/java/org/apache/arrow/vector/test/util/ArrowTestDataUtil.java index 1c525c0c271ac..901a09e313f59 100644 --- a/java/vector/src/test/java/org/apache/arrow/vector/util/ArrowTestDataUtil.java +++ b/java/vector/src/test/java/org/apache/arrow/vector/test/util/ArrowTestDataUtil.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.arrow.vector.util; +package org.apache.arrow.vector.test.util; import java.nio.file.Path; import java.nio.file.Paths;