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

Fix a bug on handling an invalid array value for point type field #4900

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

heemin32
Copy link
Contributor

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim [email protected]

Description

#4597 introduced a bug which accept an array of four values for point type field. This PR resolve the issue.

Current behavior:

PUT testindex1/_doc/4
{
  "point": [1.1, 1.2, 1.3, 1.4] 
}

200 OK

Expected behavior after this commit:

PUT testindex1/_doc/4
{
  "point": [1.1, 1.2, 1.3, 1.4] 
}

400 [geo_point] field type does not accept more than 3 values

Issues Resolved

N/A

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.

@heemin32 heemin32 requested review from a team and reta as code owners October 25, 2022 01:29
With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #4900 (7485f4a) into main (67a29df) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #4900      +/-   ##
============================================
- Coverage     70.74%   70.73%   -0.02%     
- Complexity    57859    57865       +6     
============================================
  Files          4689     4689              
  Lines        276913   276913              
  Branches      40301    40301              
============================================
- Hits         195912   195867      -45     
- Misses        64780    64875      +95     
+ Partials      16221    16171      -50     
Impacted Files Coverage Δ
...index/mapper/AbstractPointGeometryFieldMapper.java 93.13% <100.00%> (+1.96%) ⬆️
...g/opensearch/index/analysis/CharFilterFactory.java 0.00% <0.00%> (-100.00%) ⬇️
...r/src/main/java/org/opensearch/http/HttpUtils.java 16.66% <0.00%> (-50.00%) ⬇️
...nsearch/rest/action/cat/RestCatRecoveryAction.java 43.61% <0.00%> (-42.56%) ⬇️
.../java/org/opensearch/search/dfs/AggregatedDfs.java 54.83% <0.00%> (-41.94%) ⬇️
.../admin/cluster/reroute/ClusterRerouteResponse.java 60.00% <0.00%> (-40.00%) ⬇️
...ava/org/opensearch/search/dfs/DfsSearchResult.java 46.87% <0.00%> (-38.55%) ⬇️
...luster/routing/allocation/RoutingExplanations.java 62.06% <0.00%> (-37.94%) ⬇️
...pensearch/action/ingest/DeletePipelineRequest.java 31.25% <0.00%> (-37.50%) ⬇️
...cluster/routing/allocation/RerouteExplanation.java 70.00% <0.00%> (-30.00%) ⬇️
... and 476 more

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

@dblock dblock merged commit 0f477a2 into opensearch-project:main Oct 25, 2022
@dblock dblock added the backport 2.x Backport to 2.x branch label Oct 25, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4900-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0f477a2d0aae4d75313a7f26407cda8594bd981e
# Push it to GitHub
git push --set-upstream origin backport/backport-4900-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-4900-to-2.x.

heemin32 added a commit to heemin32/OpenSearch that referenced this pull request Oct 25, 2022
…ensearch-project#4900)

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>
(cherry picked from commit 0f477a2)
heemin32 added a commit to heemin32/OpenSearch that referenced this pull request Oct 25, 2022
…ensearch-project#4900)

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>
(cherry picked from commit 0f477a2)
heemin32 added a commit to heemin32/OpenSearch that referenced this pull request Oct 25, 2022
…ensearch-project#4900)

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>
(cherry picked from commit 0f477a2)
reta pushed a commit that referenced this pull request Oct 25, 2022
) (#4917)

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>
(cherry picked from commit 0f477a2)
@heemin32 heemin32 deleted the point_array branch October 25, 2022 21:48
ashking94 pushed a commit to ashking94/OpenSearch that referenced this pull request Nov 7, 2022
…ensearch-project#4900)

With this commit, appropriate exception is thrown when an array of four values are provided for point type field.

Signed-off-by: Heemin Kim <[email protected]>

Signed-off-by: Heemin Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants