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

Commit

Permalink
[NSE-892] Allow to use jar cmd not in PATH (#902)
Browse files Browse the repository at this point in the history
This patch adds one more configuration for deployment with jar cmd
not in PATH

export JAR=/path/to/jar
--conf spark.executorEnv.JAR=/path/to/jar

Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
  • Loading branch information
zhouyuan authored May 9, 2022
1 parent d8ce978 commit e367f75
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit e367f75

Please sign in to comment.