Skip to content

Commit 99fea13

Browse files
committed
revert hard code
1 parent 6a99076 commit 99fea13

File tree

5 files changed

+15
-27
lines changed

5 files changed

+15
-27
lines changed

adapter/orc/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717

1818
find_package(Arrow REQUIRED)
19-
find_package(Protobuf REQUIRED)
2019

2120
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
2221
${JNI_INCLUDE_DIRS} ${JNI_HEADERS_DIR})
@@ -36,8 +35,7 @@ add_jar(arrow_java_jni_orc_jar
3635
add_library(arrow_java_jni_orc SHARED src/main/cpp/jni_wrapper.cpp)
3736
set_property(TARGET arrow_java_jni_orc PROPERTY OUTPUT_NAME "arrow_orc_jni")
3837
target_link_libraries(arrow_java_jni_orc arrow_java_jni_orc_headers jni
39-
Arrow::arrow_static
40-
${Protobuf_LIBRARIES})
38+
Arrow::arrow_static)
4139

4240
set(ARROW_JAVA_JNI_ORC_LIBDIR
4341
"${CMAKE_INSTALL_PREFIX}/lib/arrow_orc_jni/${ARROW_JAVA_JNI_ARCH_DIR}")

dataset/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
find_package(ArrowDataset REQUIRED)
1919
find_package(ArrowSubstrait REQUIRED)
20-
find_package(Protobuf REQUIRED)
2120

2221
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
2322
${JNI_INCLUDE_DIRS} ${JNI_HEADERS_DIR})
@@ -40,8 +39,7 @@ target_link_libraries(arrow_java_jni_dataset
4039
arrow_java_jni_dataset_headers
4140
jni
4241
ArrowDataset::arrow_dataset_static
43-
ArrowSubstrait::arrow_substrait_static
44-
${Protobuf_LIBRARIES})
42+
ArrowSubstrait::arrow_substrait_static)
4543

4644
if(BUILD_TESTING)
4745
add_executable(arrow-java-jni-dataset-test src/main/cpp/jni_util_test.cc

dataset/src/main/cpp/jni_wrapper.cc

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
#ifdef ARROW_CSV
3131
#include "arrow/dataset/file_csv.h"
3232
#endif
33-
#ifdef ARROW_ORC
34-
#include "arrow/dataset/file_orc.h"
35-
#endif
36-
#ifdef ARROW_JSON
37-
#include "arrow/dataset/file_json.h"
38-
#endif
3933
#include "arrow/filesystem/api.h"
4034
#include "arrow/filesystem/path_util.h"
4135
#include "arrow/engine/substrait/util.h"
@@ -147,25 +141,20 @@ arrow::Result<std::shared_ptr<arrow::dataset::FileFormat>> GetFileFormat(
147141
jint file_format_id) {
148142
switch (file_format_id) {
149143
case 0:
150-
return std::static_pointer_cast<arrow::dataset::FileFormat>(
151-
std::make_shared<arrow::dataset::ParquetFileFormat>());
144+
return std::make_shared<arrow::dataset::ParquetFileFormat>();
152145
case 1:
153-
return std::static_pointer_cast<arrow::dataset::FileFormat>(
154-
std::make_shared<arrow::dataset::IpcFileFormat>());
146+
return std::make_shared<arrow::dataset::IpcFileFormat>();
155147
#ifdef ARROW_ORC
156148
case 2:
157-
return std::static_pointer_cast<arrow::dataset::FileFormat>(
158-
std::make_shared<arrow::dataset::OrcFileFormat>());
149+
return std::make_shared<arrow::dataset::OrcFileFormat>();
159150
#endif
160151
#ifdef ARROW_CSV
161152
case 3:
162-
return std::static_pointer_cast<arrow::dataset::FileFormat>(
163-
std::make_shared<arrow::dataset::CsvFileFormat>());
153+
return std::make_shared<arrow::dataset::CsvFileFormat>();
164154
#endif
165155
#ifdef ARROW_JSON
166156
case 4:
167-
return std::static_pointer_cast<arrow::dataset::FileFormat>(
168-
std::make_shared<arrow::dataset::JsonFileFormat>());
157+
return std::make_shared<arrow::dataset::JsonFileFormat>();
169158
#endif
170159
default:
171160
std::string error_message =

dataset/src/main/java/org/apache/arrow/dataset/jni/JniLoader.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@ private synchronized void loadRemaining() {
7777
}
7878

7979
private void load(String name) {
80-
final String libraryToLoad = "/Users/yuxia/Projects/cpp-projects/arrow/java-dist/lib/" +
81-
name + "/" + getNormalizedArch() + "/" + System.mapLibraryName(name);
80+
final String libraryToLoad =
81+
name
82+
+ "/"
83+
+ getNormalizedArch()
84+
+ "/"
85+
+ System.mapLibraryName(name);
8286
try {
8387
File temp =
8488
File.createTempFile("jnilib-", ".tmp", new File(System.getProperty("java.io.tmpdir")));
8589
temp.deleteOnExit();
86-
try (final InputStream is = Files.newInputStream(Path.of(libraryToLoad))) {
90+
try (final InputStream is =
91+
JniWrapper.class.getClassLoader().getResourceAsStream(libraryToLoad)) {
8792
if (is == null) {
8893
throw new FileNotFoundException(libraryToLoad);
8994
}

pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ under the License.
7676
<module>algorithm</module>
7777
<module>adapter/avro</module>
7878
<module>compression</module>
79-
<module>adapter/orc</module>
80-
<module>dataset</module>
8179
</modules>
8280

8381
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">

0 commit comments

Comments
 (0)