Jackie-Jiang commented on PR #19390:
URL: https://github.com/apache/pinot/pull/19390#issuecomment-5458980900

   Confirmed and fixed in `2cd84a8`.
   
   `resolveColumnValueIds` delegates its single-value branch to the null-aware 
`resolveColumnIds`, but the multi-value branch resolved every element straight 
through the on-the-fly dictionary without consulting the null bitmap. Null rows 
now take the reserved null component, mirroring the other MV generators:
   
   ```java
   if (_nullHandlingEnabled) {
     RoaringBitmap nullBitmap = blockValSet.getNullBitmap();
     if (nullBitmap != null && !nullBitmap.isEmpty()) {
       PeekableIntIterator nullIterator = nullBitmap.getIntIterator();
       while (nullIterator.hasNext()) {
         ids[nullIterator.next()] = _nullComponent;
       }
     }
   }
   ```
   
   Reusing the existing `_nullComponent` is safe and, I think, the right shape 
here: it already stands for a NULL key component when a grouping set excludes a 
column, it is already shared across every row and set, and `expandGroupIds` 
copies it into a fresh scratch array rather than writing through it. A column 
excluded from a set and a column whose value is NULL both render as NULL, which 
is why `GROUPING()` exists to tell them apart — so one component serving both 
roles matches the semantics. I extended the field's javadoc to say so.
   
   Regression test: `testGroupingSetsOverMultiValueColumnHoldingNulls`, using 
your repro shape.
   
   Same note as before on provenance: this one is also pre-existing on master — 
its MV resolver has no null-bitmap reference either. My "every group key 
generator is null-aware" wording in the description was wrong as written, since 
the grouping-sets MV path was outside the change; it is accurate now that this 
is fixed.
   


-- 
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]

Reply via email to