ESQL: Fail in AggregateFunction when LogicPlan is not an Aggregate#124446
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
buildkite test this |
ivancea
left a comment
There was a problem hiding this comment.
Thanks for your contribution! It looks good!
About the RRF command (First comment 👀), I'll ping @ioanatia in case she sees something I don't, as she knows the command far better, and so they know about this change.
Otherwise, after it's changed to work with RRF and the tests pass, it should be fine!
.../main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AggregateFunction.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Could you add another test with multiple aggs in the same WHERE/EVAL, or both in the same query with an agg each?
You can test it like here:
I'm asking this because the RRF test sends many repeated errors (Because each "subblan" of the RRF has the same source). It shouldn't happen here at all, but just as a double-check
|
buildkite test this |
alex-spies
left a comment
There was a problem hiding this comment.
Thanks a lot @kanoshiou ! This LGTM. I only have a final test suggestion that I think we should implement before merging this.
There was a problem hiding this comment.
I think we should add test cases where an aggregate function ends up in the ROW command. The following currently gives 500:
row language_code = count(2)
While supremely paranoid, we could also throw in test cases for dissect and grok, like row x = 1 | dissect avg(1) "foo" and similarly with grok. (This doesn't give 500 on current main.)
There was a problem hiding this comment.
Thank you for reviewing! I’ve added the tests in c7d867c.
…-outside-STATS # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Eval.java
alex-spies
left a comment
There was a problem hiding this comment.
Thanks @kanoshiou , let's
!
|
buildkite test this |
💔 Backport failed
You can use sqren/backport to manually backport by running |
Trigger
Verifierfailure inAggregateFunctionif theLogicPlanis not anAggregate.Closes #124311