github-actions[bot] commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1516566682

   #### `sh-checker report`
   
   To get the full details, please check in the 
[job]("https://github.com/apache/doris/actions/runs/4756284928";) output.
   
   <details>
   <summary>shellcheck errors</summary>
   
   ```
   
   'shellcheck ' returned error 1 finding the following syntactical issues:
   
   ----------
   
   In tools/get_query_profiles.sh line 31:
       MYSQL_CMD="${MYSQL_CMD} -p'${PASSWORD}'"
                              ^--^ SC2089 (warning): Quotes/backslashes will be 
treated literally. Use an array.
   
   
   In tools/get_query_profiles.sh line 66:
   ${MYSQL_CMD} -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > 
"${PLAN_GRAPH_FILE}"
   ^----------^ SC2090 (warning): Quotes/backslashes in this variable will not 
be respected.
   
   
   In tools/get_query_profiles.sh line 79:
       ${MYSQL_CMD} -e "${sql}" | sed -n '2,$p' > "${frag_inst_ids_outfile}"
       ^----------^ SC2090 (warning): Quotes/backslashes in this variable will 
not be respected.
   
   
   In tools/get_query_profiles.sh line 85:
           ${MYSQL_CMD} -e "${sql}" | sed 's/\\n/\n/g' > ${frag_inst_profile}
           ^----------^ SC2090 (warning): Quotes/backslashes in this variable 
will not be respected.
                                                         ^------------------^ 
SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
           ${MYSQL_CMD} -e "${sql}" | sed 's/\\n/\n/g' > "${frag_inst_profile}"
   
   For more information:
     https://www.shellcheck.net/wiki/SC2089 -- Quotes/backslashes will be 
treate...
     https://www.shellcheck.net/wiki/SC2090 -- Quotes/backslashes in this 
variab...
     https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing 
...
   ----------
   
   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/get_query_profiles.sh.orig
   +++ tools/get_query_profiles.sh
   @@ -33,16 +33,16 @@
    echo "mysql cmd: ${MYSQL_CMD}"
    
    while getopts ":q:o:" opt; do
   -  case "${opt}" in
   -     q)
   +    case "${opt}" in
   +    q)
            QUERY_ID="${OPTARG}"
   -         ;;
   -     o)
   +        ;;
   +    o)
            OUTPUT_DIR="${OPTARG}"
   -         ;;
   -     *)
   -         ;;
   -   esac
   +        ;;
   +    *) ;;
   +
   +    esac
    done
    
    if [[ -z "${QUERY_ID}" ]]; then
   @@ -63,25 +63,22 @@
    FRAGS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frags
    FRAG_IDS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frag_ids
    
   -${MYSQL_CMD} -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > 
"${PLAN_GRAPH_FILE}"
   +${MYSQL_CMD} -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' 
>"${PLAN_GRAPH_FILE}"
    
   -grep "Fragment: " "${PLAN_GRAPH_FILE}" | sort | uniq > "${FRAGS_FILE}"
   -sed 's/Fragment: \{1,\}\([0-9]\{1,\}\)/\n\1\n/g' "${PLAN_GRAPH_FILE}" | 
grep -E  "^[0-9]{1,}$" | sort | uniq > "${FRAG_IDS_FILE}"
   +grep "Fragment: " "${PLAN_GRAPH_FILE}" | sort | uniq >"${FRAGS_FILE}"
   +sed 's/Fragment: \{1,\}\([0-9]\{1,\}\)/\n\1\n/g' "${PLAN_GRAPH_FILE}" | 
grep -E "^[0-9]{1,}$" | sort | uniq >"${FRAG_IDS_FILE}"
    
   -
    # frag inst ids
   -while read -r frag_id
   -do
   +while read -r frag_id; do
        sql="${SHOW_QUERY_PROFILE} '/${QUERY_ID}/${frag_id}'"
        frag_inst_ids_outfile="${OUTPUT_DIR}/frag_${frag_id}_instances"
   -    
   +
        echo "sql: ${sql}"
   -    ${MYSQL_CMD} -e "${sql}" | sed -n '2,$p' > "${frag_inst_ids_outfile}"
   -    while read -r line
   -    do
   +    ${MYSQL_CMD} -e "${sql}" | sed -n '2,$p' >"${frag_inst_ids_outfile}"
   +    while read -r line; do
            frag_inst_id=$(echo "${line}" | cut -f1)
            frag_inst_profile="${OUTPUT_DIR}/frag_${frag_id}_${frag_inst_id}"
            sql="${SHOW_QUERY_PROFILE} 
'/${QUERY_ID}/${frag_id}/${frag_inst_id}'"
   -        ${MYSQL_CMD} -e "${sql}" | sed 's/\\n/\n/g' > ${frag_inst_profile}
   -    done < "${frag_inst_ids_outfile}"
   -done < "${FRAG_IDS_FILE}"
   +        ${MYSQL_CMD} -e "${sql}" | sed 's/\\n/\n/g' >${frag_inst_profile}
   +    done <"${frag_inst_ids_outfile}"
   +done <"${FRAG_IDS_FILE}"
   ----------
   
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to