-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
add copy_from parameter for set ingest processor #63540
Conversation
Would it be possible to modify the |
@danhermann, the usage of |
Thanks, @gaobinlong. Your explanation makes sense and we'd like to move forward with the |
@elasticmachine update branch |
@elasticmachine ok to test |
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.
@gaobinlong, from my testing, this looks good and works well. I left some minor wording changes below as well as a request to split up one of the unit tests. I think we can get it merged after that.
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/SetProcessor.java
Outdated
Show resolved
Hide resolved
...es/ingest-common/src/test/java/org/elasticsearch/ingest/common/SetProcessorFactoryTests.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Dan Hermann <[email protected]>
Co-authored-by: Dan Hermann <[email protected]>
…ommon/SetProcessor.java Co-authored-by: Dan Hermann <[email protected]>
@elasticmachine test this please. |
Thanks, @gaobinlong. This looks good. The last failing test is due to the fact that line 120 in |
@elasticmachine update branch |
Thanks again for this contribution, @gaobinlong! I'll get it merged and backported. |
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
Relates to #55682 and #51046, and refractor the code of #56985.
The main point of this PR is adding a
copy_from
parameter for set ingest processor to supportcopy
the value of one field to another. We can copyboolean
,number
,array
,object
and other data types by the parametercopy_from
instead of usingtemplate snippet
which only producesstring
value.Why adding a new parameter to implement the
copy
function but not modifying thetemplate snippet
so that it can produceobject
orarray
value ? I think we can make it compatible with older versions, users can still usetemplate snippet
to copy the producedstring
value to other field, but also can usecopy_from
to copyobject
orarray
value from one field to another.The main changes are:
copy_from
parameter for set ingest processor.