github-actions[bot] commented on PR #38009: URL: https://github.com/apache/doris/pull/38009#issuecomment-2232857097
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/9971693288") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 3: export PATH=$JAVA_HOME/bin:$PATH ^--------^ SC2154 (warning): JAVA_HOME is referenced but not assigned. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: export PATH=${JAVA_HOME}/bin:${PATH} In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 16: while [ ! -f "/opt/doris/fe/log/fe.log" ] ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: while [[ ! -f "/opt/doris/fe/log/fe.log" ]] In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 22: QE=$(cat /opt/doris/fe/log/fe.log|grep "QE service start.") ^----------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 23: echo $QE ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "${QE}" In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 24: while [ -z "$QE" ] ^----------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: while [[ -z "${QE}" ]] In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 28: QE=$(cat /opt/doris/fe/log/fe.log|grep "QE service start.") ^----------------------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 34: ERR=$(echo $MYSQL_ERROR|grep "Can't connect to MySQL") ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: ERR=$(echo "${MYSQL_ERROR}"|grep "Can't connect to MySQL") In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 35: echo $ERR ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "${ERR}" In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 36: while [ ! -z "$ERR" ] ^-------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-- SC2236 (style): Use -n instead of ! -z. ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: while [[ ! -z "${ERR}" ]] In samples/datalake/iceberg_and_paimon/scripts/start_doris.sh line 41: ERR=$(echo $MYSQL_ERROR|grep "Can't connect to MySQL") ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: ERR=$(echo "${MYSQL_ERROR}"|grep "Can't connect to MySQL") In samples/datalake/iceberg_and_paimon/start_all.sh line 1: set -e ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In samples/datalake/iceberg_and_paimon/start_all.sh line 33: cd ${curdir} || exit ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cd "${curdir}" || exit In samples/datalake/iceberg_and_paimon/start_all.sh line 40: download_source_file "${DORIS_PACKAGE}.tar.gz" "a4d8bc9730aca3a51294e87d7d5b3e8e" "$DORIS_DOWNLOAD_URL" ^-----------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: download_source_file "${DORIS_PACKAGE}.tar.gz" "a4d8bc9730aca3a51294e87d7d5b3e8e" "${DORIS_DOWNLOAD_URL}" In samples/datalake/iceberg_and_paimon/start_all.sh line 81: cp *.jar jars/ ^-- SC2035 (info): Use ./*glob* or -- *glob* so names with dashes won't become options. In samples/datalake/iceberg_and_paimon/start_all.sh line 86: echo $PWD ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "${PWD}" In samples/datalake/iceberg_and_paimon/start_doris_client.sh line 1: docker exec -it doris-iceberg-paimon-doris sh -c "mysql -u root -h doris -P 9030" ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In samples/datalake/iceberg_and_paimon/start_flink_client.sh line 1: docker exec -it doris-iceberg-paimon-jobmanager sql-client.sh -i /opt/flink/sql/init_tables.sql ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In samples/datalake/iceberg_and_paimon/start_spark_iceberg_client.sh line 1: docker exec -it doris-iceberg-paimon-spark spark-sql --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In samples/datalake/iceberg_and_paimon/start_spark_paimon_client.sh line 1: docker exec -it doris-iceberg-paimon-spark spark-sql --conf spark.sql.extensions=org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In samples/datalake/iceberg_and_paimon/stop_all.sh line 1: docker compose -f docker-compose.yml --env-file docker-compose.env down ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. For more information: https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y... https://www.shellcheck.net/wiki/SC2154 -- JAVA_HOME is referenced but not a... https://www.shellcheck.net/wiki/SC2035 -- Use ./*glob* or -- *glob* so name... ---------- You can address the above issues in one of three ways: 1. Manually correct the issue in the offending shell script; 2. Disable specific issues by adding the comment: # shellcheck disable=NNNN above the line that contains the issue, where NNNN is the error code; 3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file. ``` </details> <details> <summary>shfmt errors</summary> ``` 'shfmt ' returned error 1 finding the following formatting issues: ---------- --- samples/datalake/iceberg_and_paimon/scripts/start_doris.sh.orig +++ samples/datalake/iceberg_and_paimon/scripts/start_doris.sh @@ -13,32 +13,29 @@ rm -rf /opt/doris/be/storage/* /opt/doris/be/bin/start_be.sh --daemon -while [ ! -f "/opt/doris/fe/log/fe.log" ] -do +while [ ! -f "/opt/doris/fe/log/fe.log" ]; do echo "wait log..." sleep 2 done -QE=$(cat /opt/doris/fe/log/fe.log|grep "QE service start.") +QE=$(cat /opt/doris/fe/log/fe.log | grep "QE service start.") echo $QE -while [ -z "$QE" ] -do +while [ -z "$QE" ]; do echo "wait fe..." sleep 2 - QE=$(cat /opt/doris/fe/log/fe.log|grep "QE service start.") + QE=$(cat /opt/doris/fe/log/fe.log | grep "QE service start.") done echo 'doris is started' -MYSQL_ERROR=$(mysql -u root -P 9030 -h doris < /opt/doris-bin/init_doris.sql 2>&1) -ERR=$(echo $MYSQL_ERROR|grep "Can't connect to MySQL") +MYSQL_ERROR=$(mysql -u root -P 9030 -h doris </opt/doris-bin/init_doris.sql 2>&1) +ERR=$(echo $MYSQL_ERROR | grep "Can't connect to MySQL") echo $ERR -while [ ! -z "$ERR" ] -do +while [ ! -z "$ERR" ]; do echo "wait mysql..." sleep 2 - MYSQL_ERROR=$(mysql -u root -P 9030 -h doris < /opt/doris-bin/init_doris.sql 2>&1) - ERR=$(echo $MYSQL_ERROR|grep "Can't connect to MySQL") + MYSQL_ERROR=$(mysql -u root -P 9030 -h doris </opt/doris-bin/init_doris.sql 2>&1) + ERR=$(echo $MYSQL_ERROR | grep "Can't connect to MySQL") done echo 'doris is inited' --- samples/datalake/iceberg_and_paimon/start_all.sh.orig +++ samples/datalake/iceberg_and_paimon/start_all.sh @@ -28,7 +28,6 @@ fi } - curdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" cd ${curdir} || exit @@ -49,14 +48,14 @@ download_source_file "flink-s3-fs-hadoop-1.18.0.jar" "60b75e0fdc5ed05f1213b593c4b66556" "https://repo1.maven.org/maven2/org/apache/flink/flink-s3-fs-hadoop/1.18.0" if [[ ! -f "jdk1.8.0_202/SUCCESS" ]]; then - echo "Prepare jdk8 environment" - if [[ -d "jdk1.8.0_202" ]]; then - echo "Remove broken jdk1.8.0_202" - rm -rf jdk1.8.0_202 - fi - echo "Unpackage jdk1.8.0_202" - tar xzf jdk-8u202-linux-x64.tar.gz - touch jdk1.8.0_202/SUCCESS + echo "Prepare jdk8 environment" + if [[ -d "jdk1.8.0_202" ]]; then + echo "Remove broken jdk1.8.0_202" + rm -rf jdk1.8.0_202 + fi + echo "Unpackage jdk1.8.0_202" + tar xzf jdk-8u202-linux-x64.tar.gz + touch jdk1.8.0_202/SUCCESS fi if [[ ! -f "doris-bin/SUCCESS" ]]; then @@ -72,14 +71,14 @@ fi if [[ ! -f "jars/SUCCESS" ]]; then - echo "Prepare jars environment" - if [[ -d "jars" ]]; then - echo "Remove broken jars" - rm -rf jars - fi - mkdir jars - cp *.jar jars/ - touch jars/SUCCESS + echo "Prepare jars environment" + if [[ -d "jars" ]]; then + echo "Remove broken jars" + rm -rf jars + fi + mkdir jars + cp *.jar jars/ + touch jars/SUCCESS fi cd ../ @@ -89,10 +88,10 @@ docker compose -f docker-compose.yml --env-file docker-compose.env up -d echo "Start init iceberg and paimon tables..." -docker exec -it doris-iceberg-paimon-jobmanager sql-client.sh -f /opt/flink/sql/init_tables.sql >> init.log +docker exec -it doris-iceberg-paimon-jobmanager sql-client.sh -f /opt/flink/sql/init_tables.sql >>init.log echo "Start prepare data for tables..." -docker exec -it doris-iceberg-paimon-spark spark-sql --conf spark.sql.extensions=org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions -f /opt/sql/prepare_data.sql >> init.log +docker exec -it doris-iceberg-paimon-spark spark-sql --conf spark.sql.extensions=org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions -f /opt/sql/prepare_data.sql >>init.log echo "=============================================================================" echo "Success to launch doris+iceberg+paimon+flink+spark+minio environments!" --- samples/datalake/iceberg_and_paimon/start_doris_client.sh.orig +++ samples/datalake/iceberg_and_paimon/start_doris_client.sh --- samples/datalake/iceberg_and_paimon/start_flink_client.sh.orig +++ samples/datalake/iceberg_and_paimon/start_flink_client.sh --- samples/datalake/iceberg_and_paimon/start_spark_iceberg_client.sh.orig +++ samples/datalake/iceberg_and_paimon/start_spark_iceberg_client.sh --- samples/datalake/iceberg_and_paimon/start_spark_paimon_client.sh.orig +++ samples/datalake/iceberg_and_paimon/start_spark_paimon_client.sh --- samples/datalake/iceberg_and_paimon/stop_all.sh.orig +++ samples/datalake/iceberg_and_paimon/stop_all.sh ---------- You can reformat the above files to meet shfmt's requirements by typing: shfmt -w filename ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org