Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI apache#5987] Enhance KYUUBI_HOME detection in shell script to…
… handle softlink cases # 🔍 Description ## Issue References 🔗 This pull request fixes apache#5987 Modify the logic in the beeline script that specifies the KYUUBI_HOME environment variable. ## Describe Your Solution 🔧 If the environment has already declared KYUUBI_HOME, it should use the pre-declared KYUUBI_HOME instead of forcefully specifying the parent directory of the current one. ## Types of changes 🔖 - [ ] 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 ⚰️ 1. set soft link: `ln -s /opt/soft/kyuubi/kyuubi/bin/beeline /usr/bin/kyuubi-beeline` 2. set env like: `export KYUUBI_HOME=/opt/soft/kyuubi/kyuubi` 3. run kyuubi-beeline: `kyuubi-beeline -u "jdbc:hive2://xx.xx.xx.xx:2181,xx.xx.xx.xx:2181,xx.xx.xx.xx:2181/tmp;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=kyuubi;principal=hive/_HOSTxxx"` 4. command will fail: `/bin/kyuubi-beeline: line 27: //bin/load-kyuubi-env.sh: No such file or directory Error: JAVA_HOME IS NOT SET! CANNOT PROCEED.` #### Behavior With This Pull Request 🎉 1. set soft link: `ln -s /opt/soft/kyuubi/kyuubi/bin/beeline /usr/bin/kyuubi-beeline` 2. set env like: `export KYUUBI_HOME=/opt/soft/kyuubi/kyuubi` 3. run kyuubi-beeline: `kyuubi-beeline -u "jdbc:hive2://xx.xx.xx.xx:2181,xx.xx.xx.xx:2181,xx.xx.xx.xx:2181/tmp;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=kyuubi;principal=hive/_HOSTxxx"` 4. command will success #### Related Unit Tests --- # Checklist 📝 - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes apache#5988 from Emor-nj/kyuubi-beeline. Closes apache#5987 3a988e0 [Emor-nj] fix KYUUBI_HOME is always empty in load-kyuubi-env.sh cc70387 [Emor-nj] fix load-kyuubi-env.sh a101428 [Emor-nj] Remove unnecessary exports. f48db3f [Emor-nj] uniformly modify all related scripts. 35215b9 [Emor-nj] Modify the logic in the beeline script that specifies the KYUUBI_HOME environment variable. Authored-by: Emor-nj <[email protected]> Signed-off-by: Cheng Pan <[email protected]>
- Loading branch information