hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinayakumar B (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-13138) Unable to append to a SequenceFile with Compression.NONE.
Date Thu, 12 May 2016 10:12:12 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-13138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vinayakumar B updated HADOOP-13138:
-----------------------------------
    Attachment: HADOOP-13138-01.patch

Attaching the patch for the above Problem.

Thanks [~mgervais] for reporting the issue.

> 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
>         Attachments: HADOOP-13138-01.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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message