Bryan Bende created NIFI-1902:
---------------------------------
Summary: CreateHadoopSequenceFile forces .sf suffix into filename
and key
Key: NIFI-1902
URL: https://issues.apache.org/jira/browse/NIFI-1902
Project: Apache NiFi
Issue Type: Bug
Affects Versions: 0.6.1
Reporter: Bryan Bende
Priority: Minor
CreateHadoopSequenceFile always adds .sf to the end of the filename:
<https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java>https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/CreateHadoopSequenceFile.java
155 final String fileName =
flowFile.getAttribute(CoreAttributes.FILENAME.key()) + ".sf";
156 flowFile = session.putAttribute(flowFile,
CoreAttributes.FILENAME.key(), fileName);
157 try {
158 flowFile = sequenceFileWriter.writeSequenceFile(flowFile,
session, getConfiguration(), compressionType);
159 session.transfer(flowFile, RELATIONSHIP_SUCCESS);
160 getLogger().info("Transferred flowfile {} to {}", new
Object[]{flowFile, RELATIONSHIP_SUCCESS});
161 } catch (ProcessException e) {
162 getLogger().error("Failed to create Sequence File. Transferring
{} to 'failure'", new Object[]{flowFile}, e);
163 session.transfer(flowFile, RELATIONSHIP_FAILURE);
164 }
Then uses the filename as the key when writing the sequence file:
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/SequenceFileWriterImpl.java
117 String key = flowFile.getAttribute(CoreAttributes.FILENAME.key());
118 writer.append(new Text(key), inStreamWritable
There should be a way to control the key so that it doesn't have to have the
.sf suffix.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)