-
Notifications
You must be signed in to change notification settings - Fork 25.6k
SQL: Add ST_Z function #41772
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: Add ST_Z function #41772
Conversation
Adds support for the ST_Z function that returns the altitude of the first point in a shape.
|
Pinging @elastic/es-analytics-geo |
|
Pinging @elastic/es-search |
matriv
left a comment
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, Should we add the limitation to the docs limitations page?
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 in general. Left two minor comments.
Also, I would have expected to see more tests for this function. Unless I'm missing something, atm there is only the one: the one used in docs.
|
|
||
| .Description: | ||
|
|
||
| Returns the the altitude of the first point in the geometry. |
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.
Typo: two "the".
| .Description: | ||
|
|
||
| Returns the the altitude of the first point in the geometry. | ||
| The return type is double. |
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.
I would have added, instead of this short statement that seems to have the same purpose as the *Output*: double from above: Returns the altitude of the first point in the geometry as a double type number.
|
Also, you need to add the new function to the functions' index page: https://github.com/elastic/elasticsearch/blob/geosql/docs/reference/sql/functions/index.asciidoc |
|
And a new test (or modify the existent one) should be added to https://github.com/elastic/elasticsearch/blob/geosql/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryTranslatorTests.java. |
|
@astefan I didn't add any |
|
"this function cannot be used in the query or aggregation contexts" |
costin
left a comment
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.
Left a comment.
I need to revise this statement. II think I formulated it too strongly. The function can appear in the query context, but it cannot work on fields because we don't have access to source in this contexts. For example,
It's too late for 7.1 I am targeting 7.2 at the moment, I will merge PR that addresses this issue before opening a PR to merge the branch to master and 7.x. |
astefan
left a comment
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
Adds support for the ST_Z function that returns the altitude of the
first point in a shape.
At the moment ST_Z functionality is quite limited since we are
not storing it in geo_point doc values and geo_shape doesn't
support doc values at the moment. So, this function cannot
be used in the query or aggregation contexts.
Relates to #29872