nizarhejazi commented on code in PR #8927:
URL: https://github.com/apache/pinot/pull/8927#discussion_r921833051
##########
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:
Not sure I follow. I will make the change but would like to understand under
what circumstances there might be already an id associated w/ `null`? This code
gets executed when input is all null values.
--
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]