You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "jacktengg (via GitHub)" <gi...@apache.org> on 2023/04/12 07:57:49 UTC

[GitHub] [doris] jacktengg opened a new pull request, #18587: [tools](profile) add script file to get all tree profiles off a query

jacktengg opened a new pull request, #18587:
URL: https://github.com/apache/doris/pull/18587

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Add a tool script that output query profiles of all fragment instances in tree form.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1516587824

   #### `sh-checker report`
   
   To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/4756403533") output.
   
   <details>
   <summary>shellcheck errors</summary>
   
   ```
   'shellcheck ' found no issues.
   
   ```
   </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
   @@ -32,16 +32,16 @@
    fi
    
    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
   @@ -62,25 +62,22 @@
    FRAGS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frags
    FRAG_IDS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frag_ids
    
   -mysql "${MYSQL_CMD_ARGS[@]}" -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > "${PLAN_GRAPH_FILE}"
   +mysql "${MYSQL_CMD_ARGS[@]}" -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 "${MYSQL_CMD_ARGS[@]}" -e "${sql}" | sed -n '2,$p' > "${frag_inst_ids_outfile}"
   -    while read -r line
   -    do
   +    mysql "${MYSQL_CMD_ARGS[@]}" -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 "${MYSQL_CMD_ARGS[@]}" -e "${sql}" | sed 's/\\n/\n/g' > "${frag_inst_profile}"
   -    done < "${frag_inst_ids_outfile}"
   -done < "${FRAG_IDS_FILE}"
   +        mysql "${MYSQL_CMD_ARGS[@]}" -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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1517340944

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] jacktengg commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1516596008

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1517340987

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18587:
URL: https://github.com/apache/doris/pull/18587#issuecomment-1504833248

   #### `sh-checker report`
   
   To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/4675966338") output.
   
   <details>
   <summary>shellcheck errors</summary>
   
   ```
   
   'shellcheck ' returned error 1 finding the following syntactical issues:
   
   ----------
   
   In tools/get_query_profiles.sh line 30:
     case "$opt" in
     ^-- SC2220 (warning): Invalid flags are not handled. Add a *) case.
     ^-- SC2249 (info): Consider adding a default *) case, even if it just exits with error.
           ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
   
   Did you mean: 
     case "${opt}" in
   
   
   In tools/get_query_profiles.sh line 32:
           QUERY_ID="$OPTARG"
                     ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
   
   Did you mean: 
           QUERY_ID="${OPTARG}"
   
   
   In tools/get_query_profiles.sh line 35:
           OUTPUT_DIR="$OPTARG"
                       ^-----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
   
   Did you mean: 
           OUTPUT_DIR="${OPTARG}"
   
   
   In tools/get_query_profiles.sh line 40:
   if [ -z $QUERY_ID ]; then
      ^--------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
           ^-------^ 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: 
   if [[ -z "$QUERY_ID" ]]; then
   
   
   In tools/get_query_profiles.sh line 46:
   if [ -z $OUTPUT_DIR ]; then
      ^----------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
           ^---------^ 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: 
   if [[ -z "$OUTPUT_DIR" ]]; then
   
   
   In tools/get_query_profiles.sh line 52:
   echo "get profiles for query $QUERY_ID, output: $OUTPUT_DIR"
                                ^-------^ 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: 
   echo "get profiles for query ${QUERY_ID}, output: ${OUTPUT_DIR}"
   
   
   In tools/get_query_profiles.sh line 60:
   mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > ${PLAN_GRAPH_FILE}
           ^------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
           ^------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                      ^---^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                      ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                              ^------------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                              ^------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                                                                                                            ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   mysql -h"$FE_HOST" -u$USER -P$FE_QUERY_PORT -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > ${PLAN_GRAPH_FILE}
   
   
   In tools/get_query_profiles.sh line 62:
   cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | sort | uniq >${FRAGS_FILE} 
       ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                             ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   cat "${PLAN_GRAPH_FILE}" | grep "Fragment: " | sort | uniq >"${FRAGS_FILE}" 
   
   
   In tools/get_query_profiles.sh line 63:
   cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | grep -o "[0-9]" | sort | uniq >${FRAG_IDS_FILE} 
       ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                               ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   cat "${PLAN_GRAPH_FILE}" | grep "Fragment: " | grep -o "[0-9]" | sort | uniq >"${FRAG_IDS_FILE}" 
   
   
   In tools/get_query_profiles.sh line 67:
   for frag_id in `cat ${FRAG_IDS_FILE}`
                  ^--------------------^ SC2013 (info): To read lines rather than words, pipe/redirect to a 'while read' loop.
                  ^--------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                       ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
   for frag_id in $(cat "${FRAG_IDS_FILE}")
   
   
   In tools/get_query_profiles.sh line 73:
       mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed -n '2,$p' > ${frag_inst_ids_outfile}
               ^------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
               ^------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                          ^---^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                          ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                                  ^------------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                                  ^------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                                                                               ^----------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
       mysql -h"$FE_HOST" -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed -n '2,$p' > ${frag_inst_ids_outfile}
   
   
   In tools/get_query_profiles.sh line 74:
       while read line
             ^--^ SC2162 (info): read without -r will mangle backslashes.
   
   
   In tools/get_query_profiles.sh line 76:
           frag_inst_id=`echo "$line" | cut -f1`
                        ^----------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                               ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
   
   Did you mean: 
           frag_inst_id=$(echo "${line}" | cut -f1)
   
   
   In tools/get_query_profiles.sh line 79:
           mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed 's/\\n/\n/g' > ${frag_inst_profile}
                   ^------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                   ^------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                              ^---^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                              ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                                      ^------------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters.
                                      ^------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required.
                                                                                      ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
           mysql -h"$FE_HOST" -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed 's/\\n/\n/g' > ${frag_inst_profile}
   
   
   In tools/get_query_profiles.sh line 80:
       done < ${frag_inst_ids_outfile}
              ^----------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
   
   Did you mean: 
       done < "${frag_inst_ids_outfile}"
   
   For more information:
     https://www.shellcheck.net/wiki/SC2220 -- Invalid flags are not handled. Ad...
     https://www.shellcheck.net/wiki/SC2013 -- To read lines rather than words, ...
     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
   @@ -27,14 +27,14 @@
    SHOW_QUERY_PROFILE="show query profile"
    
    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
   @@ -57,25 +57,22 @@
    FRAGS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frags
    FRAG_IDS_FILE=${OUTPUT_DIR}/${QUERY_ID}_frag_ids
    
   -mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' > ${PLAN_GRAPH_FILE}
   +mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${SHOW_QUERY_PROFILE} '/${QUERY_ID}'" | sed 's/\\n/\n/g' >${PLAN_GRAPH_FILE}
    
   -cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | sort | uniq >${FRAGS_FILE} 
   -cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | grep -o "[0-9]" | sort | uniq >${FRAG_IDS_FILE} 
   +cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | sort | uniq >${FRAGS_FILE}
   +cat ${PLAN_GRAPH_FILE} | grep "Fragment: " | grep -o "[0-9]" | sort | uniq >${FRAG_IDS_FILE}
    
   -
    # frag inst ids
   -for frag_id in `cat ${FRAG_IDS_FILE}`
   -do
   +for frag_id in $(cat ${FRAG_IDS_FILE}); do
        sql="${SHOW_QUERY_PROFILE} '/${QUERY_ID}/${frag_id}'"
        frag_inst_ids_outfile="${OUTPUT_DIR}/frag_${frag_id}_instances"
   -    
   +
        echo "sql: ${sql}"
   -    mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed -n '2,$p' > ${frag_inst_ids_outfile}
   -    while read line
   -    do
   -        frag_inst_id=`echo "$line" | cut -f1`
   +    mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed -n '2,$p' >${frag_inst_ids_outfile}
   +    while read 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 -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed 's/\\n/\n/g' > ${frag_inst_profile}
   -    done < ${frag_inst_ids_outfile}
   +        mysql -h$FE_HOST -u$USER -P$FE_QUERY_PORT -e "${sql}" | sed 's/\\n/\n/g' >${frag_inst_profile}
   +    done <${frag_inst_ids_outfile}
    done
   ----------
   
   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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] morningman merged pull request #18587: [tools](profile) add script file to get all tree profiles off a query

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #18587:
URL: https://github.com/apache/doris/pull/18587


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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