[
https://issues.apache.org/jira/browse/NIFI-16313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard updated NIFI-16313:
----------------------------------
Fix Version/s: 2.12.0
Assignee: Joe Witt
Resolution: Fixed
Status: Resolved (was: Patch Available)
> 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
> Assignee: Joe Witt
> Priority: Major
> Fix For: 2.12.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)