-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support common format geo point #2801
Conversation
@dai-chen you might be interested in this :) Could you please take a look when you get a chance? |
...h/src/test/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactoryTest.java
Show resolved
Hide resolved
* @param supportArrays Parsing the whole array or not | ||
* @return Geo point value parsed from content. | ||
*/ | ||
private ExprValue parseGeoPoint(Content content, boolean supportArrays) { |
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.
From the doc, there seems 6 ways to represent a geo point. Could you clarify in comment which code block is handling which format?
The build failures contains low code test coverage: |
|
||
var elements = content.array(); | ||
var first = elements.next(); | ||
// an array in the [longitude, latitude] format. |
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.
@dai-chen Actually, I have commented on one format. The other formats are handled by GeoUtils#parseGeoPoint
.
Seems the workflows were not triggered correctly. @bugmakerrrrrr Could u merge latest change from main and re-run test? (try to avoid force-push) |
Signed-off-by: panguixin <[email protected]>
Signed-off-by: panguixin <[email protected]>
Signed-off-by: panguixin <[email protected]>
After rebasing the main branch, it appears that I have to perform a force push. |
You can |
Unit tests passed, fundamentally LGTM, @bugmakerrrrrr could you add a new IT similar to Now only one geo_point format case used in IT, ref
|
Signed-off-by: panguixin <[email protected]>
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.
Thanks for the changes!
cc @dai-chen
@LantaoJin @dai-chen can we merge this? |
@penghuo do you have a chance to review this? |
...earch/src/main/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactory.java
Show resolved
Hide resolved
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.
Thanks for the change!
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.x
# Create a new branch
git switch --create backport/backport-2801-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 82ef68e2b25c7c10740e74968bbe960c000c1cee
# Push it to GitHub
git push --set-upstream origin backport/backport-2801-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.x Then, create a pull request where the |
@bugmakerrrrrr could u help resolve conflict and submit backport PR to 2.x. #2801 (comment) |
--------- Signed-off-by: panguixin <[email protected]> (cherry picked from commit 82ef68e)
|
--------- Signed-off-by: panguixin <[email protected]> (cherry picked from commit 82ef68e)
--------- Signed-off-by: panguixin <[email protected]>
--------- Signed-off-by: panguixin <[email protected]>
Description
Currently, we only support geo point in the format of an object with a latitude and longitude, this PR aims to expand our support to all common formats that are described in OpenSearch doc.
Issues Resolved
#1432
Check List
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.