mrhhsg opened a new pull request, #71364:
URL: https://github.com/apache/doris/pull/71364

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Cherry-picked from 
[apache/doris#71292](https://github.com/apache/doris/pull/71292) to 
`branch-4.1` (source merge commit `153bba0f5cfdb3ecfcc4e69c0babc3c5ad981916`).
   
   Short-circuit point queries over partial row-store tables can lose existing 
rows when the projection omits the key. Comparing the scan-tuple size with the 
row-store include-set size can leave unread slots empty, including the first 
column used to determine the block's row count. Padding only after the complete 
batch also leaves subsequent JSONB decodes with an incorrect row count.
   
   A cached partial row has no row location for fetching columns absent from 
its payload, so it cannot safely replace the normal storage lookup.
   
   ### Changes
   
   - Precompute scan-tuple slots read by neither row storage nor column storage.
   - Pad only those slots after each successful row read, before decoding the 
next key; preserve missing-key and delete-sign handling.
   - Bypass both row-cache lookup and insertion for partial row storage, 
including existing incomplete cache entries. Keep the full-row cache path 
unchanged.
   - Include unit and SQL regression coverage for partial projections, row 
alignment, incomplete cached payloads, nullable values, missing keys and delete 
signs, plus a full-row cache control.
   
   ### Branch adaptations
   
   Resolve the unit-test conflict using `branch-4.1`'s existing 
`Reusable::init`, `TabletSchema::create_block`, `lookup_row_data` and 
segment-cache interfaces. Exercise both `Tablet` and `CloudTablet` with the 
branch's supported contiguous segment layout, without importing master-only 
segment-reuse changes.
   
   All production additions/deletions match the source patch; the SQL 
regression suite and expected output match the source merge commit byte for 
byte. There are no FE, protocol or storage-format changes.
   
   ### Validation
   
   - `./build.sh --be --fe -j 48`: Release build passed, including Checkstyle. 
Required Java runtime extensions also built through the existing build entry 
point.
   - Targeted ASAN BE unit tests: **16 passed**, zero failures, errors, 
disabled or skipped tests.
   - Point-query SQL regression: **5 suites passed**, zero failed, fatal or 
skipped scripts.
   - Supplementary cache-toggle differential checks: **41 cases passed**, 
comprising 123 value queries and 41 plan checks (27 short-circuit plans and 14 
ordinary-scan negative controls).
   - clang-format 16, repository format checks and `git diff --check` passed.
   
   Known unchanged limitation: with full-row caching enabled, repeated lookup 
of a deleted key can return a NULL row instead of no row. That independent 
full-row-cache/delete-sign path is not fixed by this backport and is excluded 
from the 41 supplemental cases; the broader check containing it did not pass.
   
   Full regression, live-cloud, multi-BE, mixed-version and performance 
validation were not run. Independent clang-tidy was not run.
   
   ### Release note
   
   Fix missing rows from short-circuit point queries over partial row-store 
tables.
   
   ### Check List (For Author)
   
   - [x] Unit tests
   - [x] Regression tests
   - Behavior changed: Yes, partial row-store point queries preserve rows and 
bypass incomplete row-cache payloads.
   - Documentation needed: No.


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