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

SQL: Switch server side for geosql from ShapeBuilder to libs/geo #41692

Merged
merged 4 commits into from
May 2, 2019

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Apr 30, 2019

Switches the server side of the geosql processing from using
ShapeBuilder to libs/geo geometry objects.

Relates to #29872

Switches the server side of the geosql processing from using
ShapeBuilder to libs/geo geometry objects.

Relates to elastic#29872
@imotov imotov added :Analytics/Geo Indexing, search aggregations of geo points and shapes >refactoring :Analytics/SQL SQL querying labels Apr 30, 2019
@imotov imotov requested review from costin, astefan and matriv April 30, 2019 15:07
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@elasticmachine elasticmachine mentioned this pull request Apr 30, 2019
13 tasks
Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

Looks good, left a comment regarding exception handling during parsing.

try {
shape = parse(value);
} catch (ParseException ex) {
throw new ElasticsearchParseException("cannot load shape", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to wrap it in a new exception here? And if it's the case shouldn't this be an Sql exception?
Also can we have some tests to check those cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you need to wrap it in a new exception here? And if it's the case shouldn't this be an Sql exception?

I wrapped it here for consistency with the next constructor which cannot throw anything besides IOException, I will rewrap the it into SqlIllegalArgumentException that sounds like a better idea.

Also can we have some tests to check those cases?

We are already testing this cases in StWkttosqlProcessorTests.

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM, but I do agree with @matriv's questions and request.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

LGTM

}
}

public GeoShape(StreamInput in) throws IOException {
try {
shape = parse(in.readString());
} catch (ParseException ex) {
throw new ElasticsearchParseException("cannot load shape", ex);
throw new SqlIllegalArgumentException("cannot load geo_shape", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not adding the read value here too? (save in.readString() to a var)

@imotov
Copy link
Contributor Author

imotov commented May 2, 2019

@elasticmachine run elasticsearch-ci/1

@imotov imotov merged commit b2f0435 into elastic:geosql May 2, 2019
@imotov imotov deleted the geosql-switch-to-libs-geo-on-server branch May 1, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes :Analytics/SQL SQL querying >refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants