This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new cc7c5a6ce57 [fix](shellcheck) fix hive-metastore and enable shellcheck 
in docker (#46496) (#46573)
cc7c5a6ce57 is described below

commit cc7c5a6ce5728eb89500a4bca254199155d179fe
Author: Mingyu Chen (Rayner) <morning...@163.com>
AuthorDate: Wed Jan 8 11:07:44 2025 +0800

    [fix](shellcheck) fix hive-metastore and enable shellcheck in docker 
(#46496) (#46573)
    
    cherry-pick #46496
    
    Co-authored-by: Socrates <suyit...@selectdb.com>
---
 .github/workflows/code-checks.yml                  |  2 +-
 .../docker-compose/hive/scripts/hive-metastore.sh  | 32 +++++++++++-----------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/code-checks.yml 
b/.github/workflows/code-checks.yml
index 4fe4090b516..43a4f74d2a6 100644
--- a/.github/workflows/code-checks.yml
+++ b/.github/workflows/code-checks.yml
@@ -50,7 +50,7 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
           sh_checker_comment: true
-          sh_checker_exclude: .git .github ^docker ^thirdparty/src 
^thirdparty/installed ^ui ^docs/node_modules ^tools/clickbench-tools ^extension 
^output ^fs_brokers/apache_hdfs_broker/output (^|.*/)Dockerfile$ 
^be/src/apache-orc ^be/src/clucene ^pytest ^samples
+          sh_checker_exclude: .git .github ^docker/compilation ^docker/runtime 
^thirdparty/src ^thirdparty/installed ^ui ^docs/node_modules 
^tools/clickbench-tools ^extension ^output 
^fs_brokers/apache_hdfs_broker/output (^|.*/)Dockerfile$ ^be/src/apache-orc 
^be/src/clucene ^pytest ^samples
 
   preparation:
     name: "Clang Tidy Preparation"
diff --git a/docker/thirdparties/docker-compose/hive/scripts/hive-metastore.sh 
b/docker/thirdparties/docker-compose/hive/scripts/hive-metastore.sh
index b9982c2ed60..7ff6bc4c62f 100755
--- a/docker/thirdparties/docker-compose/hive/scripts/hive-metastore.sh
+++ b/docker/thirdparties/docker-compose/hive/scripts/hive-metastore.sh
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-set -x
+set -e -x
 
 nohup /opt/hive/bin/hive --service metastore &
 
@@ -27,14 +27,14 @@ sleep 10s
 # new cases should use separate dir
 hadoop fs -mkdir -p /user/doris/suites/
 
-lockfile1 = "mnt/scripts/run-data.lock"
+lockfile1="/mnt/scripts/run-data.lock"
 
 # wait lockfile
-while [ -f "$lockfile1" ]; do
+while [[ -f "${lockfile1}" ]]; do
     sleep 10
 done
 
-touch "$lockfile1"
+touch "${lockfile1}"
 
 DATA_DIR="/mnt/scripts/data/"
 find "${DATA_DIR}" -type f -name "run.sh" -print0 | xargs -0 -n 1 -P 10 -I {} 
sh -c '
@@ -45,16 +45,16 @@ find "${DATA_DIR}" -type f -name "run.sh" -print0 | xargs 
-0 -n 1 -P 10 -I {} sh
     echo "Script: {} executed in $EXECUTION_TIME seconds"
 '
 
-rm -f "$lockfile1"
+rm -f "${lockfile1}"
 
-lockfile2 = "mnt/scripts/download-data.lock"
+lockfile2="/mnt/scripts/download-data.lock"
 
 # wait lockfile
-while [ -f "$lockfile2" ]; do
+while [[ -f "${lockfile2}" ]]; do
     sleep 10
 done
 
-touch "$lockfile2"
+touch "${lockfile2}"
 
 # if you test in your local,better use # to annotation section about tpch1.db
 if [[ ! -d "/mnt/scripts/tpch1.db" ]]; then
@@ -89,39 +89,39 @@ else
     echo "/mnt/scripts/tvf_data exist, continue !"
 fi
 
-rm -f "$lockfile2"
+rm -f "${lockfile2}"
 
 # put data file
 ## put tpch1
-if [ -z "$(ls /mnt/scripts/tpch1.db)" ]; then
+if [[ -z "$(ls /mnt/scripts/tpch1.db)" ]]; then
     echo "tpch1.db does not exist"
     exit 1
 fi
 hadoop fs -mkdir -p /user/doris/
 hadoop fs -put /mnt/scripts/tpch1.db /user/doris/
-if [ -z "$(hadoop fs -ls /user/doris/tpch1.db)" ]; then
+if [[ -z "$(hadoop fs -ls /user/doris/tpch1.db)" ]]; then
     echo "tpch1.db put failed"
     exit 1
 fi
 
 ## put paimon1
-if [ -z "$(ls /mnt/scripts/paimon1)" ]; then
+if [[ -z "$(ls /mnt/scripts/paimon1)" ]]; then
     echo "paimon1 does not exist"
     exit 1
 fi
 hadoop fs -put /mnt/scripts/paimon1 /user/doris/
-if [ -z "$(hadoop fs -ls /user/doris/paimon1)" ]; then
+if [[ -z "$(hadoop fs -ls /user/doris/paimon1)" ]]; then
     echo "paimon1 put failed"
     exit 1
 fi
 
 ## put tvf_data
-if [ -z "$(ls /mnt/scripts/tvf_data)" ]; then
+if [[ -z "$(ls /mnt/scripts/tvf_data)" ]]; then
     echo "tvf_data does not exist"
     exit 1
 fi
 hadoop fs -put /mnt/scripts/tvf_data /user/doris/
-if [ -z "$(hadoop fs -ls /user/doris/tvf_data)" ]; then
+if [[ -z "$(hadoop fs -ls /user/doris/tvf_data)" ]]; then
     echo "tvf_data put failed"
     exit 1
 fi
@@ -143,7 +143,7 @@ START_TIME=$(date +%s)
 hive -f /mnt/scripts/create_view_scripts/create_view.hql
 END_TIME=$(date +%s)
 EXECUTION_TIME=$((END_TIME - START_TIME))
-echo "Script: create_view.hql executed in $EXECUTION_TIME seconds"
+echo "Script: create_view.hql executed in ${EXECUTION_TIME} seconds"
 
 touch /mnt/SUCCESS
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to