This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 9e7f2d040 [KYUUBI #6126] Filter blank engine home env
9e7f2d040 is described below
commit 9e7f2d040262bdb58a016badf3c946deab3db7a1
Author: wforget <[email protected]>
AuthorDate: Wed Mar 6 12:06:46 2024 +0800
[KYUUBI #6126] Filter blank engine home env
# :mag: Description
## Issue References ๐
This pull request fixes #6126
## Describe Your Solution ๐ง
Filter blank engine home env
## Types of changes :bookmark:
- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [X] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6127 from wForget/KYUUBI-6126.
Closes #6126
a42a8a611 [wforget] fix typo
55d2bfc34 [wforget] [KYUUBI-6126] Filter blank engine home env
Authored-by: wforget <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
.../src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
index c8c3f9c39..014c65f4b 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
@@ -25,6 +25,7 @@ import java.nio.file.{Files, Path, Paths}
import scala.collection.JavaConverters._
import com.google.common.collect.EvictingQueue
+import org.apache.commons.lang3.StringUtils
import org.apache.commons.lang3.StringUtils.containsIgnoreCase
import org.apache.kyuubi._
@@ -306,7 +307,7 @@ trait ProcBuilder {
*
* Take Spark as an example, we first lookup the SPARK_HOME from user
specified environments.
* If not found, we assume that it is a dev environment and lookup the
kyuubi-download's output
- * directly. If not found again, a `KyuubiSQLException` will be raised.
+ * directory. If not found again, a `KyuubiSQLException` will be raised.
* In summarize, we walk through
* `kyuubi.engineEnv.SPARK_HOME` ->
* System.env("SPARK_HOME") ->
@@ -319,7 +320,7 @@ trait ProcBuilder {
protected def getEngineHome(shortName: String): String = {
val homeKey = s"${shortName.toUpperCase}_HOME"
// 1. get from env, e.g. SPARK_HOME, FLINK_HOME
- env.get(homeKey)
+ env.get(homeKey).filter(StringUtils.isNotBlank)
.orElse {
// 2. get from $KYUUBI_HOME/externals/kyuubi-download/target
env.get(KYUUBI_HOME).flatMap { p =>