mrhhsg opened a new pull request, #71292: URL: https://github.com/apache/doris/pull/71292
### Background Short-circuit point queries locate a row by its primary key and assemble a scan-tuple block. With partial row storage, JSONB supplies the configured row-store columns and column storage supplies other required values. The scan tuple can also contain predicate-only slots that are not part of the output. ### What problem does this PR solve? Issue Number: None Related PR: #34089 (introduced partial row storage and the padding condition) PR Type: Bugfix Problem Summary: A partial-row-store table can return no rows when a point query projects only a non-key column, even though the key exists. Align unread scan slots after each successful row read and bypass incomplete row-cache payloads while keeping the short-circuit path. Most of the diff adds coverage for alignment and cache behavior. For a Unique Key MOW table with key `k`, `row_store_columns="v,z,w"`, and an existing row whose `k=7` and `v='seven'`: ```sql SELECT v FROM short_circuit_partial_rowstore_projection WHERE k = 7; SELECT k, v FROM short_circuit_partial_rowstore_projection WHERE k = 7; ``` | Query | Before | After | |---|---|---| | `SELECT v` | No rows | `seven` | | `SELECT k, v` | `7, seven` | `7, seven` | ### Details - **Frequency:** Always for the reproduced narrow projection with short-circuit column-store access enabled and equal-sized scan-tuple and configured row-store column sets. - **Root cause:** The executor compared sizes from different column domains to decide whether to pad unread slots. An unread leading key slot could stay empty, so `Block::rows()` reported zero. Batch-end padding also leaves the leading-column row count stale for subsequent JSONB decoding. - **Why existing tests missed it:** Unit tests in `PointQuerySegmentReuseTest` covered full-row storage. The partial-row case in the `test_rowstore` regression projected all columns, including the key. Neither exercised an unread leading key with equal-sized column sets. - **Fix:** Precompute scan slots read by neither storage path and append one default per successfully read row before decoding the next key. Required output columns and the delete sign still come from real storage reads; missing keys do not acquire placeholder rows. - **Other paths and branches:** Shared-nothing and cloud requests use the same executor. Both segment-ID layouts were tested with local files, not a live cloud deployment. Normal scans, FE eligibility, protocol and storage formats are unchanged. Release branches were not validated. - **Behavior change:** With `disable_storage_row_cache=false`, partial-row requests bypass both cache lookup and insertion because their cached payloads lack the row location needed for column-store reads. They may incur extra physical reads. Full-row caching and configuration defaults are unchanged; no performance benchmark was run. ### Testing All runs below were local with ASAN: - `./build.sh --be --fe -j 48`: passed, including FE Checkstyle. - `./run-be-ut.sh --run --filter '*PointQuerySegmentReuseTest*:*PointQueryRowIdReadTest*:*RowCacheTest*' -j 48`: 13 passed. The new alignment test failed on unfixed code in both layouts with leading-column size 0 instead of 1, then passed. - Regression runner with an isolated configuration and `-d point_query_p0`: selectors `test_short_circuit_partial_rowstore_projection`, `test_rowstore`, `test_short_circuit_project`, `test_short_circuit_rowstore_nested_complex`, and `test_point_query_light_schema_change` passed. Five invocations ran six suites, with no failures or skips. The new regression failed before the fix and passed against unchanged ordinary-scan expected output. - Differential checks: 40 queries matched values and expected plans; 20 cache-toggle queries returned correct values and remained short circuit. - `build-support/clang-format.sh` (v16), `build-support/check-format.sh`, `build-support/check-build-hygiene.sh`, and `git diff --check`: passed. ### Notes for Reviewers Disabling only partial-cache insertion would leave older incomplete entries reachable. Both cache entry points therefore require full-row storage; cached partial values must not replace real key or delete-sign reads. Existing mixed-delete-sign handling is unchanged. ### Release note Fix missing rows in short-circuit point queries that project non-key columns from partial row storage. When row caching is enabled, partial-row point queries bypass incomplete cached payloads; full-row caching remains available. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Partially verified: targeted local validation passed; full regression, live cloud, multi-BE and mixed-version validation were not run. ### AI Disclosure - Tool: Codex - Generated: Implementation, tests and this description - Human review: not stated -- 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]
