Skip to content

Conversation

@stu-elastic
Copy link
Contributor

  • Json.load(String)
  • Json.dump(Object)
  • Json.dump(Object, boolean).

@stu-elastic stu-elastic added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache :Data Management/Watcher labels Oct 5, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Watcher)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@elasticmachine elasticmachine added Team:Data Management Meta label for data/management team Team:Core/Infra Meta label for core/infra team labels Oct 5, 2020
Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would prefer @rjernst look too since I wrote a few of the tests.

@jdconrad
Copy link
Contributor

jdconrad commented Oct 6, 2020

@stu-elastic Thanks for separating the docs out into a different PR. Still LGTM.

@stu-elastic
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but we also need to consider how this is documented for users. There should be something in the painless reference or watcher docs?

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stu-elastic
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

@stu-elastic stu-elastic merged commit f43e52d into elastic:master Oct 7, 2020
stu-elastic added a commit to stu-elastic/elasticsearch that referenced this pull request Oct 7, 2020
Co-authored-by: Honza Král
Co-authored-by: Jack Conradson
stu-elastic added a commit that referenced this pull request Oct 7, 2020
Co-authored-by: Honza Král
Co-authored-by: Jack Conradson
Backport of: f43e52d
@stu-elastic
Copy link
Contributor Author

Master (8.0): f43e52d
7.x (7.10): 8a61b95

@agone1
Copy link

agone1 commented Nov 17, 2020

Hello @stu-elastic !

Is there any chance that same functionality would be added to other painless context beside watcher?

@djmcgreal-cc
Copy link

Seems weird just to have it in Watcher. Specifically I was hoping to use it in painless execute API to allow unit testing of the result. Current behaviour prints out a Java .toString which is pretty impossible to parse correctly in clients.

@stu-elastic
Copy link
Contributor Author

Hi @agone1 and @djmcgreal-cc.

We're being cautious about rolling out this feature in other contexts because parsing JSON can create a lot of objects leading to GC pressure if it's run in, say, an aggregation.

@agone1 What contexts are you interested in? Can you cut a new issue for discussion?

@djmcgreal-cc Good point, I've added it (and some other per-context whitelists) to the execute api in #67035.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache :Data Management/Watcher >enhancement Team:Core/Infra Meta label for core/infra team Team:Data Management Meta label for data/management team v7.10.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants