github-actions[bot] commented on PR #42445: URL: https://github.com/apache/doris/pull/42445#issuecomment-2453992396
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/11659900500") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In build.sh line 297: local submodule_path=$1 ^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 298: local submodule_name=$2 ^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 299: local archive_url=$3 ^------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 301: set +e ^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 302: cd "${DORIS_HOME}" ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 303: echo "Update ${submodule_name} submodule ..." ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 304: git submodule update --init --recursive "${submodule_path}" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 305: exit_code=$? ^----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 306: if [[ "${exit_code}" -eq 0 ]]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 307: cd "${submodule_path}" ^--------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 308: submodule_commit_id=$(git rev-parse HEAD) ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 309: cd - ^--^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 310: expect_submodule_commit_id=$(git ls-tree HEAD "${submodule_path}" | awk '{print $3}') ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 311: echo "Current commit ID of ${submodule_name} submodule: ${submodule_commit_id}, expected is ${expect_submodule_commit_id}" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 313: set -e ^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 314: if [[ "${exit_code}" -ne 0 ]]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 315: set +e ^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 317: submodule_commit=$(git ls-tree HEAD "${submodule_path}" | awk '{print $3}') ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 318: exit_code=$? ^----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 319: if [[ "${exit_code}" = "0" ]]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 320: commit_specific_url=$(echo "${archive_url}" | sed "s/refs\/heads/${submodule_commit}/") ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 322: commit_specific_url="${archive_url}" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 324: set -e ^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 325: echo "Update ${submodule_name} submodule failed, start to download and extract ${commit_specific_url}" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 327: mkdir -p "${DORIS_HOME}/${submodule_path}" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In build.sh line 328: curl -L "${commit_specific_url}" | tar -xz -C "${DORIS_HOME}/${submodule_path}" --strip-components=1 ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In tools/ssb-tools/bin/create-ssb-tables.sh line 111: if [ "${SCALE_FACTOR}" -eq 1 ]; then ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: if [[ "${SCALE_FACTOR}" -eq 1 ]]; then In tools/ssb-tools/bin/create-ssb-tables.sh line 123: elif [ "${SCALE_FACTOR}" -eq 100 ]; then ^---------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 100 ]]; then In tools/ssb-tools/bin/create-ssb-tables.sh line 135: elif [ "${SCALE_FACTOR}" -eq 1000 ]; then ^----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 1000 ]]; then In tools/ssb-tools/bin/create-ssb-tables.sh line 148: printf "${SCALE_FACTOR} scale is NOT supported currently\n" ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/ssb-tools/bin/run-ssb-queries.sh line 128: printf "Error: Failed to execute query q${i} (cold run). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/ssb-tools/bin/run-ssb-queries.sh line 138: printf "Error: Failed to execute query q${i} (hot run 1). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/ssb-tools/bin/run-ssb-queries.sh line 148: printf "Error: Failed to execute query q${i} (hot run 2). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpcds-tools/bin/create-tpcds-tables.sh line 106: printf "Error: Failed to drop the database ${DB}.\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpcds-tools/bin/create-tpcds-tables.sh line 111: printf "Error: Failed to create the database ${DB}.\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpcds-tools/bin/create-tpcds-tables.sh line 115: if [ ${SCALE_FACTOR} -eq 1 ]; then ^-----------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [[ "${SCALE_FACTOR}" -eq 1 ]]; then In tools/tpcds-tools/bin/create-tpcds-tables.sh line 121: elif [ ${SCALE_FACTOR} -eq 100 ]; then ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 100 ]]; then In tools/tpcds-tools/bin/create-tpcds-tables.sh line 127: elif [ ${SCALE_FACTOR} -eq 1000 ]; then ^--------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 1000 ]]; then In tools/tpcds-tools/bin/create-tpcds-tables.sh line 133: elif [ ${SCALE_FACTOR} -eq 10000 ]; then ^---------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 10000 ]]; then In tools/tpcds-tools/bin/run-tpcds-queries.sh line 133: printf "%s\n" "$output" >&2 ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${output}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 134: printf "Error: Failed to execute SQL command: 'show variables like %s\\G'\n" "$k" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "Error: Failed to execute SQL command: 'show variables like %s\\G'\n" "${k}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 138: if ! grep_output=$(grep " Value: " <<< "$output" 2>&1); then ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if ! grep_output=$(grep " Value: " <<< "${output}" 2>&1); then In tools/tpcds-tools/bin/run-tpcds-queries.sh line 139: printf "%s\n" "$grep_output" >&2 ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${grep_output}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 140: printf "Error: An error occurred while running 'grep' for variable '%s'.\n" "$k" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "Error: An error occurred while running 'grep' for variable '%s'.\n" "${k}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 144: if ! v=$(awk '{print $2}' <<< "$grep_output" 2>&1); then ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if ! v=$(awk '{print $2}' <<< "${grep_output}" 2>&1); then In tools/tpcds-tools/bin/run-tpcds-queries.sh line 145: printf "%s\n" "$v" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${v}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 150: if [[ -z $v ]]; then ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [[ -z ${v} ]]; then In tools/tpcds-tools/bin/run-tpcds-queries.sh line 151: printf "Warning: No 'Value:' found for variable '%s'.\n" "$k" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "Warning: No 'Value:' found for variable '%s'.\n" "${k}" >&2 In tools/tpcds-tools/bin/run-tpcds-queries.sh line 154: echo "$v" ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "${v}" In tools/tpcds-tools/bin/run-tpcds-queries.sh line 207: printf "Error: Failed to execute query q${i} (cold run). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpcds-tools/bin/run-tpcds-queries.sh line 218: printf "Error: Failed to execute query q${i} (hot run 1). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpcds-tools/bin/run-tpcds-queries.sh line 229: printf "Error: Failed to execute query q${i} (hot run 2). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpch-tools/bin/create-tpch-tables.sh line 112: if [ "${SCALE_FACTOR}" -eq 1 ]; then ^-------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: if [[ "${SCALE_FACTOR}" -eq 1 ]]; then In tools/tpch-tools/bin/create-tpch-tables.sh line 119: elif [ "${SCALE_FACTOR}" -eq 100 ]; then ^---------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 100 ]]; then In tools/tpch-tools/bin/create-tpch-tables.sh line 126: elif [ "${SCALE_FACTOR}" -eq 1000 ]; then ^----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 1000 ]]; then In tools/tpch-tools/bin/create-tpch-tables.sh line 133: elif [ "${SCALE_FACTOR}" -eq 10000 ]; then ^-----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: elif [[ "${SCALE_FACTOR}" -eq 10000 ]]; then In tools/tpch-tools/bin/run-tpch-queries.sh line 130: printf "%s\n" "$output" >&2 ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${output}" >&2 In tools/tpch-tools/bin/run-tpch-queries.sh line 131: printf "Error: Failed to execute SQL command: show variables like '%s'\G\n" "$k" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "Error: Failed to execute SQL command: show variables like '%s'\G\n" "${k}" >&2 In tools/tpch-tools/bin/run-tpch-queries.sh line 135: if ! grep_output=$(grep " Value: " <<< "$output" 2>&1); then ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if ! grep_output=$(grep " Value: " <<< "${output}" 2>&1); then In tools/tpch-tools/bin/run-tpch-queries.sh line 136: printf "%s\n" "$grep_output" >&2 ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${grep_output}" >&2 In tools/tpch-tools/bin/run-tpch-queries.sh line 141: if ! v=$(awk '{print $2}' <<< "$grep_output" 2>&1); then ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if ! v=$(awk '{print $2}' <<< "${grep_output}" 2>&1); then In tools/tpch-tools/bin/run-tpch-queries.sh line 142: printf "%s\n" "$v" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "%s\n" "${v}" >&2 In tools/tpch-tools/bin/run-tpch-queries.sh line 147: if [[ -z $v ]]; then ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [[ -z ${v} ]]; then In tools/tpch-tools/bin/run-tpch-queries.sh line 148: printf "Warning: No 'Value: ' found for variable '%s'.\n" "$k" >&2 ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: printf "Warning: No 'Value: ' found for variable '%s'.\n" "${k}" >&2 In tools/tpch-tools/bin/run-tpch-queries.sh line 152: echo "$v" ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "${v}" In tools/tpch-tools/bin/run-tpch-queries.sh line 194: printf "Error: Failed to execute query q${i} (cold run). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpch-tools/bin/run-tpch-queries.sh line 203: printf "Error: Failed to execute query q${i} (hot run 1). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In tools/tpch-tools/bin/run-tpch-queries.sh line 212: printf "Error: Failed to execute query q${i} (hot run 2). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". For more information: https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable... ---------- 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: ---------- --- tools/tpcds-tools/bin/run-tpcds-queries.sh.orig +++ tools/tpcds-tools/bin/run-tpcds-queries.sh @@ -135,13 +135,13 @@ exit 1 fi - if ! grep_output=$(grep " Value: " <<< "$output" 2>&1); then + if ! grep_output=$(grep " Value: " <<<"$output" 2>&1); then printf "%s\n" "$grep_output" >&2 printf "Error: An error occurred while running 'grep' for variable '%s'.\n" "$k" >&2 exit 1 fi - if ! v=$(awk '{print $2}' <<< "$grep_output" 2>&1); then + if ! v=$(awk '{print $2}' <<<"$grep_output" 2>&1); then printf "%s\n" "$v" >&2 printf "Error: awk command failed while processing the grep output.\n" >&2 exit 1 @@ -202,8 +202,8 @@ echo -ne "query${i}\t" | tee -a result.csv start=$(date +%s%3N) if ! mysql -h"${FE_HOST}" -u"${USER}" -P"${FE_QUERY_PORT}" -D"${DB}" --comments \ - <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ - >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then + <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ + >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then printf "Error: Failed to execute query q${i} (cold run). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 continue fi @@ -213,8 +213,8 @@ start=$(date +%s%3N) if ! mysql -h"${FE_HOST}" -u"${USER}" -P"${FE_QUERY_PORT}" -D"${DB}" --comments \ - <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ - >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then + <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ + >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then printf "Error: Failed to execute query q${i} (hot run 1). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 continue fi @@ -224,8 +224,8 @@ start=$(date +%s%3N) if ! mysql -h"${FE_HOST}" -u"${USER}" -P"${FE_QUERY_PORT}" -D"${DB}" --comments \ - <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ - >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then + <"${TPCDS_QUERIES_DIR}/query${i}.sql" \ + >"${RESULT_DIR}/result${i}.out" 2>"${RESULT_DIR}/result${i}.log"; then printf "Error: Failed to execute query q${i} (hot run 2). Check the log: ${RESULT_DIR}/result${i}.log\n" >&2 continue fi --- tools/tpch-tools/bin/create-tpch-tables.sh.orig +++ tools/tpch-tools/bin/create-tpch-tables.sh @@ -104,7 +104,7 @@ echo "SF: ${SCALE_FACTOR}" if ! mysql -h"${FE_HOST}" -u"${USER}" -P"${FE_QUERY_PORT}" \ - -e "CREATE DATABASE IF NOT EXISTS ${DB}" 2>&1; then + -e "CREATE DATABASE IF NOT EXISTS ${DB}" 2>&1; then printf "Error: Failed to create database '%s'.\n" "${DB}" >&2 exit 1 fi --- tools/tpch-tools/bin/run-tpch-queries.sh.orig +++ tools/tpch-tools/bin/run-tpch-queries.sh @@ -132,13 +132,13 @@ exit 1 fi - if ! grep_output=$(grep " Value: " <<< "$output" 2>&1); then + if ! grep_output=$(grep " Value: " <<<"$output" 2>&1); then printf "%s\n" "$grep_output" >&2 printf "Error: grep command failed while processing SQL output.\n" >&2 exit 1 fi - if ! v=$(awk '{print $2}' <<< "$grep_output" 2>&1); then + if ! v=$(awk '{print $2}' <<<"$grep_output" 2>&1); then printf "%s\n" "$v" >&2 printf "Error: awk command failed while processing the grep output.\n" >&2 exit 1 ---------- 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