-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
SQL: Switch server side for geosql from ShapeBuilder to libs/geo #41692
Conversation
Switches the server side of the geosql processing from using ShapeBuilder to libs/geo geometry objects. Relates to elastic#29872
Pinging @elastic/es-analytics-geo |
Pinging @elastic/es-search |
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.
Looks good, left a comment regarding exception handling during parsing.
try { | ||
shape = parse(value); | ||
} catch (ParseException ex) { | ||
throw new ElasticsearchParseException("cannot load shape", ex); |
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 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?
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 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
.
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.
LGTM, but I do agree with @matriv's questions and request.
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.
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); |
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 not adding the read value here too? (save in.readString() to a var)
@elasticmachine run elasticsearch-ci/1 |
Switches the server side of the geosql processing from using
ShapeBuilder to libs/geo geometry objects.
Relates to #29872