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

ESQL: More tracking in BlockHash impls #101488

Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Oct 27, 2023

This adds memory tracking to more parts of the BlockHash implementations. It also reworks the tests so they assert based on callbacks which is more like how they are used in production.

This adds memory tracking to more parts of the `BlockHash`
implementations. It also reworks the tests so they assert based on
callbacks which is more like how they are used in production.
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 27, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @nik9000, I've created a changelog YAML for you.

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -75,7 +75,7 @@ private IntBlock add(BooleanBlock block) {

@Override
public BooleanBlock[] getKeys() {
BooleanBlock.Builder builder = BooleanBlock.newBlockBuilder(everSeen.length);
BooleanBlock.Builder builder = blockFactory.newBooleanBlockBuilder(everSeen.length);
Copy link
Member

Choose a reason for hiding this comment

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

nit: in a try clause?

Copy link
Member Author

Choose a reason for hiding this comment

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

++

@@ -90,7 +90,7 @@ public BooleanBlock[] getKeys() {

@Override
public IntVector nonEmpty() {
IntVector.Builder builder = IntVector.newVectorBuilder(everSeen.length);
IntVector.Builder builder = blockFactory.newIntVectorBuilder(everSeen.length);
Copy link
Member

Choose a reason for hiding this comment

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

nit: in a try clause?

Copy link
Member Author

Choose a reason for hiding this comment

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

++

keyBlocks[g] = builders[g].build();
}
} finally {
if (keyBlocks[keyBlocks.length - 1] == null) {
Copy link
Member

Choose a reason for hiding this comment

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

++

@nik9000 nik9000 added the auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 28, 2023
@elasticsearchmachine elasticsearchmachine merged commit bd22bc9 into elastic:main Oct 28, 2023
13 checks passed
@nik9000 nik9000 deleted the esql_track_unused_blockhash branch October 28, 2023 21:13
mark-vieira pushed a commit to mark-vieira/elasticsearch that referenced this pull request Nov 2, 2023
This adds memory tracking to more parts of the `BlockHash`
implementations. It also reworks the tests so they assert based on
callbacks which is more like how they are used in production.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Compute Engine Analytics in ES|QL auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants