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

[ES|QL] better inline casting validation with ES metadata #186409

Open
drewdaemon opened this issue Jun 18, 2024 · 1 comment
Open

[ES|QL] better inline casting validation with ES metadata #186409

drewdaemon opened this issue Jun 18, 2024 · 1 comment
Labels
Feature:ES|QL impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:ESQL ES|QL related features in Kibana

Comments

@drewdaemon
Copy link
Contributor

What isn't currently validated

In #185904, we added basic support for validating inline casts (::).

There are a couple things we couldn't validate at the time

Type list

We don't know what types and abbreviations are valid. For example, integer is acceptable, but so is int. We took the approach of not validating the type.

Value types

Another thing we aren't able to validate is the type of the value being casted against the cast type.

For example, stringField::cartesian_point is valid but numberField::cartesian_point is not.

The reason for this is that field::cartesian_point is actually syntactic sugar for to_cartesianpoint(field). So, the inline cast value is subject to the constraints of to_cartesianpoint's call signature.

Plan

With elastic/elasticsearch#109713, Elasticsearch is providing us a cast-type-to-cast-function map which will allow us to reliably validate both of the above.

@drewdaemon drewdaemon added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Feature:ES|QL Team:ESQL ES|QL related features in Kibana labels Jun 18, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@drewdaemon drewdaemon changed the title [ES|QL] validate value types in inline casting [ES|QL] better inline casting validation with ES metadata Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ES|QL impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:ESQL ES|QL related features in Kibana
Projects
None yet
Development

No branches or pull requests

2 participants