MCPcopy Index your code
hub / github.com/apache/arrow-java

github.com/apache/arrow-java @v19.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v19.0.0 ↗ · + Follow
14,416 symbols 81,584 edges 1,282 files 4,382 documented · 30% updated 1d agov19.0.0 · 2026-03-16★ 89423 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Arrow Java

Getting Started

The following guides explain the fundamental data structures used in the Java implementation of Apache Arrow.

  • ValueVector is an abstraction that is used to store a sequence of values having the same type in an individual column.
  • VectorSchemaRoot is a container that can hold multiple vectors based on a schema.
  • The Reading/Writing IPC formats guide explains how to stream record batches as well as serializing record batches to files.

Generated javadoc documentation is available here.

Building from source

Refer to Building Apache Arrow for documentation of environment setup and build instructions.

Flatbuffers dependency

Arrow uses Google's Flatbuffers to transport metadata. The java version of the library requires the generated flatbuffer classes can only be used with the same version that generated them. Arrow packages a version of the arrow-vector module that shades flatbuffers and arrow-format into a single JAR. Using the classifier "shade-format-flatbuffers" in your pom.xml will make use of this JAR, you can then exclude/resolve the original dependency to a version of your choosing.

Updating the flatbuffers generated code

  1. Verify that your version of flatc matches the declared dependency:
$ flatc --version
flatc version 25.1.24

$ grep "dep.fbs.version" pom.xml
    <dep.fbs.version>25.1.24</dep.fbs.version>
  1. Generate the flatbuffer java files by performing the following:
cd $ARROW_HOME

# remove the existing files
rm -rf format/src

