[fix](be) Fix missing decimal precision and scale for legacy decimal data#65419
[fix](be) Fix missing decimal precision and scale for legacy decimal data#65419jacktengg wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
run buildall |
|
Codex automated review failed and did not complete. Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 11:47 AM. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
|
|
||
| namespace { | ||
|
|
||
| void fill_missing_decimal_precision(ColumnMetaPB* meta, const TabletColumn& column) { |
| // Segments written before #26572 do not persist decimal precision/frac in | ||
| // ColumnMetaPB, so recover the logical p/s from TabletSchema before | ||
| // ColumnReader builds DataTypeDecimal. | ||
| fill_missing_decimal_precision_from_schema(&meta, _tablet_schema); |
There was a problem hiding this comment.
如果你再这里修改了,那么上次的fix 还有用没?
另外,这里好像没区分decimalv2还是decimal v3? 比如如果是decimal v2 怎么办?
| } | ||
| } | ||
| } else if (is_numeric_type(type)) { | ||
| } else if (field_is_numeric_type(type)) { |
There was a problem hiding this comment.
删除重复代码is_numeric_type。
|
run buildall |
| // Segments written before #26572 do not persist decimal precision/frac in | ||
| // ColumnMetaPB, so recover the logical p/s from TabletSchema before | ||
| // ColumnReader builds DataTypeDecimal. | ||
| fill_missing_decimal_precision_from_schema(&meta, _tablet_schema); |
There was a problem hiding this comment.
在Segment::_parse_footer 的时候把里面的ColumnMetaPB 改了就行。
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
…data Related PR: apache#26572, apache#63569 Problem Summary: Segments written before decimal ColumnMetaPB precision and scale were persisted can miss decimal precision and scale in metadata. Regular columns, complex decimal children may then build decimal DataType instances without the logical precision/scale from TabletSchema. This change centralizes decimal metadata recovery from TabletSchema, applies it before ColumnReader/DataType creation. Fix legacy segment footer parsing to recover missing decimal precision and scale before column readers and data types are created.
262cfa2 to
4283283
Compare
|
run buildall |
TPC-H: Total hot run time: 29976 ms |
TPC-DS: Total hot run time: 180810 ms |
ClickBench: Total hot run time: 24.88 s |
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #26572, #63569
Problem Summary:
Segments written before decimal ColumnMetaPB precision and scale were persisted can miss precision and scale for decimal types in metadata . Regular columns, complex decimal children may then build decimal DataType instances without the logical precision/scale from TabletSchema, and result in error "Wrong precision 0, min: 1, max: 76". This change centralizes decimal metadata recovery from TabletSchema, applies it before ColumnReader/DataType creation.
Release note
Fix reading legacy decimal whose segment metadata is missing decimal precision and scale.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)