Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13320

Fix arguments check in documentation for WordCount v2.0

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: documentation
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      This issue is affecting the documentation page, so the code is not covered by any tests. It's actually visible on the page:
      https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html#Example:_WordCount_v2.0
      On the Example: WordCount v2.0

      The actual arguments check is wrong, as it's never printing the message of the correct usage. So, running the code with no parameters, as in the following example:

      yarn jar /var/tmp/WordCount.jar task0.WordCount2
      

      I have got the following exception message in output:

      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
          at java.util.ArrayList.rangeCheck(ArrayList.java:635)
          at java.util.ArrayList.get(ArrayList.java:411)
          at task0.WordCount2.main(WordCount2.java:131)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
          at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      

      Intead than the expected friendly message:

       Usage: wordcount <in> <out> [-skip skipPatternFile]
      

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user pippobaudos opened a pull request:

          https://github.com/apache/hadoop/pull/105

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Doc. Contr…

          https://issues.apache.org/jira/browse/HADOOP-13320

          Fixed the check on the number of parameters.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/pippobaudos/hadoop feature/hadoop-13320

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/hadoop/pull/105.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #105


          commit 469bc02c6f932bc55fced96de33884cebbe92242
          Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com>
          Date: 2016-06-24T13:50:24Z

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user pippobaudos opened a pull request: https://github.com/apache/hadoop/pull/105 HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Doc. Contr… https://issues.apache.org/jira/browse/HADOOP-13320 Fixed the check on the number of parameters. You can merge this pull request into a Git repository by running: $ git pull https://github.com/pippobaudos/hadoop feature/hadoop-13320 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/105.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #105 commit 469bc02c6f932bc55fced96de33884cebbe92242 Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com> Date: 2016-06-24T13:50:24Z HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi
          Hide
          niccolo.becchi niccolo becchi added a comment -
          Show
          niccolo.becchi niccolo becchi added a comment - Created Pull Request on: https://github.com/apache/hadoop/pull/105
          Show
          templedf Daniel Templeton added a comment - I believe you mean here: https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html#Example:_WordCount_v2.0 Daniel Green , wanna take a whack at it?
          Hide
          niccolo.becchi niccolo becchi added a comment -

          Thanks Daniel Templeton, you are right, I have included it in the ticket's description.

          Show
          niccolo.becchi niccolo becchi added a comment - Thanks Daniel Templeton , you are right, I have included it in the ticket's description.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user pippobaudos closed the pull request at:

          https://github.com/apache/hadoop/pull/105

          Show
          githubbot ASF GitHub Bot added a comment - Github user pippobaudos closed the pull request at: https://github.com/apache/hadoop/pull/105
          Hide
          templedf Daniel Templeton added a comment -

          Gah. Sorry, missed the pull request.

          Show
          templedf Daniel Templeton added a comment - Gah. Sorry, missed the pull request.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user pippobaudos opened a pull request:

          https://github.com/apache/hadoop/pull/108

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Documentation

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/pippobaudos/hadoop HADOOP-13320

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/hadoop/pull/108.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #108


          commit 469bc02c6f932bc55fced96de33884cebbe92242
          Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com>
          Date: 2016-06-24T13:50:24Z

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user pippobaudos opened a pull request: https://github.com/apache/hadoop/pull/108 HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Documentation You can merge this pull request into a Git repository by running: $ git pull https://github.com/pippobaudos/hadoop HADOOP-13320 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/108.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #108 commit 469bc02c6f932bc55fced96de33884cebbe92242 Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com> Date: 2016-06-24T13:50:24Z HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user templedf commented on the issue:

          https://github.com/apache/hadoop/pull/108

          Looks like the right fix, but can you simplify the logic a little, i.e. (len != 2) && (len != 4))?

          Show
          githubbot ASF GitHub Bot added a comment - Github user templedf commented on the issue: https://github.com/apache/hadoop/pull/108 Looks like the right fix, but can you simplify the logic a little, i.e. (len != 2) && (len != 4)) ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user pippobaudos closed the pull request at:

          https://github.com/apache/hadoop/pull/108

          Show
          githubbot ASF GitHub Bot added a comment - Github user pippobaudos closed the pull request at: https://github.com/apache/hadoop/pull/108
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user pippobaudos commented on the issue:

          https://github.com/apache/hadoop/pull/108

          Hi @templedf I have updated the commit. Now should be the simplest expression to read...

          Show
          githubbot ASF GitHub Bot added a comment - Github user pippobaudos commented on the issue: https://github.com/apache/hadoop/pull/108 Hi @templedf I have updated the commit. Now should be the simplest expression to read...
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user pippobaudos reopened a pull request:

          https://github.com/apache/hadoop/pull/108

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Documentation

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/pippobaudos/hadoop HADOOP-13320

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/hadoop/pull/108.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #108


          commit 469bc02c6f932bc55fced96de33884cebbe92242
          Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com>
          Date: 2016-06-24T13:50:24Z

          HADOOP-13320. Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user pippobaudos reopened a pull request: https://github.com/apache/hadoop/pull/108 HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Documentation You can merge this pull request into a Git repository by running: $ git pull https://github.com/pippobaudos/hadoop HADOOP-13320 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/108.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #108 commit 469bc02c6f932bc55fced96de33884cebbe92242 Author: Niccolo Becchi <niccolo.becchi@bigdatapartnership.com> Date: 2016-06-24T13:50:24Z HADOOP-13320 . Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user pippobaudos commented on the issue:

          https://github.com/apache/hadoop/pull/108

          Thanks @templedf I have updated the pull request following the suggestion

          Show
          githubbot ASF GitHub Bot added a comment - Github user pippobaudos commented on the issue: https://github.com/apache/hadoop/pull/108 Thanks @templedf I have updated the pull request following the suggestion
          Hide
          templedf Daniel Templeton added a comment -

          LGTM. +1 (non-binding). Ray Chiang, here's a commit for you.

          Show
          templedf Daniel Templeton added a comment - LGTM. +1 (non-binding). Ray Chiang , here's a commit for you.
          Hide
          ajisakaa Akira Ajisaka added a comment -

          +1

          Show
          ajisakaa Akira Ajisaka added a comment - +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/hadoop/pull/108

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/hadoop/pull/108
          Hide
          ajisakaa Akira Ajisaka added a comment -

          Committed this to trunk, branch-2, and branch-2.8. Thanks niccolo becchi for the contribution and thanks Daniel Templeton for the review.

          Show
          ajisakaa Akira Ajisaka added a comment - Committed this to trunk, branch-2, and branch-2.8. Thanks niccolo becchi for the contribution and thanks Daniel Templeton for the review.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #10065 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10065/)
          HADOOP-13320. Fix arguments check in documentation for WordCount v2.0. (aajisaka: rev 9d46a49c746b9e1ef552dbb10d1e22f87db68c76)

          • hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #10065 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10065/ ) HADOOP-13320 . Fix arguments check in documentation for WordCount v2.0. (aajisaka: rev 9d46a49c746b9e1ef552dbb10d1e22f87db68c76) hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md

            People

            • Assignee:
              niccolo.becchi niccolo becchi
              Reporter:
              niccolo.becchi niccolo becchi
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development