Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12111 [Umbrella] Split test-patch off into its own TLP
  3. HADOOP-12206

The preceding invocations of findlargest in test-patch effect the following invocation results

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • HADOOP-12111
    • HADOOP-12111
    • yetus

    Description

      Because $maxlen is not defined as a local variable, the preceding invocations effect the following results.

      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}"
      }
      

      Also,

      until [[ ${i} -gt ${sizeofa} ]]; do

      should be -eq or -ge.

      Attachments

        1. HADOOP-12206.HADOOP-12111.01.patch
          0.5 kB
          Kengo Seki
        2. HADOOP-12206.HADOOP-12111.02.patch
          0.6 kB
          Kengo Seki

        Activity

          People

            sekikn Kengo Seki
            sekikn Kengo Seki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: