You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Mark Bean <ma...@gmail.com> on 2018/01/18 22:11:07 UTC

Empty String in UpdateAttribute

UpdateAttribute supports stateful properties. In doing so, the validator
applied to the attributes changes. In the case where stateful properties
are not desired, the validator adds StandardValidators.NON_EMPTY_VALIDATOR.
This means the "Set Empty String" checkbox cannot be used.

One solution is to store state locally, and then set both the Stateful
Variables Initial Value and the dynamic property to the Empty String.

However, my question: why is the NON_EMPTY_VALIDATOR added (when stateful
is not set) versus just the ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR?

Thanks,
Mark

Re: Empty String in UpdateAttribute

Posted by Mark Bean <ma...@gmail.com>.
I agree with Brandon. We may need to update our flows, but we also should
return the empty string functionality (without requiring state) to the
processor. I'll open a JIRA ticket.

Thanks,
Mark


On Fri, Jan 19, 2018 at 10:04 PM, Brandon DeVries <br...@jhu.edu> wrote:

> Joe,
>
> Primarily, I believe the use case is legacy flows pre-dating the existence
> of "delete attribute" functionality. The most "correct" solution may be to
> delete the attribute, but that doesn't mean we should break backwards
> compatibility.
>
> Brandon
> On Fri, Jan 19, 2018 at 5:33 PM Joe Percivall <jp...@apache.org>
> wrote:
>
> > Hey Mark,
> >
> > Yeah, at the time I couldn't think of a use-case that a user would want
> to
> > set an attribute to empty so when I added the validator for the stateful
> > portion, I added the empty validator as well. That said, I don't see a
> need
> > to keep it if it's preventing your use-case. Curious, what is your
> use-case
> > that you always need to set an attribute to an empty string?
> >
> > - Joe
> >
> >
> >
> > On Fri, Jan 19, 2018 at 2:43 PM, Michael Moser <mo...@gmail.com>
> wrote:
> >
> > > Hi Mark,
> > >
> > > After reading the JIRA [1] and the PR for the UpdateAttribute
> > > modifications, I believe this was simply an unintended consequence of
> the
> > > code changes.  If you would like to write a new JIRA, then I'm sure we
> > can
> > > restore the "Set Empty String" functionality when not storing
> attributes
> > in
> > > local state.
> > >
> > > [1] - https://issues.apache.org/jira/browse/NIFI-1582
> > >
> > > -- Mike
> > >
> > >
> > > On Thu, Jan 18, 2018 at 5:11 PM, Mark Bean <ma...@gmail.com>
> > wrote:
> > >
> > > > UpdateAttribute supports stateful properties. In doing so, the
> > validator
> > > > applied to the attributes changes. In the case where stateful
> > properties
> > > > are not desired, the validator adds StandardValidators.NON_EMPTY_
> > > > VALIDATOR.
> > > > This means the "Set Empty String" checkbox cannot be used.
> > > >
> > > > One solution is to store state locally, and then set both the
> Stateful
> > > > Variables Initial Value and the dynamic property to the Empty String.
> > > >
> > > > However, my question: why is the NON_EMPTY_VALIDATOR added (when
> > stateful
> > > > is not set) versus just the ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR?
> > > >
> > > > Thanks,
> > > > Mark
> > > >
> > >
> >
> >
> >
> > --
> > *Joe Percivall*
> > linkedin.com/in/Percivall
> > e: jpercivall@apache.com
> >
>

Re: Empty String in UpdateAttribute

Posted by Brandon DeVries <br...@jhu.edu>.
Joe,

Primarily, I believe the use case is legacy flows pre-dating the existence
of "delete attribute" functionality. The most "correct" solution may be to
delete the attribute, but that doesn't mean we should break backwards
compatibility.

Brandon
On Fri, Jan 19, 2018 at 5:33 PM Joe Percivall <jp...@apache.org> wrote:

