Repository navigation
SOLR-8088: Grouping on a multiValued non-numeric field is rejected up front with a 400 error - #5144
Draft
nick-boss-tech wants to merge 7 commits into
Draft
nick-boss-tech wants to merge 7 commits into
nick-boss-tech wants to merge 7 commits into
Conversation
…clear 400 Hypothetical, unrun regression test; see SOLR-8088-TESTING.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
https://issues.apache.org/jira/browse/SOLR-8088
What happens today
Distributed grouping on a multiValued non-numeric field is accepted, then fails later inside Lucene.
A distributed grouped query can name a multiValued field, such as
catin the test schema. The search-phase command builder checks only that its required fields are set (SearchGroupsFieldCommand.java lines 68-74 at the merge-base). Nothing checks the field type there. The grouping code then reads the field as single valued docValues, and the request fails inside Lucene with an IllegalStateException about docValues.What this change does
Grouping on a multiValued non-numeric field is rejected up front with a 400 error.
cat, the 400 message reads:Distributed grouping requires a single valued field, but 'cat' is multiValued; group on a single valued (e.g. copyField) field instead.catand expects the 400 error (TestDistributedGrouping.java lines 1731-1745 at the head).Proof
A new test fails on the base code and passes with this change.
SearchGroupsFieldCommandTest.testMultiValuedFieldIsRejected(test lines 33-49) builds the command for a multiValued field and expects a 400 error. On the base code the builder returns normally, so the expected error never comes.Limits
Numeric multiValued fields are not checked.
Changelog: changelog/unreleased/SOLR-8088-grouping-multivalued.yml
AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.