Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-36927: [Java][Docs] Enable Gandiva build as part of Java maven commands #36929

Merged
merged 3 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/source/developers/java/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ Maven
$ cd arrow/java
$ export JAVA_HOME=<absolute path to your java home>
$ java --version
$ mvn generate-resources \
-Pgenerate-libs-jni-macos-linux \
-DARROW_GANDIVA=ON \
-DARROW_JAVA_JNI_ENABLE_GANDIVA=ON \
-N
$ mvn generate-resources -Pgenerate-libs-jni-macos-linux -N
$ ls -latr java-dist/lib/<your system's architecture>/*_{jni,java}.*
|__ libarrow_dataset_jni.dylib
|__ libarrow_orc_jni.dylib
Expand Down Expand Up @@ -236,7 +232,9 @@ CMake
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib/<your system's architecture> \
-DCMAKE_INSTALL_PREFIX=java-dist \
-DCMAKE_PREFIX_PATH=$PWD/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/<your system's architecture>/*_{jni,java}.*
|__ libarrow_dataset_jni.dylib
Expand All @@ -257,8 +255,9 @@ CMake
-DARROW_DATASET=ON ^
-DARROW_DEPENDENCY_USE_SHARED=OFF ^
-DARROW_FILESYSTEM=ON ^
-DARROW_GANDIVA=OFF ^
-DARROW_JSON=ON ^
-DARROW_ORC=OFF ^
-DARROW_ORC=ON ^
-DARROW_PARQUET=ON ^
-DARROW_S3=ON ^
-DARROW_SUBSTRAIT=ON ^
Expand All @@ -280,16 +279,18 @@ CMake
-S java ^
-B java-jni ^
-DARROW_JAVA_JNI_ENABLE_C=OFF ^
-DARROW_JAVA_JNI_ENABLE_DATASET=ON ^
-DARROW_JAVA_JNI_ENABLE_DEFAULT=ON ^
-DARROW_JAVA_JNI_ENABLE_GANDIVA=OFF ^
-DARROW_JAVA_JNI_ENABLE_ORC=OFF ^
-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

Archery
Expand Down
24 changes: 14 additions & 10 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -984,13 +984,13 @@
<properties>
<arrow.dataset.jni.dist.dir>java-dist</arrow.dataset.jni.dist.dir>
<cpp.dependencies.builded>false</cpp.dependencies.builded>
<ARROW_CSV>ON</ARROW_CSV>
<ARROW_DATASET>ON</ARROW_DATASET>
<ARROW_GANDIVA>ON</ARROW_GANDIVA>
<ARROW_ORC>ON</ARROW_ORC>
<ARROW_PARQUET>ON</ARROW_PARQUET>
<ARROW_GANDIVA>OFF</ARROW_GANDIVA>
<ARROW_JAVA_JNI_ENABLE_C>OFF</ARROW_JAVA_JNI_ENABLE_C>
<ARROW_JAVA_JNI_ENABLE_DATASET>ON</ARROW_JAVA_JNI_ENABLE_DATASET>
<ARROW_JAVA_JNI_ENABLE_GANDIVA>OFF</ARROW_JAVA_JNI_ENABLE_GANDIVA>
<ARROW_JAVA_JNI_ENABLE_GANDIVA>ON</ARROW_JAVA_JNI_ENABLE_GANDIVA>
<ARROW_JAVA_JNI_ENABLE_ORC>ON</ARROW_JAVA_JNI_ENABLE_ORC>
</properties>
<build>
Expand All @@ -1012,8 +1012,8 @@
-S cpp
-B cpp-jni
-DARROW_BUILD_SHARED=OFF
-DARROW_CSV=${ARROW_CSV}
-DARROW_DATASET=ON
-DARROW_CSV=${ARROW_DATASET}
-DARROW_DATASET=${ARROW_DATASET}
-DARROW_DEPENDENCY_SOURCE=BUNDLED
-DARROW_DEPENDENCY_USE_SHARED=OFF
-DARROW_FILESYSTEM=ON
Expand Down Expand Up @@ -1070,6 +1070,8 @@
-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
-DProtobuf_ROOT=${project.basedir}/../cpp-jni/protobuf_ep-install
Comment on lines +1073 to +1074
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why are we making this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, is this for https://github.com/apache/arrow/blob/main/java/gandiva/CMakeLists.txt#L41 ?

We can use this solution for now but we should find a better solution that doesn't require additional CMake options such as Protobuf_ROOT and Protobuf_USE_STATIC_LIBS. Could you open an issue for it?
(We may add support for installing bundled protoc for this case.)

</commandlineArgs>
<workingDirectory>../</workingDirectory>
</configuration>
Expand Down Expand Up @@ -1099,13 +1101,14 @@
<properties>
<arrow.dataset.jni.dist.dir>java-dist</arrow.dataset.jni.dist.dir>
<cpp.dependencies.builded>false</cpp.dependencies.builded>
<ARROW_CSV>ON</ARROW_CSV>
<ARROW_ORC>OFF</ARROW_ORC>
<ARROW_DATASET>ON</ARROW_DATASET>
<ARROW_GANDIVA>OFF</ARROW_GANDIVA>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ARROW_GANDIVA is accidentally set to OFF here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is it not supported on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't have JNI yet because we need to install LLVM to build Gandiva (Could NOT find LLVM (missing: LLVM_DIR)).

<ARROW_ORC>ON</ARROW_ORC>
<ARROW_PARQUET>ON</ARROW_PARQUET>
<ARROW_JAVA_JNI_ENABLE_C>OFF</ARROW_JAVA_JNI_ENABLE_C>
<ARROW_JAVA_JNI_ENABLE_DATASET>ON</ARROW_JAVA_JNI_ENABLE_DATASET>
<ARROW_JAVA_JNI_ENABLE_GANDIVA>OFF</ARROW_JAVA_JNI_ENABLE_GANDIVA>
<ARROW_JAVA_JNI_ENABLE_ORC>OFF</ARROW_JAVA_JNI_ENABLE_ORC>
<ARROW_JAVA_JNI_ENABLE_ORC>ON</ARROW_JAVA_JNI_ENABLE_ORC>
</properties>
<build>
<plugins>
Expand All @@ -1126,10 +1129,11 @@
-S cpp
-B cpp-jni
-DARROW_BUILD_SHARED=OFF
-DARROW_CSV=${ARROW_CSV}
-DARROW_DATASET=ON
-DARROW_CSV=${ARROW_DATASET}
-DARROW_DATASET=${ARROW_DATASET}
-DARROW_DEPENDENCY_USE_SHARED=OFF
-DARROW_FILESYSTEM=ON
-DARROW_GANDIVA=${ARROW_GANDIVA}
-DARROW_JSON=${ARROW_DATASET}
-DARROW_ORC=${ARROW_ORC}
-DARROW_PARQUET=${ARROW_PARQUET}
Expand Down