From 4f4b72f76d3081b81968812f39293f0076c39a08 Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 25 Aug 2026 12:20:44 +0900 Subject: [PATCH 1/6] MINOR: Update google-java-format and test Java 25 in CI --- .github/workflows/test.yml | 4 ++-- .../apache/arrow/adapter/avro/ArrowToAvroUtils.java | 10 +++++----- pom.xml | 2 +- .../java/org/apache/arrow/vector/ValueVector.java | 2 -- .../main/java/org/apache/arrow/vector/util/Text.java | 12 ++++++------ 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 653b16fa32..c426f392d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,8 +45,8 @@ jobs: strategy: fail-fast: false matrix: - jdk: [17, 21, 23] - maven: [3.9.9] + jdk: [17, 21, 25] + maven: [3.9.16] image: [ubuntu, conda-jni-cdata] include: - image: ubuntu diff --git a/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/ArrowToAvroUtils.java b/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/ArrowToAvroUtils.java index e09b99f670..bdbf9c2173 100644 --- a/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/ArrowToAvroUtils.java +++ b/adapter/avro/src/main/java/org/apache/arrow/adapter/avro/ArrowToAvroUtils.java @@ -601,7 +601,7 @@ private static BaseAvroProducer createProducer( case VARCHAR: return new AvroStringProducer((VarCharVector) vector); - // Logical types + // Logical types case DECIMAL: return new AvroDecimalProducer((DecimalVector) vector); @@ -636,7 +636,7 @@ private static BaseAvroProducer createProducer( case TIMESTAMPNANOTZ: return new AvroTimestampNanoTzProducer((TimeStampNanoTZVector) vector); - // Complex types + // Complex types case STRUCT: StructVector structVector = (StructVector) vector; @@ -679,9 +679,9 @@ private static BaseAvroProducer createProducer( new AvroStructProducer(entryVector, new Producer[] {keyProducer, valueProducer}); return new AvroMapProducer(mapVector, entryProducer); - // Support for UNION and DENSEUNION is not currently available - // This is pending fixes in the implementation of the union vectors themselves - // https://github.com/apache/arrow-java/issues/108 + // Support for UNION and DENSEUNION is not currently available + // This is pending fixes in the implementation of the union vectors themselves + // https://github.com/apache/arrow-java/issues/108 default: // Not all Arrow types are supported for encoding (yet)! diff --git a/pom.xml b/pom.xml index bee28e2a97..89a28bd2ac 100644 --- a/pom.xml +++ b/pom.xml @@ -738,7 +738,7 @@ under the License. - 1.17.0 + 1.36.1 diff --git a/vector/src/main/java/org/apache/arrow/vector/ValueVector.java b/vector/src/main/java/org/apache/arrow/vector/ValueVector.java index 3a5058256c..973581f999 100644 --- a/vector/src/main/java/org/apache/arrow/vector/ValueVector.java +++ b/vector/src/main/java/org/apache/arrow/vector/ValueVector.java @@ -53,10 +53,8 @@ *

This interface "should" strive to guarantee this order of operation: * *

- * * allocate > mutate > setvaluecount > access > clear (or allocate to start the process * over). - * *
*/ public interface ValueVector extends Closeable, Iterable { diff --git a/vector/src/main/java/org/apache/arrow/vector/util/Text.java b/vector/src/main/java/org/apache/arrow/vector/util/Text.java index 35d810abbb..2edb004088 100644 --- a/vector/src/main/java/org/apache/arrow/vector/util/Text.java +++ b/vector/src/main/java/org/apache/arrow/vector/util/Text.java @@ -488,7 +488,7 @@ private static Optional validateUTF8Internal(byte[] utf8, int start, in if (leadByte == 0xED && aByte > 0x9F) { return Optional.of(count); } - // falls through to regular trail-byte test!! + // falls through to regular trail-byte test!! case TRAIL_BYTE: if (aByte < 0x80 || aByte > 0xBF) { return Optional.of(count); @@ -793,23 +793,23 @@ public static int bytesToCodePoint(ByteBuffer bytes) { case 5: ch += (bytes.get() & 0xFF); ch <<= 6; /* remember, illegal UTF-8 */ - // fall through + // fall through case 4: ch += (bytes.get() & 0xFF); ch <<= 6; /* remember, illegal UTF-8 */ - // fall through + // fall through case 3: ch += (bytes.get() & 0xFF); ch <<= 6; - // fall through + // fall through case 2: ch += (bytes.get() & 0xFF); ch <<= 6; - // fall through + // fall through case 1: ch += (bytes.get() & 0xFF); ch <<= 6; - // fall through + // fall through case 0: ch += (bytes.get() & 0xFF); break; From 30260a04c9db066c54852a51c522a07af8ca4d88 Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 25 Aug 2026 16:37:00 +0900 Subject: [PATCH 2/6] update docs --- docs/source/install.rst | 17 +++++++++++------ pom.xml | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index e0b34515ef..8536e1ce14 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -28,10 +28,13 @@ Java Compatibility ================== Java modules are compatible with JDK 17 and above. Currently, JDK versions -17, 21, and latest are tested in CI. +17, 21, and 25 are tested in CI. -Note that some JDK internals must be exposed by -adding ``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`` to the ``java`` command: +Note that some JDK internals must be exposed by adding these flags to the ``java`` command: + +- ``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`` (always required) +- ``--enable-native-access=io.netty.common`` (Java 25+, when using ``arrow-memory-netty``) +- ``--sun-misc-unsafe-memory-access=allow`` (Java 25+; not stricly necessary, but suppresses certain warnings) .. code-block:: shell @@ -40,9 +43,11 @@ adding ``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED # Indirectly via environment variables $ env JDK_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`` or ``module java.base does not "opens -java.nio" to org.apache.arrow.memory.core`` +Otherwise, you may see errors and/or warnings like these: +- ``module java.base does not "opens java.nio" to unnamed module`` +- ``module java.base does not "opens java.nio" to org.apache.arrow.memory.core`` +- ``Native access (restricted methods) is not enabled for the io.netty.common module.`` +- ``A terminally deprecated method in sun.misc.Unsafe has been called`` 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 diff --git a/pom.xml b/pom.xml index 89a28bd2ac..d5928352b3 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ under the License. none -Xdoclint:none - --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common --sun-misc-unsafe-memory-access=allow 17 17 From 76948996b70bb1d192119b501040cd127116925d Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 25 Aug 2026 16:40:03 +0900 Subject: [PATCH 3/6] change spotless --- pom.xml | 84 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index d5928352b3..e28243ae1c 100644 --- a/pom.xml +++ b/pom.xml @@ -725,42 +725,6 @@ under the License. org.apache.maven.plugins maven-site-plugin - - com.diffplug.spotless - spotless-maven-plugin - - - - ${maven.multiModuleProjectDirectory}/dev/license/asf-xml.license - (<configuration|<project) - - - - - - 1.36.1 - - - - ${maven.multiModuleProjectDirectory}/dev/license/asf-java.license - package - - - **/Preconditions.java - **/IntObjectMap.java - **/IntObjectHashMap.java - - - - - - spotless-check - - check - - - - @@ -842,6 +806,54 @@ under the License. + + + spotless + + [21,) + + + + + com.diffplug.spotless + spotless-maven-plugin + + + + ${maven.multiModuleProjectDirectory}/dev/license/asf-xml.license + (<configuration|<project) + + + + + + 1.36.1 + + + + ${maven.multiModuleProjectDirectory}/dev/license/asf-java.license + package + + + **/Preconditions.java + **/IntObjectMap.java + **/IntObjectHashMap.java + + + + + + spotless-check + + check + + + + + + + + - --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common --sun-misc-unsafe-memory-access=allow + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common ${surefire.unsafe-memory-access.argLine} + 17 17 @@ -778,6 +779,17 @@ under the License. + + + jdk24 + + [24,) + + + --sun-misc-unsafe-memory-access=allow + + + arrow-c-data From a5d56618857895fd6a64db980733d03ae554f054 Mon Sep 17 00:00:00 2001 From: David Li Date: Tue, 25 Aug 2026 20:38:46 +0900 Subject: [PATCH 6/6] harmonize surefire.argLine --- adapter/jdbc/pom.xml | 11 ++++------- dataset/pom.xml | 2 +- flight/flight-core/pom.xml | 4 +--- flight/flight-sql/pom.xml | 3 +-- memory/memory-core/pom.xml | 4 +--- pom.xml | 12 ++++++------ 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/adapter/jdbc/pom.xml b/adapter/jdbc/pom.xml index a8ac19721d..19a987d74c 100644 --- a/adapter/jdbc/pom.xml +++ b/adapter/jdbc/pom.xml @@ -32,6 +32,10 @@ under the License. (Contrib/Experimental)A library for converting JDBC data to Arrow data. http://maven.apache.org + + --add-reads=org.apache.arrow.adapter.jdbc=com.fasterxml.jackson.dataformat.yaml + + @@ -109,13 +113,6 @@ under the License. - - 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 -Duser.timezone=UTC - - org.apache.maven.plugins maven-compiler-plugin diff --git a/dataset/pom.xml b/dataset/pom.xml index 5acc837860..47b5080734 100644 --- a/dataset/pom.xml +++ b/dataset/pom.xml @@ -31,6 +31,7 @@ under the License. Java implementation of Arrow Dataset API/Framework + --add-reads=org.apache.arrow.dataset=com.fasterxml.jackson.databind --add-opens=java.base/java.nio=org.apache.arrow.dataset ../../../cpp/release-build/ 1.17.1 1.12.1 @@ -180,7 +181,6 @@ under the License. maven-surefire-plugin - --add-reads=org.apache.arrow.dataset=com.fasterxml.jackson.databind --add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED false ${project.basedir}/../testing/data diff --git a/flight/flight-core/pom.xml b/flight/flight-core/pom.xml index d07a4ef0fe..8228cd67c0 100644 --- a/flight/flight-core/pom.xml +++ b/flight/flight-core/pom.xml @@ -32,8 +32,7 @@ under the License. 1 - - --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 + --add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java @@ -152,7 +151,6 @@ under the License. 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/flight/flight-sql/pom.xml b/flight/flight-sql/pom.xml index b7c8931391..ec80d7c3a0 100644 --- a/flight/flight-sql/pom.xml +++ b/flight/flight-sql/pom.xml @@ -32,8 +32,7 @@ under the License. 1 - - --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 + --add-reads=org.apache.arrow.flight.sql=org.slf4j --add-reads=org.apache.arrow.flight.core=ALL-UNNAMED diff --git a/memory/memory-core/pom.xml b/memory/memory-core/pom.xml index 825b3dae4b..f047999070 100644 --- a/memory/memory-core/pom.xml +++ b/memory/memory-core/pom.xml @@ -31,8 +31,7 @@ under the License. Core off-heap memory management libraries for Arrow ValueVectors. - - --add-reads=org.apache.arrow.memory.core=ch.qos.logback.classic --add-opens=java.base/java.lang.reflect=org.apache.arrow.memory.core --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + --add-reads=org.apache.arrow.memory.core=ch.qos.logback.classic --add-opens=java.base/java.lang.reflect=org.apache.arrow.memory.core @@ -84,7 +83,6 @@ under the License. org.apache.maven.plugins maven-surefire-plugin - --add-reads=org.apache.arrow.memory.core=ch.qos.logback.classic --add-opens=java.base/java.lang.reflect=org.apache.arrow.memory.core --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED **/TestOpens.java diff --git a/pom.xml b/pom.xml index 5dca607123..9ed3fbb760 100644 --- a/pom.xml +++ b/pom.xml @@ -116,9 +116,9 @@ under the License. 1.6.3 none -Xdoclint:none - - --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common ${surefire.unsafe-memory-access.argLine} - + + + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --enable-native-access=io.netty.common ${surefire.argLine.extend} ${surefire.argLine.jdkSpecific} 17 17 @@ -323,7 +323,7 @@ under the License. maven-surefire-plugin - ${surefire.add-opens.argLine} + ${surefire.argLine} true true ${forkCount} @@ -342,7 +342,7 @@ under the License. maven-failsafe-plugin - ${surefire.add-opens.argLine} + ${surefire.argLine} ${project.build.directory} true @@ -786,7 +786,7 @@ under the License. [24,) - --sun-misc-unsafe-memory-access=allow + --sun-misc-unsafe-memory-access=allow