Skip to content

Conversation

@PHILO-HE
Copy link
Member

@PHILO-HE PHILO-HE commented May 27, 2024

Rationale for this change

Fix undefined symbol error reported at runtime after ARROW_S3=OFF is used in compiling arrow Java.

What changes are included in this PR?

Are these changes tested?

Tested in my local. Not sure whether we need to add some test.

Are there any user-facing changes?

No.

@PHILO-HE PHILO-HE requested a review from lidavidm as a code owner May 27, 2024 01:27
@github-actions
Copy link

⚠️ GitHub issue #41836 has been automatically assigned in GitHub to PR creator.

@vibhatha
Copy link
Contributor

@github-actions crossbow submit -g java

@github-actions
Copy link

Revision: 1ef554d51d772a7c5970abc3b8f53afbb0924be6

Submitted crossbow builds: ursacomputing/crossbow @ actions-8150e0c94c

Task Status
java-jars GitHub Actions
test-conda-python-3.10-spark-v3.5.0 GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.8-spark-v3.5.0 GitHub Actions
verify-rc-source-java-linux-almalinux-8-amd64 GitHub Actions
verify-rc-source-java-linux-conda-latest-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-20.04-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-22.04-amd64 GitHub Actions
verify-rc-source-java-macos-amd64 GitHub Actions

Copy link
Member

Choose a reason for hiding this comment

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

Could you confirm whether arrow/util/config.h is included here implicitly?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kou, thanks for your review! I didn't find this header is included implicitly.

Copy link
Member

Choose a reason for hiding this comment

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

OK. How about the following?

diff --git a/java/dataset/src/main/cpp/jni_wrapper.cc b/java/dataset/src/main/cpp/jni_wrapper.cc
index 19a43c8d2f..f1819aab0b 100644
--- a/java/dataset/src/main/cpp/jni_wrapper.cc
+++ b/java/dataset/src/main/cpp/jni_wrapper.cc
@@ -25,9 +25,8 @@
 #include "arrow/c/helpers.h"
 #include "arrow/dataset/api.h"
 #include "arrow/dataset/file_base.h"
-#include "arrow/filesystem/localfs.h"
+#include "arrow/filesystem/api.h"
 #include "arrow/filesystem/path_util.h"
-#include "arrow/filesystem/s3fs.h"
 #include "arrow/engine/substrait/util.h"
 #include "arrow/engine/substrait/serde.h"
 #include "arrow/engine/substrait/relation.h"

arrow/filesystem/api.h includes arrow/util/config.h explicitly and ARROW_S3 must be defined if S3 is enabled with arrow/filesystem/api.h.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kou, by including arrow/filesystem/api.h, a few extra headers are directly or indirectly included, but they are not actually used here. Can we just keep the current change?

Copy link
Member

Choose a reason for hiding this comment

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

If we want to keep the current style, we need to include arrow/util/config.h explicitly before we use ARROW_S3.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kou, I just realized what you meant. The code was updated. Thanks!

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels May 27, 2024
@kou
Copy link
Member

kou commented May 27, 2024

Could you test that this change doesn't break #36934? A reproduced program exists in the description of #36934.
(You need to enable S3 for this.)

@PHILO-HE
Copy link
Member Author

Could you test that this change doesn't break #36934? A reproduced program exists in the description of #36934. (You need to enable S3 for this.)

@kou, I just did a test with S3 enabled. This change doesn't break it.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

Thanks for checking it.

@kou kou merged commit 052c330 into apache:main May 31, 2024
@kou kou removed the awaiting change review Awaiting change review label May 31, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label May 31, 2024
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 052c330.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 76 possible false positives for unstable benchmarks that are known to sometimes produce them.

pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
apache#41837)

### Rationale for this change

Fix undefined symbol error reported at runtime after ARROW_S3=OFF is used in compiling arrow Java.

### What changes are included in this PR?

### Are these changes tested?

Tested in my local. Not sure whether we need to add some test.

### Are there any user-facing changes?

No.

* GitHub Issue: apache#41836

Authored-by: PHILO-HE <feilong.he@intel.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants