vespa
vespa copied to clipboard
Vespa grouping language requires grouping to take place
Describe the bug
Certain vespa grouping language snippets don't work like I'd expect them to work, I was instructed to open a GH issue as per recommendation of @bratseth. Specifically I'd assume that the grouping command all(output(min(price)))
is equivalent to all(group(1) each(output(min(price))))
. Instead the following error is returned when the first query is executed:
Failed: Cannot invoke "com.yahoo.searchlib.expression.SingleResultNode.min(com.yahoo.searchlib.expression.ResultNode)" because "this.min" is null", "stackTrace":"java.lang.NullPointerException: Cannot invoke "com.yahoo.searchlib.expression.SingleResultNode.min(com.yahoo.searchlib.expression.ResultNode)" because "this.min" is null at com.yahoo.searchlib.aggregation.MinAggregationResult.onMerge(MinAggregationResult.java:81) at com.yahoo.searchlib.aggregation.AggregationResult.merge(AggregationResult.java:49) at com.yahoo.searchlib.aggregation.Group.merge(Group.java:82) at com.yahoo.searchlib.aggregation.Grouping.merge(Grouping.java:70) at com.yahoo.search.grouping.vespa.GroupingExecutor.mergeGroupingMaps(GroupingExecutor.java:280) at com.yahoo.search.grouping.vespa.GroupingExecutor.performSearch(GroupingExecutor.java:254) at com.yahoo.search.grouping.vespa.GroupingExecutor.search(GroupingExecutor.java:91) at com.yahoo.search.Searcher.process(Searcher.java:134) at com.yahoo.processing.execution.Execution.process(Execution.java:112) at com.yahoo.search.searchchain.Execution.search(Execution.java:499) at com.yahoo.search.searchers.ValidateFuzzySearcher.search(ValidateFuzzySearcher.java:42) at com.yahoo.search.Searcher.process(Searcher.java:134) at com.yahoo.processing.execution.Execution.process(Execution.java:112) at com.yahoo.search.searchchain.Execution.search(Execution.java:499) at com.yahoo.search.searchers.ValidateMatchPhaseSearcher.search(ValidateMatchPhaseSearcher.java:55) at com.yahoo.search.Searcher.process(Searcher.java:134) at com.yahoo.processing.execution.Execution.process(Execution.java:112) at com.yahoo.search.searchchain.Execution.search(Execution.java:499) at com.yahoo.search.searchers.ValidateNearestNeighborSearcher.search(ValidateNearestNeighborSearcher.java:51) at com.yahoo.search.Searcher.process(Searcher.java:134) at com.yahoo.processing.execution.Execution.process(Execution.java:112) at com.yahoo.search.searchchain.Execution.search(Execution.java:499) at
To Reproduce Steps to reproduce the behavior:
- Go to https://docs.vespa.ai/en/grouping.html2.
- Enter "all(group(1) each(output(min(price))))"
- Execute the query
Expected behavior I would expect the query to return the minimum price over all results.
Screenshots
Environment (please complete the following information):
- OS: macOS
- Infrastructure: self-hosted arm docker image
- Versions 12.4
Vespa version 8.37.26
Additional context Add any other context about the problem here.
Hi @lukasmoellerch. The query all(output(min(price)))
is invalid - a group
clause is required. Using a fixed value as the expression for group
produces the expected result:
https://doc-search.vespa.oath.cloud/search/?yql=select%20*%20from%20purchase%20where%20true%20%7C%20all(group(1)each(output(min(price)))).
The lack of group
should produce a proper error response and not cause the searcher to crash. I'll create a new issue to track that.
A better error message is good, but I think aggregation without grouping is a valid use case and this should be a feature request.
Necessary to build e-commerce filters like price/date sliders.

Workaround until this is done: Put everything in one group by grouping on a constant.