Joe Witt created NIFI-16313:
-------------------------------

             Summary: SegmentContent documents a filename rewrite it does not 
perform
                 Key: NIFI-16313
                 URL: https://issues.apache.org/jira/browse/NIFI-16313
             Project: Apache NiFi
          Issue Type: Task
            Reporter: Joe Witt


SegmentContent's generated documentation disagrees with what onTrigger actually 
writes.

@WritesAttributes currently has two entries, both named 
"segment.original.filename " (trailing space):

1. "The filename of the parent FlowFile"
2. "The filename will be updated to include the parent's filename, the segment 
index, and the segment count"

Neither is accurate as written. The runtime attribute is 
FragmentAttributes.SEGMENT_ORIGINAL_FILENAME ("segment.original.filename", no 
trailing space). The processor copies CoreAttributes.FILENAME onto that 
attribute and leaves filename itself unchanged. MergeContent reconstitutes the 
original FlowFile using segment.original.filename, so rewriting filename would 
be the wrong contract.

This is a documentation defect, not a behavior change. The trailing-space paste 
also appears on other Split* processors; those belong in a follow-up so this 
ticket stays about SegmentContent's false rewrite claim.

Proposed change:
- Keep a single @WritesAttribute for segment.original.filename (no trailing 
space) describing the parent's filename.
- Do not document a filename rewrite.
- Extend TestSegmentContent so segments keep the parent filename and set 
segment.original.filename to that same value, for both the split path and the 
"small enough not to segment" path.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to