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

"hadoop fs -text" does not give a useful text representation of MapWritable objects

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: io
    • Labels:
      None
    • Target Version/s:

      Description

      If a sequence file contains MapWritable objects, running "hadoop fs -text" on the file prints the following for each MapWritable:

      org.apache.hadoop.io.MapWritable@4f8235ed

      To be more useful, it should print out the contents of the map instead. This can be done by adding a toString method to MapWritable, i.e. something like:

      public String toString()

      { return (new TreeMap<Writable, Writable>(instance)).toString(); }
      1. HADOOP-6842.002.patch
        1 kB
        Akira Ajisaka
      2. HADOOP-6842.patch
        0.4 kB
        Brandon Forehand

        Activity

        Hide
        aash Andrew Ash added a comment -

        Looks like nothing ever came of this? I'd appreciate a nicer toString() on MapWritable too

        Show
        aash Andrew Ash added a comment - Looks like nothing ever came of this? I'd appreciate a nicer toString() on MapWritable too
        Hide
        b4hand Brandon Forehand added a comment -

        I too would find this patch really useful. I've ran into this exact issue using sequence files containing MapWritables. I think delegating to the instance.toString() will just work even without using the new TreeMap invocation.

        It's been 3 years since this bug was reported, and it appears to be a one line fix. Is there anyone willing to make this change?

        Show
        b4hand Brandon Forehand added a comment - I too would find this patch really useful. I've ran into this exact issue using sequence files containing MapWritables. I think delegating to the instance.toString() will just work even without using the new TreeMap invocation. It's been 3 years since this bug was reported, and it appears to be a one line fix. Is there anyone willing to make this change?
        Hide
        b4hand Brandon Forehand added a comment -

        Here's a patch based on my personal reading of the code which appears to agree with the original reporter's proposal.

        There doesn't appear to be any reason to create an intermediate TreeMap, so I didn't do that.

        Show
        b4hand Brandon Forehand added a comment - Here's a patch based on my personal reading of the code which appears to agree with the original reporter's proposal. There doesn't appear to be any reason to create an intermediate TreeMap, so I didn't do that.
        Hide
        hadoopqa Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 javac. The patch appears to cause the build to fail.

        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2816//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 javac . The patch appears to cause the build to fail. Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2816//console This message is automatically generated.
        Hide
        slider Steven K. Wong added a comment -

        Sorry, I found I don't need a fix anymore after opening this jira. Feel free to own it. I used a TreeMap to ensure the entries are sorted in the printout (easier for me to read).

        Show
        slider Steven K. Wong added a comment - Sorry, I found I don't need a fix anymore after opening this jira. Feel free to own it. I used a TreeMap to ensure the entries are sorted in the printout (easier for me to read).
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 30s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        -1 javac 0m 34s The patch appears to cause the build to fail.



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / f1a152c
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6396/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 30s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 javac 0m 34s The patch appears to cause the build to fail. Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / f1a152c Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6396/console This message was automatically generated.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 51s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        -1 javac 7m 39s The applied patch generated 128 additional warning messages.
        +1 javadoc 9m 54s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 1m 7s There were no new checkstyle issues.
        +1 whitespace 0m 1s The patch has no lines that end in whitespace.
        +1 install 1m 34s mvn install still works.
        +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse.
        +1 findbugs 1m 46s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 common tests 22m 10s Tests passed in hadoop-common.
            60m 7s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 6ae2a0d
        javac https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/artifact/patchprocess/diffJavacWarnings.txt
        hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/artifact/patchprocess/testrun_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/testReport/
        Java 1.7.0_55
        uname Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 51s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 javac 7m 39s The applied patch generated 128 additional warning messages. +1 javadoc 9m 54s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 1m 7s There were no new checkstyle issues. +1 whitespace 0m 1s The patch has no lines that end in whitespace. +1 install 1m 34s mvn install still works. +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse. +1 findbugs 1m 46s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 common tests 22m 10s Tests passed in hadoop-common.     60m 7s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12593076/HADOOP-6842.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 6ae2a0d javac https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/artifact/patchprocess/diffJavacWarnings.txt hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/testReport/ Java 1.7.0_55 uname Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6415/console This message was automatically generated.
        Hide
        ajisakaa Akira Ajisaka added a comment -
        +  @Override
        +  String toString() {
        +    return instance.toString();
        +  }
        

        This method need to be public.

        Show
        ajisakaa Akira Ajisaka added a comment - + @Override + String toString() { + return instance.toString(); + } This method need to be public.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        v2 patch

        • Make toString() method to public
        • Add a regression test
        Show
        ajisakaa Akira Ajisaka added a comment - v2 patch Make toString() method to public Add a regression test
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 34s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 31s There were no new javac warning messages.
        +1 javadoc 9m 35s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 1m 4s There were no new checkstyle issues.
        -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix.
        +1 install 1m 34s mvn install still works.
        +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse.
        +1 findbugs 1m 39s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 common tests 23m 49s Tests passed in hadoop-common.
            61m 10s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12730896/HADOOP-6842.002.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 185e63a
        whitespace https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/artifact/patchprocess/whitespace.txt
        hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/artifact/patchprocess/testrun_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/testReport/
        Java 1.7.0_55
        uname Linux asf901.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 34s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 31s There were no new javac warning messages. +1 javadoc 9m 35s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 1m 4s There were no new checkstyle issues. -1 whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix. +1 install 1m 34s mvn install still works. +1 eclipse:eclipse 0m 32s The patch built with eclipse:eclipse. +1 findbugs 1m 39s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 common tests 23m 49s Tests passed in hadoop-common.     61m 10s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12730896/HADOOP-6842.002.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 185e63a whitespace https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/artifact/patchprocess/whitespace.txt hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/testReport/ Java 1.7.0_55 uname Linux asf901.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6507/console This message was automatically generated.
        Hide
        ajisakaa Akira Ajisaka added a comment -

        -1 whitespace

        The patch has no trailing whitespaces. I don't know why Jenkins said -1.

        Show
        ajisakaa Akira Ajisaka added a comment - -1 whitespace The patch has no trailing whitespaces. I don't know why Jenkins said -1.
        Hide
        revans2 Robert Joseph Evans added a comment -

        +1 looks good to me. I'll check this in.

        Show
        revans2 Robert Joseph Evans added a comment - +1 looks good to me. I'll check this in.
        Hide
        revans2 Robert Joseph Evans added a comment -

        Thanks Akira Ajisaka,

        I merged this into trunk and branch-2.

        Show
        revans2 Robert Joseph Evans added a comment - Thanks Akira Ajisaka , I merged this into trunk and branch-2.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #7776 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7776/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7776 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7776/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk-Java8 #191 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/191/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk-Java8 #191 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/191/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #922 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/922/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #922 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/922/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2120 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2120/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2120 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2120/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #180 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/180/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #180 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/180/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #190 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/190/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk-Java8 #190 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/190/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2138 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2138/)
        HADOOP-6842. "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90)

        • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java
        • hadoop-common-project/hadoop-common/CHANGES.txt
        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2138 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2138/ ) HADOOP-6842 . "hadoop fs -text" does not give a useful text representation of MapWritable objects (evans: rev cc17c83585f581d56e7c42b91464cd7a99e8cf90) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestMapWritable.java hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/MapWritable.java

          People

          • Assignee:
            ajisakaa Akira Ajisaka
            Reporter:
            slider Steven K. Wong
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development