-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
ESQL: Improve agg verification #99827
ESQL: Improve agg verification #99827
Conversation
Pinging @elastic/es-ql (Team:QL) |
Hi @alex-spies, I've created a changelog YAML for you. |
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
This might need to be (adapted and) merged after #99602 since support for |
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, maybe add one more test with a different function than add.
...l/src/main/java/org/elasticsearch/xpack/esql/planner/AbstractPhysicalOperationProviders.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java
Show resolved
Hide resolved
@bpintea , I took care of the type resolution bug in |
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
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/Expression.java
Outdated
Show resolved
Hide resolved
Likely this has to go in 8.11 as well. |
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
Hi @alex-spies, I've updated the changelog YAML for you. |
@elasticsearchmachine run elasticsearch-ci/part-1 |
@elasticsearchmachine run elasticsearch-ci/part-1 |
Hi @alex-spies, I've updated the changelog YAML for you. |
When verifying aggregation expressions like from employees | stats percentile(salary_change, 25*2) , both arguments are treated the same way during verification. This is incorrect, as salary_change is the actual aggregation's field, while 25*2 is merely it's (first and only) parameter. This is overly restrictive. Apply the current verification only to the aggregation's actual field, as the parameter is already verified during type resolution (it needs to be a constant expression).
💚 Backport successful
|
When verifying aggregation expressions like from employees | stats percentile(salary_change, 25*2) , both arguments are treated the same way during verification. This is incorrect, as salary_change is the actual aggregation's field, while 25*2 is merely it's (first and only) parameter. This is overly restrictive. Apply the current verification only to the aggregation's actual field, as the parameter is already verified during type resolution (it needs to be a constant expression).
Fixes #99751.Update: fix for #99751 is already contained in #99602. I'm keeping this PR open for additional verification improvements, though.When verifying aggregation expressions like
from employees | stats percentile(salary_change, 25*2)
, both arguments are treated the same way during verification. This is incorrect, assalary_change
is the actual aggregation's field, while25*2
is merely it's (first and only) parameter. This is overly restrictive.Apply the current verification only to the aggregation's actual field, as the parameter is already verified during type resolution (it needs to be a constant expression).