-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>bugTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra team
Description
I want to discuss the behavior described here by @hendrikmuhs :
I have a design question: Painless lets me get the source via e.g.
params['_source']. In the context of scripted metric you get a nasty side-
effect passing a value created from params['_source'] from one phase to the
next. Because it works by reference, the content of a painless variable
changes and you get wrong results. In order to work correctly you must
create a copy by e.g. using new HashMap(params['_source']).
I wonder whether this is a bug. Full example: https://discuss.elastic.co/t/latest-full-document-in-transform/221435/4
Questions:
- Is this a bug?
- What behavior do we expect here?
Metadata
Metadata
Assignees
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>bugTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra team