hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Wittenauer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-12206) The preceding invocations of findlargest in test-patch effect the following invocation results
Date Fri, 10 Jul 2015 15:28:04 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-12206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Allen Wittenauer updated HADOOP-12206:
--------------------------------------
       Resolution: Fixed
    Fix Version/s: HADOOP-12111
           Status: Resolved  (was: Patch Available)

+1 committed

thanks!

> The preceding invocations of findlargest in test-patch effect the following invocation
results
> ----------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-12206
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12206
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: yetus
>    Affects Versions: HADOOP-12111
>            Reporter: Kengo Seki
>            Assignee: Kengo Seki
>              Labels: newbie
>             Fix For: HADOOP-12111
>
>         Attachments: HADOOP-12206.HADOOP-12111.01.patch, HADOOP-12206.HADOOP-12111.02.patch
>
>
> Because $maxlen is not defined as a local variable, the preceding invocations effect
the following results.
> {code}
> function findlargest
> {
>   local column=$1
>   shift
>   local a=("$@")
>   local sizeofa=${#a[@]}
>   local i=0
>   until [[ ${i} -gt ${sizeofa} ]]; do
>     # shellcheck disable=SC2086
>     string=$( echo ${a[$i]} | cut -f$((column + 1)) -d\| )
>     if [[ ${#string} -gt $maxlen ]]; then
>       maxlen=${#string}
>     fi
>     i=$((i+1))
>   done
>   echo "${maxlen}"
> }
> {code}
> Also, {code}until [[ ${i} -gt ${sizeofa} ]]; do{code} should be -eq or -ge.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message