Jackie-Jiang commented on code in PR #8927:
URL: https://github.com/apache/pinot/pull/8927#discussion_r922457807
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/NoDictionarySingleColumnGroupKeyGenerator.java:
##########
@@ -72,47 +78,122 @@ public int getGlobalGroupKeyUpperBound() {
@Override
public void generateKeysForBlock(TransformBlock transformBlock, int[]
groupKeys) {
BlockValSet blockValSet =
transformBlock.getBlockValueSet(_groupByExpression);
+ RoaringBitmap nullBitmap = blockValSet.getNullBitmap();
int numDocs = transformBlock.getNumDocs();
switch (_storedType) {
case INT:
int[] intValues = blockValSet.getIntValuesSV();
+ if (_nullHandlingEnabled) {
+ if (nullBitmap != null && nullBitmap.getCardinality() < numDocs) {
+ for (int i = 0; i < numDocs; i++) {
+ groupKeys[i] = nullBitmap.contains(i) ? getKeyForNullValue() :
getKeyForValue(intValues[i]);
+ }
+ } else if (numDocs > 0) {
+ _groupIdForNullValue = _numGroups++;
+ Arrays.fill(groupKeys, _groupIdForNullValue);
Review Comment:
This method is called per block instead of only once. In the previous block,
the null key might already be assigned
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]