-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add option for Append Processor to skip/allow empty values #105718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add option for Append Processor to skip/allow empty values #105718
Conversation
If one is using templates to generate values, this option can be helpful to avoid adding values that resolve into empty strings Fixes elastic#104813
Documentation preview: |
Pinging @elastic/es-data-management (Team:Data Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have this mirror the set
processor's ignore_empty_value
option, rather than creating a new option name with no precedent -- it's functionally the same as that option, right (albeit with the opposite sense)?
This feature is actually pretty useful. I'm my use-case, I'm appending a lot of fields. To keep checking if they are not null on context is pretty repetitive. Right now we have a painless script that removes all empty values. But would be awesome to have this out of the box. |
Hi @limotova, I've created a changelog YAML for you. |
It looks like this PR modifies one or more |
I'm resurrecting this PR and finally getting around to merging it (it is a terrible shame that I've let it sit here for so long, sorry for that!). I merged |
The original version of this PR predated `copy_from`, so the value wouldn't have been able to be null here. But now that `copy_from` exists we should handle null as well as empty strings.
Since it handles nulls now, this logic is identical.
This one is a bit trickier, so I've lampshaded the surprising part with a comment, and also there's a newly added test on main via
This arity of setFieldValue doesn't handle the single-value ignore_empty_value case (like in a set processor), it only handles the multi-value ignore_empty_values case (like in an append processor). The same thing applies to allow_duplicates, that is also an append-only concern.
Oops, my one commit comment got truncated because I wasn't careful about syntax, that was intended to read:
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
and don't use the return value from processor.execute
A todo list for myself of what I'd still like to see here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't approve my own PR haha but the changes look reasonable to me, thank you!
If one is using templates to generate values, this option can be helpful to avoid adding values that resolve into empty strings
Fixes #104813