# regenerate from the .fbs files
flatc --java -o format/src/main/java arrow-format/*.fbs

# prepend license header
mvn spotless:apply -pl :arrow-format

Performance Tuning

There are several system/environmental variables that users can configure. These trade off safety (they turn off checking) for speed. Typically they are only used in production settings after the code has been thoroughly tested without using them.

  • Bounds Checking for memory accesses: Bounds checking is on by default. You can disable it by setting either the system property(arrow.enable_unsafe_memory_access) or the environmental variable (ARROW_ENABLE_UNSAFE_MEMORY_ACCESS) to true. When both the system property and the environmental variable are set, the system property takes precedence.

  • null checking for gets: ValueVector get methods (not getObject) methods by default verify the slot is not null. You can disable it by setting either the system property(arrow.enable_null_check_for_get) or the environmental variable (ARROW_ENABLE_NULL_CHECK_FOR_GET) to false. When both the system property and the environmental variable are set, the system property takes precedence.

Java Properties

  • -Dio.netty.tryReflectionSetAccessible=true should be set. This fixes java.lang.UnsupportedOperationException: sun.misc.Unsafe or java.nio.DirectByteBuffer.(long, int) not available. thrown by Netty.
  • To support duplicate fields in a StructVector enable -Darrow.struct.conflict.policy=CONFLICT_APPEND. Duplicate fields are ignored (CONFLICT_REPLACE) by default and overwritten. To support different policies for conflicting or duplicate fields set this JVM flag or use the correct static constructor methods for StructVectors.

Java Code Style Guide

Arrow Java follows the Google Java Style Guide with the following differences:

  • Imports are grouped, from top to bottom, in this order: static imports, standard Java, org.*, com.*
  • Line length can be up to 120 characters
  • Operators for line wrapping are at end-of-line
  • Naming rules for methods, parameters, etc. have been relaxed
  • Disabled NoFinalizer, OverloadMethodsDeclarationOrder, and VariableDeclarationUsageDistance due to the existing code base. These rules should be followed when possible.

Refer to checkstyle.xml for rule specifics.

Test Logging Configuration

When running tests, Arrow Java uses the Logback logger with SLF4J. By default, it uses the logback.xml present in the corresponding module's src/test/resources directory, which has the default log level set to INFO. Arrow Java can be built with an alternate logback configuration file using the following command run in the project root directory:

mvn -Dlogback.configurationFile=file:<path-of-logback-file>

See Logback Configuration for more details.

Integration Tests

Integration tests which require more time or more memory can be run by activating the integration-tests profile. This activates the Maven Failsafe plugin and any class prefixed with IT will be run during the testing phase. The integration tests currently require a larger amount of memory (>4GB) and time to complete. To activate the profile:

mvn -Pintegration-tests <rest of mvn arguments>

Extension points exported contracts — how you extend this code

DensityAwareVector (Interface)
Vector that support density aware initial capacity settings. We use this for ListVector and VarCharVector as of now to c [19 …
vector/src/main/java/org/apache/arrow/vector/DensityAwareVector.java
ScanTask (Interface)
Read record batches from a range of a single data fragment. A ScanTask is meant to be a unit of work to be dispatched. T [11 …
dataset/src/main/java/org/apache/arrow/dataset/scanner/ScanTask.java
RoundingPolicy (Interface)
The policy for rounding the buffer size, to improve performance and avoid memory fragmentation. In particular, given a r [6 …
memory/memory-core/src/main/java/org/apache/arrow/memory/rounding/RoundingPolicy.java
AvaticaParameterConverter (Interface)
Interface for a class in charge of converting between AvaticaParameters and TypedValues and Arrow. [26 implementers]
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/converter/AvaticaParameterConverter.java
SessionOptionValueVisitor (Interface)
A visitor interface to access SessionOptionValue's contained value. @param Return type of the visit operation. [18 implementers]
flight/flight-core/src/main/java/org/apache/arrow/flight/SessionOptionValueVisitor.java
TreeNode (Interface)
Defines an internal node in the expression tree. [32 implementers]
gandiva/src/main/java/org/apache/arrow/gandiva/expression/TreeNode.java
DictionaryEncoder (Interface)
A dictionary encoder translates one vector into another one based on a dictionary vector. According to Arrow specificati [8 …
algorithm/src/main/java/org/apache/arrow/algorithm/dictionary/DictionaryEncoder.java
JdbcConsumer (Interface)
An abstraction that is used to consume values from ResultSet. @param The vector within consumer or its dele [9 implementers]
adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/consumer/JdbcConsumer.java

Core symbols most depended-on inside this repo

get
called by 2693
vector/src/main/java/org/apache/arrow/vector/util/IntObjectMap.java
setValueCount
called by 1307
vector/src/main/java/org/apache/arrow/vector/ValueVector.java
allocateNew
called by 1121
vector/src/main/java/org/apache/arrow/vector/ValueVector.java
getType
called by 977
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java
getValueCount
called by 875
vector/src/main/java/org/apache/arrow/vector/ValueVector.java
setSafe
called by 849
vector/src/main/java/org/apache/arrow/vector/VariableWidthFieldVector.java
getField
called by 780
vector/src/main/java/org/apache/arrow/vector/ValueVector.java
add
called by 719
memory/memory-core/src/main/java/org/apache/arrow/memory/AllocationReservation.java

Shape

Method 12,589
Class 1,526
Interface 138
Function 132
Enum 31

Languages

Java98%
C++2%
Python1%

Modules by API surface

adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/ResultSetUtility.java214 symbols
algorithm/src/main/java/org/apache/arrow/algorithm/sort/DefaultVectorComparators.java113 symbols
flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/SqlInfoBuilder.java107 symbols
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowDatabaseMetadata.java106 symbols
vector/src/test/java/org/apache/arrow/vector/TestValueVector.java105 symbols
vector/src/test/java/org/apache/arrow/vector/complex/writer/TestComplexWriter.java97 symbols
vector/src/main/java/org/apache/arrow/vector/complex/ListViewVector.java78 symbols
vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthViewVector.java78 symbols
vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java76 symbols
adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/MockPreparedStatement.java76 symbols
vector/src/main/java/org/apache/arrow/vector/complex/LargeListVector.java75 symbols
vector/src/main/java/org/apache/arrow/vector/BaseLargeVariableWidthVector.java75 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add arrow-java \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact