[bug](analytic) fix partition by column when it overflow haven't convert to column64#65240
[bug](analytic) fix partition by column when it overflow haven't convert to column64#65240zhangstar333 wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
run buildall |
There was a problem hiding this comment.
Automated review result: requesting changes for one correctness gap.
The PR fixes the demonstrated count() over(partition by str) overflow path for partition/order comparison buffers, and the changed expected output is deterministic. However, the same analytic buffering code still leaves aggregate argument columns unconverted, so string-valued window aggregates can still read corrupt ColumnString offsets after the buffered argument data exceeds 4GB.
Critical checkpoint conclusions:
- Goal/test: the stated partition-key overflow case is covered, but the broader analytic string-buffer goal is incomplete for aggregate arguments.
- Scope: the change is small and focused, but it misses a parallel buffer path in the same function.
- Concurrency/lifecycle/config/compatibility: no new concurrency, lifecycle, configuration, persistence, or protocol compatibility concerns found.
- Parallel paths:
_agg_input_columnsis the missing parallel path; it appends through the same overflow-ignoring helper and is later consumed by window aggregate functions. - Tests: the regression output for
count() over(partition by str)is correct, and the unit test covers String32 to String64 append. Missing coverage remains for large string-valued window aggregate arguments such asmax(str)orfirst_value(str). - Performance/observability/data writes: no separate issue found beyond the correctness gap above.
Subagent conclusions:
OPT-001was accepted as the inline comment.TESTCFG-001was merged as a duplicate ofOPT-001; it confirmed the expected output math and the test gap.- Convergence round 1 ended with both
optimizer-rewriteandtests-session-configreportingNO_NEW_VALUABLE_FINDINGS.
No additional user-provided review focus was supplied.
Validation was static only: this shallow runner lacks the base revision locally, .worktree_initialized, and thirdparty/installed, so BE tests/builds were not run. The GitHub PR patch and PR-scoped API data were used as the authoritative review inputs.
| @@ -791,6 +797,7 @@ Status AnalyticSinkOperatorX::_add_input_block(doris::RuntimeState* state, Block | |||
| RETURN_IF_ERROR( | |||
| _insert_range_column(input_block, local_state._partition_by_eq_expr_ctxs[i], | |||
| local_state._partition_by_columns[i].get(), block_rows)); | |||
There was a problem hiding this comment.
This conversion only covers the partition/order comparison buffers. The aggregate argument buffers above still append through _insert_range_column() into _agg_input_columns, which also uses insert_range_from_ignore_overflow(), but those columns are later handed unchanged to add_range_single_place(). A large string-valued window aggregate such as max(str) over(partition by u_city) or first_value(str) ... can therefore still accumulate a ColumnString argument buffer past 4GB and read wrapped offsets; string min/max currently reads with SingleValueDataString via ColumnString::get_data_at(), and first/last/lead/lag keep row references into the same buffered columns. Please apply the overflow conversion to the aggregate argument buffers as well, and make sure the affected string window aggregate readers handle a promoted ColumnString64 input.
TPC-H: Total hot run time: 29610 ms |
TPC-DS: Total hot run time: 173257 ms |
ClickBench: Total hot run time: 25.26 s |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
when insert into partition by column, will be call insert_range_from_ignore_overflow function,
the dst column maybe overflow, so need add the convert_column_if_overflow function to convert to column64。
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)