Skip to content
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 immutable tuples to Painless #91714

Open
thecoop opened this issue Nov 18, 2022 · 4 comments
Open

Add immutable tuples to Painless #91714

thecoop opened this issue Nov 18, 2022 · 4 comments
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >feature Team:Core/Infra Meta label for core/infra team

Comments

@thecoop
Copy link
Member

thecoop commented Nov 18, 2022

Python has had tuples since it was created, Java has gone with records instead.

It would be good to add built-in immutable tuples to Painless - an object that is just defined as (10, "foo", new ArrayList<>()). Such objects would probably only be accessible as def, with built-in implementations for 1 to N-tuples under the hood.

The javatuples library is probably a good starting point for implementation/methods.

@thecoop thecoop added >feature :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache labels Nov 18, 2022
@thecoop
Copy link
Member Author

thecoop commented Nov 18, 2022

Note this would be instead of #75431

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Nov 18, 2022
@elasticsearchmachine
Copy link
Collaborator

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

@jdconrad
Copy link
Contributor

What are the use cases you see for this feature? As none of the libraries we currently support would support these, I'm having trouble envisioning how useful something like this would be.

@thecoop
Copy link
Member Author

thecoop commented Nov 21, 2022

I'm primarily thinking of map keys for grouping/sorting, and for data transfer within stream-like constructs.

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 >feature Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

3 participants