rok commented on code in PR #14472:
URL: https://github.com/apache/arrow/pull/14472#discussion_r1014735691
##########
java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/JniLoader.java:
##########
@@ -69,15 +70,30 @@ private static JniLoader setupInstance() throws
GandivaException {
private static void loadGandivaLibraryFromJar(final String tmpDir)
throws IOException, GandivaException {
- final String libraryToLoad = System.mapLibraryName(LIBRARY_NAME);
- final File libraryFile = moveFileFromJarToTemp(tmpDir, libraryToLoad);
+ final String libraryToLoad =
+ getNormalizedArch() + File.separator +
System.mapLibraryName(LIBRARY_NAME);
+ final File libraryFile = moveFileFromJarToTemp(tmpDir, libraryToLoad,
LIBRARY_NAME);
System.load(libraryFile.getAbsolutePath());
}
+ private static String getNormalizedArch() {
+ String arch = System.getProperty("os.arch").toLowerCase(Locale.US);
+ switch (arch) {
+ case "amd64":
+ arch = "x86_64";
+ break;
+ case "aarch64":
+ arch = "aarch_64";
+ break;
+ default:
+ break;
+ }
+ return arch;
+ }
Review Comment:
Sure!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]