fix group-by v2 BufferArrayGrouper for empty multi-value dimension row#7794
Merged
gianm merged 4 commits intoapache:masterfrom May 30, 2019
Merged
Conversation
Contributor
|
Would you please check the CI failure? |
Member
Author
Yeah, unfortunately the CI failure is legitimate, I'm trying to determine the issue. Interestingly, this appears to be another inconsistency between |
jihoonson
approved these changes
May 30, 2019
Contributor
jihoonson
left a comment
There was a problem hiding this comment.
LGTM. Thanks @clintropolis.
clintropolis
added a commit
to implydata/druid-public
that referenced
this pull request
May 30, 2019
apache#7794) * fix groupby v2 BufferArrayGrouper * better name test * fix sql compatible null handling array grouper bug * another test
clintropolis
added a commit
to clintropolis/druid
that referenced
this pull request
May 30, 2019
apache#7794) * fix groupby v2 BufferArrayGrouper * better name test * fix sql compatible null handling array grouper bug * another test
jihoonson
pushed a commit
to implydata/druid-public
that referenced
this pull request
Jun 4, 2019
apache#7794) (apache#7803) * fix groupby v2 BufferArrayGrouper * better name test * fix sql compatible null handling array grouper bug * another test
jihoonson
pushed a commit
to implydata/druid-public
that referenced
this pull request
Jun 26, 2019
apache#7794) * fix groupby v2 BufferArrayGrouper * better name test * fix sql compatible null handling array grouper bug * another test
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.
This PR fixes an 'off by 1' issue in
BufferArrayGrouperfor the scenario that when faced with multi-value dimension rows with 0 elements, and attempting to aggregate onGroupByColumnSelectorStrategy.GROUP_BY_MISSING_VALUE, the grouper would initialize incorrectly into a state where it'snextvalue was-1, meaninghasNextevaluates to false, butnextis called without checking resulting in something like:Also fixes an issue in
GroupByEngineIterator#hasNextto returndelegate.hasNextinstead of assuming the delegate has a next after initialized. This is no longer an issue since the delegate in this case is now getting initialized correctly, but still seems like the right thing to do.Finally, fixes a third issue with
GroupByQueryEngineV2.ArrayAggregateIteratorand sql compatible null handling, where it was always using""as the key forGroupByColumnSelectorStrategy.GROUP_BY_MISSING_VALUEinstead of what the group by strategies for the hash iterator was doing for string dimensions and usingNullHandling.defaultStringValue().The added test will trigger the
NoSuchElementExceptionwithout the modifications in this PR (test code was borrowed from #7588). Additionally, the tests are run with both the array grouper and hash grouper to ensure they produce the same results (the hash grouper did not have this issue). The tests would also fail for sql compatible null handling for the array grouper without the 3rd fix toArrayAggregateIterator, which is how I stumbled into that issue.