[
https://issues.apache.org/jira/browse/NIFI-15649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard updated NIFI-15649:
----------------------------------
Component/s: Core Framework
(was: Extensions)
> Add Expression Language functions compactDelimitedList() and
> trimDelimitedList() for delimited string cleanup
> -------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-15649
> URL: https://issues.apache.org/jira/browse/NIFI-15649
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Reporter: Richard Scott
> Assignee: Richard Scott
> Priority: Minor
> Fix For: 2.9.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Add two new Apache NiFi Expression Language functions to simplify cleanup of
> list-like attributes represented as delimited strings.
> In NiFi flows, delimited attributes are often built from optional values or
> accumulated over time. This commonly produces leading, trailing, or repeated
> delimiters, resulting in empty tokens such as:
> * {{,a,b,c,,}}
> * {{alpha,,beta,,,gamma}}
> * {{,,a,,b,,}}
> Today this usually requires brittle chains of {{{}replace{}}}, regex, or
> custom scripting. Dedicated Expression Language functions would make these
> common cleanup operations easier to read, easier to maintain, and more
> intention-revealing in flows.
>
> h3. Proposed Functions
> h4. {{compactDelimitedList(delimiter)}}
> Removes *all empty tokens* from a delimited string, preserves the order of
> non-empty tokens, and rejoins using the same delimiter.
> Examples with delimiter {{{},{}}}:
> * {{,a,b,c,,}} → {{a,b,c}}
> * {{a,,b,,,c}} → {{a,b,c}}
> * {{,,,}} → ``
> h4. {{trimDelimitedList(delimiter)}}
> Removes only *leading and trailing empty tokens* from a delimited string,
> while preserving {*}interior empty tokens{*}, preserving token order, and
> rejoining using the same delimiter.
> Examples with delimiter {{{},{}}}:
> * {{,a,b,c,,}} → {{a,b,c}}
> * {{,,a,,b,,}} → {{a,,b}}
> * {{a,,b,,,c}} → {{a,,b,,,c}}
> * {{,,,}} → ``
--
This message was sent by Atlassian Jira
(v8.20.10#820010)