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

Unable to append to a SequenceFile with Compression.NONE.

    Details

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

      Description

      Hi,

      I'm trying to use the append functionnality to an existing SequenceFile.

      If I set Compression.NONE, it works when the file is created, but when the file already exists I've a NullPointerException, by the way it works if I specify a compression with a codec.

      Failing code
      Option compression = compression(CompressionType.NONE);
      Option keyClass = keyClass(LongWritable.class);
      Option valueClass = valueClass(BytesWritable.class);
      Option out = file(dfs);
      Option append = appendIfExists(true);
      
      writer = createWriter(conf,
                   out,
                   append,
                   compression,
                   keyClass,
                   valueClass);
      

      The following exeception is thrown when the file exists because compression option is checked:

      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.hadoop.io.SequenceFile$Writer.<init>(SequenceFile.java:1119)
      	at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:273)
      

      This is due to the codec which is null:

      SequenceFile.java
       if (readerCompressionOption.value != compressionTypeOption.value
                      || !readerCompressionOption.codec.getClass().getName()
                          .equals(compressionTypeOption.codec.getClass().getName())) {
                    throw new IllegalArgumentException(
                        "Compression option provided does not match the file");
                  }
      

      Thansk

      Mickaël

      1. HADOOP-13138-01.patch
        5 kB
        Vinayakumar B
      2. HADOOP-13138-02.patch
        5 kB
        Vinayakumar B

        Issue Links

          Activity

          Hide
          vinayrpet Vinayakumar B added a comment -

          Attaching the patch for the above Problem.

          Thanks Gervais Mickaël for reporting the issue.

          Show
          vinayrpet Vinayakumar B added a comment - Attaching the patch for the above Problem. Thanks Gervais Mickaël for reporting the issue.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 12s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 7m 13s trunk passed
          +1 compile 6m 0s trunk passed with JDK v1.8.0_91
          +1 compile 6m 44s trunk passed with JDK v1.7.0_95
          +1 checkstyle 0m 28s trunk passed
          +1 mvnsite 1m 0s trunk passed
          +1 mvneclipse 0m 14s trunk passed
          +1 findbugs 1m 35s trunk passed
          +1 javadoc 0m 55s trunk passed with JDK v1.8.0_91
          +1 javadoc 1m 10s trunk passed with JDK v1.7.0_95
          +1 mvninstall 0m 42s the patch passed
          +1 compile 5m 52s the patch passed with JDK v1.8.0_91
          +1 javac 5m 52s the patch passed
          +1 compile 6m 44s the patch passed with JDK v1.7.0_95
          +1 javac 6m 44s the patch passed
          -1 checkstyle 0m 28s hadoop-common-project/hadoop-common: The patch generated 2 new + 278 unchanged - 0 fixed = 280 total (was 278)
          +1 mvnsite 0m 56s the patch passed
          +1 mvneclipse 0m 14s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 50s the patch passed
          +1 javadoc 0m 54s the patch passed with JDK v1.8.0_91
          +1 javadoc 1m 4s the patch passed with JDK v1.7.0_95
          +1 unit 7m 40s hadoop-common in the patch passed with JDK v1.8.0_91.
          +1 unit 7m 55s hadoop-common in the patch passed with JDK v1.7.0_95.
          +1 asflicense 0m 24s The patch does not generate ASF License warnings.
          61m 20s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:cf2ee45
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12803624/HADOOP-13138-01.patch
          JIRA Issue HADOOP-13138
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 504d206bb1a3 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
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / b7ac852
          Default Java 1.7.0_95
          Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_91 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_95
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt
          JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/console
          Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 12s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 13s trunk passed +1 compile 6m 0s trunk passed with JDK v1.8.0_91 +1 compile 6m 44s trunk passed with JDK v1.7.0_95 +1 checkstyle 0m 28s trunk passed +1 mvnsite 1m 0s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 1m 35s trunk passed +1 javadoc 0m 55s trunk passed with JDK v1.8.0_91 +1 javadoc 1m 10s trunk passed with JDK v1.7.0_95 +1 mvninstall 0m 42s the patch passed +1 compile 5m 52s the patch passed with JDK v1.8.0_91 +1 javac 5m 52s the patch passed +1 compile 6m 44s the patch passed with JDK v1.7.0_95 +1 javac 6m 44s the patch passed -1 checkstyle 0m 28s hadoop-common-project/hadoop-common: The patch generated 2 new + 278 unchanged - 0 fixed = 280 total (was 278) +1 mvnsite 0m 56s the patch passed +1 mvneclipse 0m 14s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 50s the patch passed +1 javadoc 0m 54s the patch passed with JDK v1.8.0_91 +1 javadoc 1m 4s the patch passed with JDK v1.7.0_95 +1 unit 7m 40s hadoop-common in the patch passed with JDK v1.8.0_91. +1 unit 7m 55s hadoop-common in the patch passed with JDK v1.7.0_95. +1 asflicense 0m 24s The patch does not generate ASF License warnings. 61m 20s Subsystem Report/Notes Docker Image:yetus/hadoop:cf2ee45 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12803624/HADOOP-13138-01.patch JIRA Issue HADOOP-13138 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 504d206bb1a3 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / b7ac852 Default Java 1.7.0_95 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_91 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_95 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/artifact/patchprocess/diff-checkstyle-hadoop-common-project_hadoop-common.txt JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9375/console Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          cnauroth Chris Nauroth added a comment -

          Vinayakumar B, thank you for the patch. This looks good to me. I think it will be ready to go after addressing the Checkstyle nitpicks.

          Show
          cnauroth Chris Nauroth added a comment - Vinayakumar B , thank you for the patch. This looks good to me. I think it will be ready to go after addressing the Checkstyle nitpicks.
          Hide
          vinayrpet Vinayakumar B added a comment -

          Attaching the patch with fixed checkstyle nits

          Show
          vinayrpet Vinayakumar B added a comment - Attaching the patch with fixed checkstyle nits
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 14s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 7m 40s trunk passed
          +1 compile 7m 18s trunk passed
          +1 checkstyle 0m 33s trunk passed
          +1 mvnsite 1m 11s trunk passed
          +1 mvneclipse 0m 16s trunk passed
          +1 findbugs 1m 31s trunk passed
          +1 javadoc 1m 0s trunk passed
          +1 mvninstall 0m 48s the patch passed
          +1 compile 7m 46s the patch passed
          +1 javac 7m 46s the patch passed
          +1 checkstyle 0m 32s the patch passed
          +1 mvnsite 1m 2s the patch passed
          +1 mvneclipse 0m 14s the patch passed
          +1 whitespace 0m 1s The patch has no whitespace issues.
          +1 findbugs 1m 39s the patch passed
          +1 javadoc 1m 4s the patch passed
          -1 unit 20m 6s hadoop-common in the patch failed.
          +1 asflicense 0m 29s The patch does not generate ASF License warnings.
          54m 12s



          Reason Tests
          Timed out junit tests org.apache.hadoop.http.TestHttpServerLifecycle



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:2c91fd8
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12804581/HADOOP-13138-02.patch
          JIRA Issue HADOOP-13138
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux d6c0880b76e2 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
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 8a9ecb7
          Default Java 1.8.0_91
          findbugs v3.0.0
          unit https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
          unit test logs https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/console
          Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 14s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 40s trunk passed +1 compile 7m 18s trunk passed +1 checkstyle 0m 33s trunk passed +1 mvnsite 1m 11s trunk passed +1 mvneclipse 0m 16s trunk passed +1 findbugs 1m 31s trunk passed +1 javadoc 1m 0s trunk passed +1 mvninstall 0m 48s the patch passed +1 compile 7m 46s the patch passed +1 javac 7m 46s the patch passed +1 checkstyle 0m 32s the patch passed +1 mvnsite 1m 2s the patch passed +1 mvneclipse 0m 14s the patch passed +1 whitespace 0m 1s The patch has no whitespace issues. +1 findbugs 1m 39s the patch passed +1 javadoc 1m 4s the patch passed -1 unit 20m 6s hadoop-common in the patch failed. +1 asflicense 0m 29s The patch does not generate ASF License warnings. 54m 12s Reason Tests Timed out junit tests org.apache.hadoop.http.TestHttpServerLifecycle Subsystem Report/Notes Docker Image:yetus/hadoop:2c91fd8 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12804581/HADOOP-13138-02.patch JIRA Issue HADOOP-13138 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d6c0880b76e2 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 8a9ecb7 Default Java 1.8.0_91 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt unit test logs https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9480/console Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          hadoopqa Hadoop QA added a comment -
          +1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 15s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 6m 46s trunk passed
          +1 compile 6m 58s trunk passed
          +1 checkstyle 0m 27s trunk passed
          +1 mvnsite 0m 56s trunk passed
          +1 mvneclipse 0m 13s trunk passed
          +1 findbugs 1m 24s trunk passed
          +1 javadoc 0m 55s trunk passed
          +1 mvninstall 0m 41s the patch passed
          +1 compile 6m 54s the patch passed
          +1 javac 6m 54s the patch passed
          +1 checkstyle 0m 27s the patch passed
          +1 mvnsite 0m 55s the patch passed
          +1 mvneclipse 0m 12s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 33s the patch passed
          +1 javadoc 1m 2s the patch passed
          +1 unit 8m 37s hadoop-common in the patch passed.
          +1 asflicense 0m 22s The patch does not generate ASF License warnings.
          39m 18s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:2c91fd8
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12804581/HADOOP-13138-02.patch
          JIRA Issue HADOOP-13138
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 9b12aacb4f77 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
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 8a9ecb7
          Default Java 1.8.0_91
          findbugs v3.0.0
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9485/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9485/console
          Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 15s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 6m 46s trunk passed +1 compile 6m 58s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 56s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 24s trunk passed +1 javadoc 0m 55s trunk passed +1 mvninstall 0m 41s the patch passed +1 compile 6m 54s the patch passed +1 javac 6m 54s the patch passed +1 checkstyle 0m 27s the patch passed +1 mvnsite 0m 55s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 33s the patch passed +1 javadoc 1m 2s the patch passed +1 unit 8m 37s hadoop-common in the patch passed. +1 asflicense 0m 22s The patch does not generate ASF License warnings. 39m 18s Subsystem Report/Notes Docker Image:yetus/hadoop:2c91fd8 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12804581/HADOOP-13138-02.patch JIRA Issue HADOOP-13138 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 9b12aacb4f77 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 Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 8a9ecb7 Default Java 1.8.0_91 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9485/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9485/console Powered by Apache Yetus 0.3.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          cnauroth Chris Nauroth added a comment -

          Vinayakumar B, thank you for the patch. +1. I have committed this to trunk, branch-2 and branch-2.8.

          Show
          cnauroth Chris Nauroth added a comment - Vinayakumar B , thank you for the patch. +1. I have committed this to trunk, branch-2 and branch-2.8.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-trunk-Commit #9814 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9814/)
          HADOOP-13138. Unable to append to a SequenceFile with Compression.NONE. (cnauroth: rev bad85f3e3a53b5fb692c77df6c11dcf968ad7e62)

          • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #9814 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9814/ ) HADOOP-13138 . Unable to append to a SequenceFile with Compression.NONE. (cnauroth: rev bad85f3e3a53b5fb692c77df6c11dcf968ad7e62) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSequenceFileAppend.java hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java
          Hide
          vkb VKB added a comment -

          Thanks Chris.

          Show
          vkb VKB added a comment - Thanks Chris.
          Hide
          vinayrpet Vinayakumar B added a comment -

          Thanks Chris

          Show
          vinayrpet Vinayakumar B added a comment - Thanks Chris

            People

            • Assignee:
              vinayrpet Vinayakumar B
              Reporter:
              mgervais Gervais Mickaël
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development