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 ac388d191 [KYUUBI #5987] Always export KYUUBI_HOME in 
`load-kyuubi-env.sh`
ac388d191 is described below

commit ac388d191ddb6a910a5c74575d3ba6aa5a31e062
Author: Cheng Pan <[email protected]>
AuthorDate: Mon Jan 22 21:32:22 2024 +0800

    [KYUUBI #5987] Always export KYUUBI_HOME in `load-kyuubi-env.sh`
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This is a follow-up of #5987, after applying #5987, I found a regression, 
the Kyuubi Server Java process can not see KYUUBI_HOME env if we don't declare 
KYUUBI_HOME as an env var explicitly, this breaks the main resources jar 
discovery of the engine, and eventually fails the engine bootstrap.
    
    ## Describe Your Solution ๐Ÿ”ง
    
    Restore `export KYUUBI_HOME` logic in `load-kyuubi-env.sh`
    
    ## 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 ๐Ÿงช
    
    Build and start Kyuubi Server.
    ```
    export SPARK_HOME=/Users/chengpan/app/spark-3.5.0-bin-hadoop3
    build/dist --spark-provided --flink-provided --hive-provided
    dist/bin/kyuubi run
    ```
    
    Open session to launch a Spark engine
    ```
    dist/bin/beeline -u 'jdbc:hive2://0.0.0.0:10009/default'
    ```
    
    #### Behavior Without This Pull Request :coffin:
    
    A wrong `kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar` location was 
found.
    ```
    /Users/chengpan/app/spark-3.5.0-bin-hadoop3/bin/spark-submit \
            ...
            --proxy-user chengpan 
/Users/chengpan/Projects/apache-kyuubi/dist/jars/externals/kyuubi-spark-sql-engine/target/kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar
    ```
    
    #### Behavior With This Pull Request :tada:
    
    The correct `kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar` location was 
found.
    ```
    /Users/chengpan/app/spark-3.5.0-bin-hadoop3/bin/spark-submit \
            ...
            --proxy-user chengpan 
/Users/chengpan/Projects/apache-kyuubi/dist/externals/engines/spark/kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar
    ```
    
    ---
    
    # 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 #6004 from pan3793/5987-followup.
    
    Closes #5987
    
    a4e40b687 [Cheng Pan] [KYUUBI #5987] Always export KYUUBI_HOME in 
load-kyuubi-env.sh
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 bin/load-kyuubi-env.sh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/bin/load-kyuubi-env.sh b/bin/load-kyuubi-env.sh
index fdff1e0c5..779ac2bea 100755
--- a/bin/load-kyuubi-env.sh
+++ b/bin/load-kyuubi-env.sh
@@ -16,10 +16,7 @@
 # limitations under the License.
 #
 
-
-if [ -z "${KYUUBI_HOME}" ]; then
-  export KYUUBI_HOME="$(cd "$(dirname "$0")"/.. || exit; pwd)"
-fi
+export KYUUBI_HOME="${KYUUBI_HOME:-"$(cd "$(dirname "$0")"/.. || exit; pwd)"}"
 export KYUUBI_CONF_DIR="${KYUUBI_CONF_DIR:-"${KYUUBI_HOME}"/conf}"
 
 silent=0

Reply via email to