-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Added status to OrdinalsGroupingOperator #130720
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b45c672
ESQL: Added status to OrdinalsGroupingOperator
ivancea 9d6ac9d
Merge branch 'main' into ordinals-grouping-operator-status
ivancea 76fbdc7
Added emit times and specific times per branch
ivancea 2bb1a40
[CI] Auto commit changes from spotless
cfdb678
Merge branch 'main' into ordinals-grouping-operator-status
ivancea 70785ff
Merge branch 'main' into ordinals-grouping-operator-status
ivancea 9df4a61
Merge branch 'main' into ordinals-grouping-operator-status
ivancea bd9a8e1
Merge branch 'main' into ordinals-grouping-operator-status
ivancea e161686
Merge branch 'main' into ordinals-grouping-operator-status
ivancea 8615764
Added backport transport versions
ivancea 8ca0aa0
Added serialization entry for the status object
ivancea bfe4b30
Merge branch 'main' into ordinals-grouping-operator-status
ivancea a21398b
Merge branch 'main' into ordinals-grouping-operator-status
ivancea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...src/test/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperatorStatusTests.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.compute.operator; | ||
|
|
||
| import org.elasticsearch.common.Strings; | ||
| import org.elasticsearch.common.io.stream.Writeable; | ||
| import org.elasticsearch.test.AbstractWireSerializingTestCase; | ||
| import org.elasticsearch.test.ESTestCase; | ||
|
|
||
| import static org.hamcrest.Matchers.equalTo; | ||
|
|
||
| public class OrdinalsGroupingOperatorStatusTests extends AbstractWireSerializingTestCase<OrdinalsGroupingOperator.Status> { | ||
| public static OrdinalsGroupingOperator.Status simple() { | ||
| return new OrdinalsGroupingOperator.Status(200012, 123, 111, 222); | ||
| } | ||
|
|
||
| public static String simpleToJson() { | ||
| return """ | ||
| { | ||
| "process_nanos" : 200012, | ||
| "process_time" : "200micros", | ||
| "pages_processed" : 123, | ||
| "rows_received" : 111, | ||
| "rows_emitted" : 222 | ||
| }"""; | ||
| } | ||
|
|
||
| public void testToXContent() { | ||
| assertThat(Strings.toString(simple(), true, true), equalTo(simpleToJson())); | ||
| } | ||
|
|
||
| @Override | ||
| protected Writeable.Reader<OrdinalsGroupingOperator.Status> instanceReader() { | ||
| return OrdinalsGroupingOperator.Status::new; | ||
| } | ||
|
|
||
| @Override | ||
| public OrdinalsGroupingOperator.Status createTestInstance() { | ||
| return new OrdinalsGroupingOperator.Status( | ||
| randomNonNegativeLong(), | ||
| randomNonNegativeInt(), | ||
| randomNonNegativeLong(), | ||
| randomNonNegativeLong() | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| protected OrdinalsGroupingOperator.Status mutateInstance(OrdinalsGroupingOperator.Status instance) { | ||
| long processNanos = instance.processNanos(); | ||
| int pagesProcessed = instance.pagesProcessed(); | ||
| long rowsReceived = instance.rowsReceived(); | ||
| long rowsEmitted = instance.rowsEmitted(); | ||
| switch (between(0, 3)) { | ||
| case 0 -> processNanos = randomValueOtherThan(processNanos, ESTestCase::randomNonNegativeLong); | ||
| case 1 -> pagesProcessed = randomValueOtherThan(pagesProcessed, ESTestCase::randomNonNegativeInt); | ||
| case 2 -> rowsReceived = randomValueOtherThan(rowsReceived, ESTestCase::randomNonNegativeLong); | ||
| case 3 -> rowsEmitted = randomValueOtherThan(rowsEmitted, ESTestCase::randomNonNegativeLong); | ||
| default -> throw new UnsupportedOperationException(); | ||
| } | ||
| return new OrdinalsGroupingOperator.Status(processNanos, pagesProcessed, rowsReceived, rowsEmitted); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.