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: Improve error messages for geo_shape #41923

Merged

Conversation

imotov
Copy link
Contributor

@imotov imotov commented May 7, 2019

Improves error messages when geo_shapes are used in unsupported manner
and adds description of current geo function limitations.

Fixes #41791

Improves error messages when geo_shapes are used in unsupported manner
and adds description of current geo function limitations.

Fixes elastic#41791
@imotov imotov added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes :Analytics/SQL SQL querying labels May 7, 2019
@imotov imotov requested review from costin, astefan and matriv May 7, 2019 22:28
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

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.

Looks good overall, but the limitation should be added to a different page (as well).

@@ -5,6 +5,18 @@

The geo functions work with geometries stored in `geo_point` and `geo_shape` fields, or returned by other geo functions.

==== Limitations
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a Limitations page where various bits and pieces are listed in a central place: https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-limitations.html
It's probably ok to list this limitation here, but I would like to see it listed in the general Limitations page, as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@@ -773,4 +773,24 @@ public void testAggregateAliasInFilter() {
public void testProjectUnresolvedAliasInFilter() {
assertEquals("1:8: Unknown column [tni]", error("SELECT tni AS i FROM test WHERE i > 10 GROUP BY i"));
}

public void testGeoShapeInWhereClause() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add one more test where all three unsupported scenarios take place? WHERE .... GROUP BY .... ORDER BY .... so that all three messages are logged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have to two other shape fields to the mapping for that. The failure messages are grouped by their source node, which is shape in this case. So, only one failure message would show up. Do you think it is worth adding other shape fields?

@@ -582,8 +582,7 @@ public void testTranslateStAsWktForPoints() {
}

public void testTranslateStAsWktForShapes() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The method name should be changed, since it's only testing geo points.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. It should be removed, actually. We already have a method that tests this for points.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM

@imotov
Copy link
Contributor Author

imotov commented May 8, 2019

@elasticmachine run elasticsearch-ci/1

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

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

@imotov imotov merged commit da72ce1 into elastic:geosql May 9, 2019
@imotov imotov deleted the issue-41791-handling-of-geoshapes-and-doc-fields branch May 1, 2020 22:19
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 >enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants