Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-892] Allow to use jar cmd not in PATH #902

Merged
merged 1 commit into from
May 9, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,12 @@ arrow::Status CompileCodes(std::string codes, std::string signature) {
}
std::string env_gcc = std::string(env_gcc_);

const char* env_jar_ = std::getenv("JAR");
if (env_jar_ == nullptr) {
env_jar_ = "jar";
}
std::string env_jar = std::string(env_jar_);

std::string env_codegen_option = " -O3 -march=native ";
char* env_codegen_option_ = std::getenv("CODEGEN_OPTION");

Expand Down Expand Up @@ -664,9 +670,9 @@ arrow::Status CompileCodes(std::string codes, std::string signature) {
" -lspark_columnar_jni -shared && ";

// package
cmd += "cd " + outpath + " && jar -cf spark-columnar-plugin-codegen-precompile-" +
signature + ".jar spark-columnar-plugin-codegen-" + signature + ".so 2>" +
logfile;
cmd += "cd " + outpath + " && " + env_jar +
" -cf spark-columnar-plugin-codegen-precompile-" + signature +
".jar spark-columnar-plugin-codegen-" + signature + ".so 2>" + logfile;

#ifdef DEBUG
std::cout << cmd << std::endl;
Expand Down