-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Sandbox/qa - Add multi shard qa test suite #21951
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
Merged
sandeshkr419
merged 2 commits into
opensearch-project:main
from
mch2:twoshard-merge-suite
Jun 2, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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
50 changes: 50 additions & 0 deletions
50
.../analytics-engine-rest/src/test/java/org/opensearch/analytics/qa/IpFieldMultiShardIT.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,50 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.analytics.qa; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Multi-shard {@code ip}-field coverage (Mustang bug tracker Bug 3): a query over an index with an | ||
| * {@code ip}-type field can fail with a Substrait {@code Binary} vs {@code BinaryView} schema mismatch. | ||
| * {@link FieldTypeCoverageIT#testIp()} covers {@code ip} at 1 shard; this exercises the 2-shard reduce | ||
| * path. Run unmuted — if the defect is present it fails here, otherwise it passes. | ||
| */ | ||
| public class IpFieldMultiShardIT extends AnalyticsRestTestCase { | ||
|
|
||
| private static final Dataset DATASET = new Dataset("ip_multishard", "ip_multishard"); | ||
|
|
||
| private static boolean provisioned = false; | ||
|
|
||
| @Override | ||
| protected void onBeforeQuery() throws IOException { | ||
| if (provisioned == false) { | ||
| DatasetProvisioner.provision(client(), DATASET, 2); | ||
| provisioned = true; | ||
| } | ||
| } | ||
|
|
||
| /** count() by status_code over the 10 docs (status_code = 200 + id%3): 200->4, 201->3, 202->3. */ | ||
| @SuppressWarnings("unchecked") | ||
| public void testAggregationOnIndexWithIpFieldAtTwoShards() throws IOException { | ||
| Map<String, Object> resp = executePpl("source=" + DATASET.indexName + " | stats count() by status_code"); | ||
| List<List<Object>> rows = (List<List<Object>>) resp.get("datarows"); | ||
| assertNotNull("expected datarows for count-by-status over an ip-bearing index", rows); | ||
|
|
||
| Map<Integer, Integer> counts = new HashMap<>(); | ||
| for (List<Object> row : rows) { | ||
| counts.put(((Number) row.get(1)).intValue(), ((Number) row.get(0)).intValue()); | ||
| } | ||
| Map<Integer, Integer> expected = Map.of(200, 4, 201, 3, 202, 3); | ||
| assertEquals("count() by status_code", expected, counts); | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
IpFieldMultiShardITis different from other two shards tests which are extendingTwoShardReduceTestCase.java?