> Hey Mark,
>
> Yeah, at the time I couldn't think of a use-case that a user would want to
> set an attribute to empty so when I added the validator for the stateful
> portion, I added the empty validator as well. That said, I don't see a need
> to keep it if it's preventing your use-case. Curious, what is your use-case
> that you always need to set an attribute to an empty string?
>
> - Joe
>
>
>
> On Fri, Jan 19, 2018 at 2:43 PM, Michael Moser <mo...@gmail.com> wrote:
>
> > Hi Mark,
> >
> > After reading the JIRA [1] and the PR for the UpdateAttribute
> > modifications, I believe this was simply an unintended consequence of the
> > code changes.  If you would like to write a new JIRA, then I'm sure we
> can
> > restore the "Set Empty String" functionality when not storing attributes
> in
> > local state.
> >
> > [1] - https://issues.apache.org/jira/browse/NIFI-1582
> >
> > -- Mike
> >
> >
> > On Thu, Jan 18, 2018 at 5:11 PM, Mark Bean <ma...@gmail.com>
> wrote:
> >
> > > UpdateAttribute supports stateful properties. In doing so, the
> validator
> > > applied to the attributes changes. In the case where stateful
> properties
> > > are not desired, the validator adds StandardValidators.NON_EMPTY_
> > > VALIDATOR.
> > > This means the "Set Empty String" checkbox cannot be used.
> > >
> > > One solution is to store state locally, and then set both the Stateful
> > > Variables Initial Value and the dynamic property to the Empty String.
> > >
> > > However, my question: why is the NON_EMPTY_VALIDATOR added (when
> stateful
> > > is not set) versus just the ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR?
> > >
> > > Thanks,
> > > Mark
> > >
> >
>
>
>
> --
> *Joe Percivall*
> linkedin.com/in/Percivall
> e: jpercivall@apache.com
>

Re: Empty String in UpdateAttribute

Posted by Joe Percivall <jp...@apache.org>.
Hey Mark,

Yeah, at the time I couldn't think of a use-case that a user would want to
set an attribute to empty so when I added the validator for the stateful
portion, I added the empty validator as well. That said, I don't see a need
to keep it if it's preventing your use-case. Curious, what is your use-case
that you always need to set an attribute to an empty string?

- Joe



On Fri, Jan 19, 2018 at 2:43 PM, Michael Moser <mo...@gmail.com> wrote:

> Hi Mark,
>
> After reading the JIRA [1] and the PR for the UpdateAttribute
> modifications, I believe this was simply an unintended consequence of the
> code changes.  If you would like to write a new JIRA, then I'm sure we can
> restore the "Set Empty String" functionality when not storing attributes in
> local state.
>
> [1] - https://issues.apache.org/jira/browse/NIFI-1582
>
> -- Mike
>
>
> On Thu, Jan 18, 2018 at 5:11 PM, Mark Bean <ma...@gmail.com> wrote:
>
> > UpdateAttribute supports stateful properties. In doing so, the validator
> > applied to the attributes changes. In the case where stateful properties
> > are not desired, the validator adds StandardValidators.NON_EMPTY_
> > VALIDATOR.
> > This means the "Set Empty String" checkbox cannot be used.
> >
> > One solution is to store state locally, and then set both the Stateful
> > Variables Initial Value and the dynamic property to the Empty String.
> >
> > However, my question: why is the NON_EMPTY_VALIDATOR added (when stateful
> > is not set) versus just the ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR?
> >
> > Thanks,
> > Mark
> >
>



-- 
*Joe Percivall*
linkedin.com/in/Percivall
e: jpercivall@apache.com

Re: Empty String in UpdateAttribute

Posted by Michael Moser <mo...@gmail.com>.
Hi Mark,

After reading the JIRA [1] and the PR for the UpdateAttribute
modifications, I believe this was simply an unintended consequence of the
code changes.  If you would like to write a new JIRA, then I'm sure we can
restore the "Set Empty String" functionality when not storing attributes in
local state.

[1] - https://issues.apache.org/jira/browse/NIFI-1582

-- Mike


On Thu, Jan 18, 2018 at 5:11 PM, Mark Bean <ma...@gmail.com> wrote:

> UpdateAttribute supports stateful properties. In doing so, the validator
> applied to the attributes changes. In the case where stateful properties
> are not desired, the validator adds StandardValidators.NON_EMPTY_
> VALIDATOR.
> This means the "Set Empty String" checkbox cannot be used.
>
> One solution is to store state locally, and then set both the Stateful
> Variables Initial Value and the dynamic property to the Empty String.
>
> However, my question: why is the NON_EMPTY_VALIDATOR added (when stateful
> is not set) versus just the ATTRIBUTE_KEY_PROPERTY_NAME_VALIDATOR?
>
> Thanks,
> Mark
>