[
https://issues.apache.org/jira/browse/HADOOP-13138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15289343#comment-15289343
]
Hudson commented on HADOOP-13138:
---------------------------------
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
> Unable to append to a SequenceFile with Compression.NONE.
> ---------------------------------------------------------
>
> Key: HADOOP-13138
> URL: https://issues.apache.org/jira/browse/HADOOP-13138
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 2.7.2
> Reporter: Gervais Mickaël
> Assignee: Vinayakumar B
> Priority: Critical
> Fix For: 2.8.0
>
> Attachments: HADOOP-13138-01.patch, HADOOP-13138-02.patch
>
>
> 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.
> {code:title=Failing code|borderStyle=solid}
> 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);
> {code}
> The following exeception is thrown when the file exists because compression
> option is checked:
> {code}
> 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)
> {code}
> This is due to the *codec* which is _null_:
> {code:title=SequenceFile.java|borderStyle=solid}
> 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");
> }
> {code}
> Thansk
> Mickaël
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]