deepthi912 opened a new pull request, #20266:
URL: https://github.com/apache/pinot/pull/20266

   ## Summary
   
   With null handling enabled, an upsert table's `outOfOrderRecordColumn` reads 
as **null on every row** instead of
   `true` / `false`, so `WHERE isOutOfOrder = true` (or the docs' `= false` 
example) returns nothing when the query
   runs with `enableNullHandling=true`.
   
   ## Root cause
   
   `MutableSegmentImpl.index` writes the flag with `updatedRow.putValue(...)`. 
The input never carries this column, so
   the null value transformer has already marked it null, and `putValue` does 
not clear that mark. Indexing then sets
   the column's null vector bit for every doc. The stored value is right; only 
the stale null mark hides it.
   Present since the column was added in apache/pinot#11877 (2023-11).
   
   ## Fix
   
   Clear the mark after writing the flag 
(`updatedRow.removeNullValueField(...)`), as `PartialUpsertHandler` and
   `ExpressionTransformer` already do for values they set.
   
   ## Test
   
   
`MutableSegmentImplUpsertComparisonColTest.testUpsertOutOfOrderRecordColumnIngestion`
 (null handling is already on)
   now also asserts the column's null value vector is not set for each doc. 
Without the fix it fails:
   `Out-of-order flag of doc 0 reads as null expected [false] but found 
[true]`. With it, the mutable-segment and
   upsert package tests pass (23 classes, 186 tests); checkstyle, spotless and 
license checks are clean.
   
   ## Notes
   
   - Overlap: apache/pinot#19088 (open, changes requested) rewrites the same 
block in `index()` and keeps the same
     `putValue` without clearing the mark. Whichever merges second needs a 
one-line rebase.
   - Release note: segments built before this fix keep reading the flag as null 
under null handling until they are
     re-consumed or rewritten; queries without null handling were never 
affected.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   


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