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

[opensearch-project/geospatial#212] Fixing the IT for GeoTilesAggrega… #6120

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

navneet1v
Copy link
Contributor

Description

Fixing the IT for GeoTilesAggregation.

Signed-off-by: Navneet Verma navneev@amazon.com

Issues Resolved

opensearch-project/geospatial#212

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

@heemin32 heemin32 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.recovery.RecoveryWhileUnderLoadIT.testRecoverWhileUnderLoadAllocateReplicasRelocatePrimariesTest

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Merging #6120 (b07fe5b) into main (b1cf2d1) will decrease coverage by 0.05%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6120      +/-   ##
============================================
- Coverage     70.77%   70.73%   -0.05%     
+ Complexity    58744    58687      -57     
============================================
  Files          4775     4775              
  Lines        281000   281000              
  Branches      40592    40592              
============================================
- Hits         198873   198759     -114     
- Misses        65812    65906      +94     
- Partials      16315    16335      +20     
Impacted Files Coverage Δ
...adonly/AddIndexBlockClusterStateUpdateRequest.java 0.00% <0.00%> (-75.00%) ⬇️
...port/ResponseHandlerFailureTransportException.java 0.00% <0.00%> (-60.00%) ⬇️
...readonly/TransportVerifyShardIndexBlockAction.java 9.75% <0.00%> (-58.54%) ⬇️
...n/admin/indices/readonly/AddIndexBlockRequest.java 17.85% <0.00%> (-53.58%) ⬇️
...ch/transport/ReceiveTimeoutTransportException.java 50.00% <0.00%> (-50.00%) ⬇️
...main/java/org/opensearch/ingest/ProcessorInfo.java 21.05% <0.00%> (-47.37%) ⬇️
...rc/main/java/org/opensearch/ingest/IngestInfo.java 34.48% <0.00%> (-44.83%) ⬇️
.../org/opensearch/client/indices/AnalyzeRequest.java 31.00% <0.00%> (-44.00%) ⬇️
.../opensearch/client/indices/CloseIndexResponse.java 48.75% <0.00%> (-42.50%) ⬇️
...indices/readonly/TransportAddIndexBlockAction.java 20.68% <0.00%> (-41.38%) ⬇️
... and 496 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockWithAReadOnlyBlock

@navneet1v
Copy link
Contributor Author

@nknize please check the PR.

Copy link
Collaborator

@nknize nknize left a comment

Choose a reason for hiding this comment

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

two nitpicks.. otherwise LGTM! Thx for jumping on this!

final GeoPoint topLeft = new GeoPoint();
final GeoPoint bottomRight = new GeoPoint();
assert geometry != null;
GeoBoundsHelper.updateBoundsForGeometry(geometry, topLeft, bottomRight);
final Set<String> geoHashes = new HashSet<>();
for (int precision = MAX_PRECISION_FOR_GEO_SHAPES_AGG_TESTING; precision > 0; precision--) {
if (precision > 2 && !geometryDocValue.isIntersectingRectangle(boundingRectangleForGeoShapesAgg)) {
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && !intersectingWithBB) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit. Try to avoid negatives... they can be easily missed...

Suggested change
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && !intersectingWithBB) {
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && intersectingWithBB == false) {

final GeoPoint topLeft = new GeoPoint();
final GeoPoint bottomRight = new GeoPoint();
assert geometry != null;
GeoBoundsHelper.updateBoundsForGeometry(geometry, topLeft, bottomRight);
final Set<String> geoTiles = new HashSet<>();
for (int precision = MAX_PRECISION_FOR_GEO_SHAPES_AGG_TESTING; precision > 0; precision--) {
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && !intersectingWithBB) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same nit:

Suggested change
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && !intersectingWithBB) {
if (precision > MIN_PRECISION_WITHOUT_BB_AGGS && intersectingWithBB == false) {

@navneet1v
Copy link
Contributor Author

Will fix the nit picks and will raise the pr again.

…tion.

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: Navneet Verma <navneev@amazon.com>
@navneet1v
Copy link
Contributor Author

@nknize updated the PR by fixing nitpicks.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.action.admin.indices.create.CreateIndexIT.testCreateAndDeleteIndexConcurrently
      1 org.opensearch.action.admin.indices.create.CreateIndexIT.classMethod

@nknize nknize merged commit 8debacc into opensearch-project:main Feb 3, 2023
heemin32 pushed a commit to heemin32/OpenSearch that referenced this pull request Jun 28, 2023
opensearch-project#6120)

Fixing the IT for GeoTilesAggregation.

Signed-off-by: Navneet Verma <navneev@amazon.com>
andrross pushed a commit that referenced this pull request Jun 30, 2023
* Add GeoTile and GeoHash Grid aggregations on GeoShapes. (#5589)

Src files for GeoTile and GeoHash Aggregations on GeoShape with integration
tests.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* [opensearch-project/geospatial#212] Fixing the IT for GeoTilesAggrega… (#6120)

Fixing the IT for GeoTilesAggregation.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* [#6187, #6222] Fixing the GeoShapes GeoHash and GeoTile Aggregations Integration tests. (#6242)

Changes done:
* Fixed the ArrayIndexOutOfBoundsException.
* Reduced the precision for GeoShapes Aggregation IT testing.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* [#7101] Fixing the GeoTileIT#testMultivaluedGeoPointsAggregation test case. (#7166)

The issue was happening because we encode the GeoPoint as long and error comes in the precision due to that encoding. The error was not taken care while generating the exepected tiles count for execpected output.

Signed-off-by: Navneet Verma <navneev@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: Heemin Kim <heemin@amazon.com>
Co-authored-by: Navneet Verma <navneev@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Random test failure that succeeds on second run Geospatial Search:Aggregations skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants