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 BinaryDocValuesField to replace BytesRef (ScriptDocValues) #79760

Merged
merged 19 commits into from
Oct 29, 2021

Conversation

jdconrad
Copy link
Contributor

@jdconrad jdconrad commented Oct 25, 2021

This change creates the classes required for the scripting fields API to provide a binary field composed of doc values using BytesRef as the representation returned to the user as a value.

@jdconrad jdconrad added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v8.0.0 labels Oct 25, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Oct 25, 2021
@elasticmachine
Copy link
Collaborator

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

@jdconrad
Copy link
Contributor Author

@stu-elastic Thanks for solid feedback. Switched this over to byte[] and added utility to get these at utf8 to String.

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.

I have a couple thoughts

@jdconrad
Copy link
Contributor Author

@stu-elastic @rjernst This is ready for another round of review.

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.

A couple thoughts, nothing blocking

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

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

We can do the error messages separately.

However, please don't commit until the spotless changes are gone for files otherwise untouched by this PR.

@jdconrad jdconrad added v8.1.0 and removed v8.0.0 labels Oct 29, 2021
@jdconrad
Copy link
Contributor Author

After discussion with @stu-elastic we're going to change the API a bit. We have decided to move the initial API to the following methods:

getValue(default) -> get(default)
getValue(index, default) -> get(index, default)
getValues() -> iterator()

This means users won't be able to get a List directly anymore, but instead can treat Field as an iterator. This decisions removes ambiguity over copied values and whether or not the List changes the Field that it was generate from.

@jdconrad
Copy link
Contributor Author

@stu-elastic Made the previously described changes. Would appreciate you looking them over one more time please.

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

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

Looks great.

Please ensure that EmptyField still works for numeric fields.

@jdconrad
Copy link
Contributor Author

Added getters for EmptyField along w/ tests.

@jdconrad
Copy link
Contributor Author

@stu-elastic @rjernst Thanks for the many reviews!

@jdconrad jdconrad merged commit b0ed13a into elastic:master Oct 29, 2021
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 >enhancement Team:Core/Infra Meta label for core/infra team v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants