Skip to content

[fix](be) Handle legacy DecimalV2 segments with missing precision/frac#63569

Open
jacktengg wants to merge 1 commit into
apache:masterfrom
jacktengg:260525-fix-decv2
Open

[fix](be) Handle legacy DecimalV2 segments with missing precision/frac#63569
jacktengg wants to merge 1 commit into
apache:masterfrom
jacktengg:260525-fix-decv2

Conversation

@jacktengg
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary: After upgrading from 3.1.4 to 4.0.4, queries on DecimalV2 columns fail with:

[INTERNAL_ERROR]meet invalid precision: real_precision=0,
max_decimal_precision=27, min_decimal_precision=1

Root cause: Segments written by Doris < 2.1.0 (before #26572) do not persist precision/frac in ColumnMetaPB; they default to 0 when read back. Since #35222, DataTypeFactory passes those raw values as original_precision/original_scale into DataTypeDecimalV2, which calls check_type_precision(0) and throws. 3.1.4 was unaffected because the old code hardcoded (27, 9).

Fix: In _create_primitive_data_type for OLAP_FIELD_TYPE_DECIMAL, when precision is not positive (legacy segment), pass UINT32_MAX to DataTypeDecimalV2 to signal that the original precision/scale are unknown. DecimalScaleInfo<TYPE_DECIMALV2> already treats UINT32_MAX as 'unknown' and falls back to the in-memory (27, 9) representation in get_original_precision()/get_original_scale().

Release note

Fix "meet invalid precision: real_precision=0" when querying DecimalV2 columns on segments written by Doris versions older than 2.1.0.

Check List (For Author)

  • Test: Unit Test
    • Added DataTypeDecimalTest.create_decimalv2_from_legacy_tablet_column covering: legacy TabletColumn (unset precision/frac), modern TabletColumn with decimal(26,6), and legacy segment_v2::ColumnMetaPB with default-0 precision/frac.
  • Behavior changed: No
  • Does this need documentation: No

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@jacktengg
Copy link
Copy Markdown
Contributor Author

/review

@jacktengg
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review result: no blocking issues found.

Critical checkpoint conclusions:

  • Goal and proof: The PR targets legacy DecimalV2 metadata where precision/frac are absent or nonpositive, and the added unit test covers TabletColumn and segment ColumnMetaPB creation paths plus a modern decimal(26,6) case.
  • Scope and clarity: The implementation is small and localized to the OLAP_FIELD_TYPE_DECIMAL factory path used by tablet/segment metadata.
  • Concurrency and lifecycle: No new concurrency, locking, static initialization, or lifecycle-sensitive behavior is introduced.
  • Compatibility: The change preserves modern persisted DecimalV2 precision/scale and restores compatibility for legacy metadata by using the existing UINT32_MAX unknown-original sentinel.
  • Parallel paths: The affected segment/tablet metadata paths both flow through _create_primitive_data_type; unrelated runtime/thrift/PColumnMeta paths are not part of the legacy segment failure described.
  • Error handling and data correctness: Invalid positive precision/scale still goes through DataTypeDecimalV2 validation; legacy missing metadata now maps to in-memory DecimalV2(27,9) with original precision/scale fallback as intended.
  • Tests: Focused BE unit coverage was added. I did not run tests in this review environment.
  • Observability, persistence, transaction, memory: Not applicable; no new persistence format, transaction path, memory ownership, config, or observability behavior is introduced.

User focus points: No additional user-provided review focus was supplied.

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31765 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 88b9a3b6a542fae9b4e2e3dd7f2f2a43a10c58e6, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17740	4128	4154	4128
q2	q3	10793	1376	825	825
q4	4682	477	347	347
q5	7711	2230	2098	2098
q6	319	190	141	141
q7	939	806	640	640
q8	9367	1698	1582	1582
q9	7094	4979	4989	4979
q10	6490	2203	1890	1890
q11	438	285	246	246
q12	691	421	300	300
q13	18280	3334	2781	2781
q14	273	260	248	248
q15	q16	825	763	697	697
q17	998	934	956	934
q18	6803	5796	5475	5475
q19	1202	1389	1095	1095
q20	542	427	282	282
q21	5982	2790	2758	2758
q22	447	365	319	319
Total cold run time: 101616 ms
Total hot run time: 31765 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4909	4779	5137	4779
q2	q3	4921	5218	4661	4661
q4	2149	2193	1474	1474
q5	4966	4808	4702	4702
q6	236	184	138	138
q7	1892	1816	1582	1582
q8	2369	2017	2016	2016
q9	7450	7439	7369	7369
q10	4780	4691	4248	4248
q11	553	389	370	370
q12	742	770	539	539
q13	3044	3361	2791	2791
q14	290	275	257	257
q15	q16	681	701	610	610
q17	1329	1287	1280	1280
q18	7574	6873	6925	6873
q19	1122	1112	1107	1107
q20	2248	2223	1957	1957
q21	5402	4701	4600	4600
q22	563	497	415	415
Total cold run time: 57220 ms
Total hot run time: 51768 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 172905 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 88b9a3b6a542fae9b4e2e3dd7f2f2a43a10c58e6, data reload: false

query5	4307	664	530	530
query6	321	229	198	198
query7	4270	573	320	320
query8	325	236	222	222
query9	8825	4073	4138	4073
query10	456	335	292	292
query11	5807	2596	2223	2223
query12	169	126	125	125
query13	1290	630	450	450
query14	6171	5603	5275	5275
query14_1	4567	4498	4478	4478
query15	209	203	183	183
query16	1032	441	434	434
query17	1136	729	591	591
query18	2669	487	341	341
query19	209	201	163	163
query20	134	135	127	127
query21	215	137	112	112
query22	13784	13744	13464	13464
query23	17363	16518	16244	16244
query23_1	16423	16340	16297	16297
query24	7452	1773	1330	1330
query24_1	1334	1288	1308	1288
query25	556	463	426	426
query26	1303	329	173	173
query27	2685	558	342	342
query28	4439	2019	2033	2019
query29	1045	666	521	521
query30	316	248	210	210
query31	1141	1085	957	957
query32	92	79	78	78
query33	551	363	304	304
query34	1172	1134	666	666
query35	780	803	687	687
query36	1423	1397	1280	1280
query37	174	112	97	97
query38	3211	3178	3079	3079
query39	926	926	907	907
query39_1	889	881	869	869
query40	242	152	132	132
query41	73	71	70	70
query42	114	114	113	113
query43	333	337	295	295
query44	
query45	222	207	209	207
query46	1102	1180	743	743
query47	2347	2428	2250	2250
query48	412	433	318	318
query49	650	527	421	421
query50	1098	369	272	272
query51	4452	4340	4289	4289
query52	109	112	101	101
query53	263	292	224	224
query54	350	294	288	288
query55	104	97	92	92
query56	319	331	304	304
query57	1454	1432	1332	1332
query58	311	287	286	286
query59	1592	1696	1470	1470
query60	359	314	305	305
query61	156	151	157	151
query62	701	655	565	565
query63	243	201	203	201
query64	2402	803	615	615
query65	
query66	1681	483	350	350
query67	30119	29996	29944	29944
query68	
query69	476	357	313	313
query70	1063	988	990	988
query71	312	271	265	265
query72	3002	2631	2482	2482
query73	839	786	433	433
query74	5105	4972	4838	4838
query75	2673	2628	2274	2274
query76	2329	1132	771	771
query77	408	419	346	346
query78	12492	12487	11817	11817
query79	1470	1054	776	776
query80	1362	541	467	467
query81	529	277	248	248
query82	1117	162	121	121
query83	368	283	249	249
query84	260	143	116	116
query85	927	537	477	477
query86	451	324	321	321
query87	3435	3384	3255	3255
query88	3692	2779	2756	2756
query89	457	398	345	345
query90	1901	184	192	184
query91	184	171	142	142
query92	81	80	74	74
query93	1577	1465	807	807
query94	702	363	319	319
query95	665	381	351	351
query96	1035	780	336	336
query97	2741	2762	2598	2598
query98	241	230	219	219
query99	1187	1152	1039	1039
Total cold run time: 256475 ms
Total hot run time: 172905 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 85.71% (6/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.78% (20853/38776)
Line Coverage 37.36% (197559/528826)
Region Coverage 33.68% (154824/459696)
Branch Coverage 34.65% (67345/194371)

@jacktengg
Copy link
Copy Markdown
Contributor Author

run p0

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 85.71% (6/7) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.77% (28017/37977)
Line Coverage 57.69% (304294/527477)
Region Coverage 54.84% (254526/464126)
Branch Coverage 56.35% (109935/195101)

jacktengg added a commit to jacktengg/incubator-doris that referenced this pull request May 25, 2026
…recision/frac (apache#63569)

Pick: apache#63569

Problem Summary: After upgrading from 3.1.4 to 4.0.4, queries on
DecimalV2 columns fail with:

    [INTERNAL_ERROR]meet invalid precision: real_precision=0,
    max_decimal_precision=27, min_decimal_precision=1

Root cause: Segments written by Doris < 2.1.0 (before apache#26572) do not
persist precision/frac in ColumnMetaPB; they default to 0 when read
back. Since apache#35222, DataTypeFactory passes those raw values as
original_precision/original_scale into DataTypeDecimalV2, which calls
check_type_precision(0) and throws. 3.1.4 was unaffected because the
old code hardcoded (27, 9).

Fix: In _create_primitive_data_type for OLAP_FIELD_TYPE_DECIMAL, when
precision is not positive (legacy segment), pass UINT32_MAX to
DataTypeDecimalV2 to signal that the original precision/scale are
unknown. DecimalScaleInfo<TYPE_DECIMALV2> already treats UINT32_MAX as
'unknown' and falls back to the in-memory (27, 9) representation in
get_original_precision()/get_original_scale().

Fix "meet invalid precision: real_precision=0" when querying DecimalV2
columns on segments written by Doris versions older than 2.1.0.

- Test: Unit Test
    - Added DataTypeDecimalTest.create_decimalv2_from_legacy_tablet_column
      covering: legacy TabletColumn (unset precision/frac), modern
      TabletColumn with decimal(26,6), and legacy segment_v2::ColumnMetaPB
      with default-0 precision/frac.
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jacktengg added a commit to jacktengg/incubator-doris that referenced this pull request May 25, 2026
…recision/frac (apache#63569)

Pick: apache#63569

Problem Summary: After upgrading from 3.1.4 to 4.0.4, queries on
DecimalV2 columns fail with:

    [INTERNAL_ERROR]meet invalid precision: real_precision=0,
    max_decimal_precision=27, min_decimal_precision=1

Root cause: Segments written by Doris < 2.1.0 (before apache#26572) do not
persist precision/frac in ColumnMetaPB; they default to 0 when read
back. Since apache#35222, DataTypeFactory passes those raw values as
original_precision/original_scale into DataTypeDecimalV2, which calls
check_type_precision(0) and throws. 3.1.4 was unaffected because the
old code hardcoded (27, 9).

Fix: In _create_primitive_data_type for OLAP_FIELD_TYPE_DECIMAL, when
precision is not positive (legacy segment), pass UINT32_MAX to
DataTypeDecimalV2 to signal that the original precision/scale are
unknown. DecimalScaleInfo<TYPE_DECIMALV2> already treats UINT32_MAX as
'unknown' and falls back to the in-memory (27, 9) representation in
get_original_precision()/get_original_scale().

Fix "meet invalid precision: real_precision=0" when querying DecimalV2
columns on segments written by Doris versions older than 2.1.0.

- Test: Unit Test
    - Added DataTypeDecimalTest.create_decimalv2_from_legacy_tablet_column
      covering: legacy TabletColumn (unset precision/frac), modern
      TabletColumn with decimal(26,6), and legacy segment_v2::ColumnMetaPB
      with default-0 precision/frac.
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jacktengg jacktengg force-pushed the 260525-fix-decv2 branch 2 times, most recently from ba47a4a to 7aa502e Compare May 25, 2026 09:13
@jacktengg
Copy link
Copy Markdown
Contributor Author

/review

@jacktengg
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one blocking correctness regression in the PR.

Critical checkpoint conclusions:

  • Goal/test: The PR addresses legacy DecimalV2 segments with default-0 precision/frac and adds focused BE unit coverage for DecimalV2, including nested complex-type metadata. The goal is mostly covered, but the implementation changes behavior for other primitive types in the same segment metadata path.
  • Scope/focus: The PR is small and focused in the actual GitHub diff.
  • Concurrency/lifecycle/config/compatibility: No new concurrency, special lifecycle, or config items. The change is a storage metadata compatibility fix; compatibility handling is needed and currently too broad.
  • Parallel paths: The TabletColumn path already passes -1/default sentinel values and is not the failing path; the ColumnMetaPB path is the relevant read path.
  • Tests: DecimalV2 tests were added, but they miss non-decimal primitive types that also flow through the modified branch, especially DateTimeV2/TIMESTAMPTZ scale handling.
  • Observability/transactions/data writes: Not applicable.
  • Performance: No material concern.
  • User focus: No additional user-provided review focus was supplied.

Please restrict the UINT32_MAX fallback to OLAP_FIELD_TYPE_DECIMAL/DecimalV2 (or otherwise preserve pcolumn.frac() for types that use it as scale) and add coverage for a non-decimal primitive with scale metadata.

auto meta_precision = pcolumn.precision();
UInt32 orig_precision =
meta_precision > 0 ? static_cast<UInt32>(meta_precision) : UINT32_MAX;
UInt32 orig_scale = meta_precision > 0 ? static_cast<UInt32>(pcolumn.frac()) : UINT32_MAX;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback is applied to every primitive ColumnMetaPB, not just legacy DecimalV2. For example, DATETIMEV2/TIMESTAMPTZ reach this same branch and _create_primitive_data_type() uses the scale argument in create_datetimev2(scale). Their precision() is normally unset/default, while frac() carries the scale; with this change meta_precision <= 0 rewrites that scale to UINT32_MAX, so reading a DATETIMEV2 segment can throw scale_value 4294967295 > 6. Please gate the UINT32_MAX sentinel on OLAP_FIELD_TYPE_DECIMAL only (or otherwise preserve pcolumn.frac() for non-DecimalV2 types), and add a regression test for a scaled DATETIMEV2/TIMESTAMPTZ ColumnMetaPB.

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31678 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7aa502e7c84c976882fb595050216006ee6c9e3d, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17608	3982	3998	3982
q2	q3	10808	1441	855	855
q4	4686	485	358	358
q5	7705	2284	2143	2143
q6	245	181	139	139
q7	995	790	644	644
q8	9349	1815	1611	1611
q9	5175	4963	4953	4953
q10	6439	2218	1913	1913
q11	424	283	242	242
q12	626	428	306	306
q13	18129	3437	2796	2796
q14	270	261	239	239
q15	q16	829	789	712	712
q17	1009	850	907	850
q18	7240	5862	5682	5682
q19	1327	1348	1155	1155
q20	533	419	270	270
q21	5951	2627	2513	2513
q22	453	377	315	315
Total cold run time: 99801 ms
Total hot run time: 31678 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4472	4334	4296	4296
q2	q3	4573	5005	4387	4387
q4	2153	2282	1449	1449
q5	4503	4417	4810	4417
q6	282	217	152	152
q7	2135	1976	1686	1686
q8	2595	2284	2306	2284
q9	8555	8044	8260	8044
q10	4840	4848	4398	4398
q11	586	440	388	388
q12	794	788	576	576
q13	3281	3676	2995	2995
q14	304	320	277	277
q15	q16	737	736	650	650
q17	1410	1378	1520	1378
q18	7984	7354	7451	7354
q19	1184	1187	1146	1146
q20	2242	2252	1953	1953
q21	5446	4685	4542	4542
q22	532	463	415	415
Total cold run time: 58608 ms
Total hot run time: 52787 ms

Issue Number: close #xxx

Problem Summary: After upgrading from 3.1.4 to 4.0.4, queries on
DecimalV2 columns fail with:

    [INTERNAL_ERROR]meet invalid precision: real_precision=0,
    max_decimal_precision=27, min_decimal_precision=1

Root cause: Segments written by Doris < 2.1.0 (before apache#26572) do not
persist precision/frac in ColumnMetaPB; they default to 0 when read
back. Since apache#35222, DataTypeFactory passes those raw values as
original_precision/original_scale into DataTypeDecimalV2, which calls
check_type_precision(0) and throws. 3.1.4 was unaffected because the
old code hardcoded (27, 9).

Fix: In _create_primitive_data_type for OLAP_FIELD_TYPE_DECIMAL, when
precision is not positive (legacy segment), pass UINT32_MAX to
DataTypeDecimalV2 to signal that the original precision/scale are
unknown. DecimalScaleInfo<TYPE_DECIMALV2> already treats UINT32_MAX as
'unknown' and falls back to the in-memory (27, 9) representation in
get_original_precision()/get_original_scale().

Fix "meet invalid precision: real_precision=0" when querying DecimalV2
columns on segments written by Doris versions older than 2.1.0.

- Test: Unit Test
    - Added DataTypeDecimalTest.create_decimalv2_from_legacy_tablet_column
      covering: legacy TabletColumn (unset precision/frac), modern
      TabletColumn with decimal(26,6), and legacy segment_v2::ColumnMetaPB
      with default-0 precision/frac.

PS:
error callstack:
```
I20260525 16:41:28.185905 1945583 pipeline_fragment_context.cpp:177] PipelineFragmentContext::cancel|query_id=18982a6c19ee4166-ae3ba44bce094741|fragment_id=1|reason=[INTERNAL_ERROR]meet invalid precision: real_precision=0, max_decimal_precision=27, min_decimal_precision=1

	0#  doris::get_stack_trace(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/util/stack_util.cpp:59
	1#  doris::Exception::Exception(int, std::basic_string_view<char, std::char_traits<char> > const&, bool) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/common/exception.cpp:31
	2#  doris::Exception::Exception(int, std::basic_string_view<char, std::char_traits<char> > const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/common/exception.h:38
	3#  doris::Exception::Exception<unsigned int const&, unsigned long>(int, std::basic_string_view<char, std::char_traits<char> > const&, unsigned int const&, unsigned long&&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/common/exception.h:44
	4#  doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>::check_type_precision(unsigned int) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/data_types/data_type_decimal.h:280
	5#  doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>::DataTypeDecimal(unsigned int, unsigned int, unsigned int, unsigned int) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/data_types/data_type_decimal.h:144
	6#  void std::_Construct<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>, int, int, int&, int&>(doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>*, int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_construct.h:134
	7#  std::_Sp_counted_ptr_inplace<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<int, int, int&, int&>(std::allocator<void>, int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/alloc_traits.h:805
	8#  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>, std::allocator<void>, int, int, int&, int&>(doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>*&, std::_Sp_alloc_shared_tag<std::allocator<void> >, int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:970
	9#  std::__shared_ptr<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<void>, int, int, int&, int&>(std::_Sp_alloc_shared_tag<std::allocator<void> >, int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1719
	10# std::shared_ptr<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20> >::shared_ptr<std::allocator<void>, int, int, int&, int&>(std::_Sp_alloc_shared_tag<std::allocator<void> >, int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr.h:464
	11# std::shared_ptr<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20> > std::make_shared<doris::vectorized::DataTypeDecimal<(doris::PrimitiveType)20>, int, int, int&, int&>(int&&, int&&, int&, int&) at /mnt/disk2/tengjianping/local/ldb_toolchain/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr.h:1007
	12# doris::vectorized::DataTypeFactory::_create_primitive_data_type(doris::FieldType const&, int, int, int) const at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/data_types/data_type_factory.cpp:196
	13# doris::vectorized::DataTypeFactory::create_data_type(doris::segment_v2::ColumnMetaPB const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/data_types/data_type_factory.cpp:394
	14# doris::segment_v2::ColumnReader::ColumnReader(doris::segment_v2::ColumnReaderOptions const&, doris::segment_v2::ColumnMetaPB const&, unsigned long, std::shared_ptr<doris::io::FileReader>) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/column_reader.cpp:290
	15# doris::segment_v2::ColumnReader::create(doris::segment_v2::ColumnReaderOptions const&, doris::segment_v2::ColumnMetaPB const&, unsigned long, std::shared_ptr<doris::io::FileReader> const&, std::shared_ptr<doris::segment_v2::ColumnReader>*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/column_reader.cpp:242
	16# doris::segment_v2::ColumnReaderCache::get_column_reader(int, std::shared_ptr<doris::segment_v2::ColumnReader>*, doris::OlapReaderStatistics*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/column_reader_cache.cpp:138
	17# doris::segment_v2::Segment::get_column_reader(int, std::shared_ptr<doris::segment_v2::ColumnReader>*, doris::OlapReaderStatistics*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment.cpp:738
	18# doris::segment_v2::Segment::new_column_iterator(doris::TabletColumn const&, std::unique_ptr<doris::segment_v2::ColumnIterator, std::default_delete<doris::segment_v2::ColumnIterator> >*, doris::StorageReadOptions const*, std::unordered_map<int, std::unique_ptr<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<doris::segment_v2::SparseColumnCache>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<doris::segment_v2::SparseColumnCache> > > >, std::default_delete<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<doris::segment_v2::SparseColumnCache>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<doris::segment_v2::SparseColumnCache> > > > > >, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::unique_ptr<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<doris::segment_v2::SparseColumnCache>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<doris::segment_v2::SparseColumnCache> > > >, std::default_delete<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<doris::segment_v2::SparseColumnCache>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<doris::segment_v2::SparseColumnCache> > > > > > > > > const*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment.cpp:679
	19# doris::segment_v2::SegmentIterator::_init_return_column_iterators() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment_iterator.cpp:1391
	20# doris::segment_v2::SegmentIterator::init_iterators() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment_iterator.cpp:396
	21# doris::segment_v2::SegmentIterator::_init_impl(doris::StorageReadOptions const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment_iterator.cpp:372
	22# doris::segment_v2::SegmentIterator::init(doris::StorageReadOptions const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment_iterator.cpp:290
	23# doris::segment_v2::Segment::new_iterator(std::shared_ptr<doris::Schema const>, doris::StorageReadOptions const&, std::unique_ptr<doris::RowwiseIterator, std::default_delete<doris::RowwiseIterator> >*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/segment.cpp:0
	24# doris::segment_v2::LazyInitSegmentIterator::init(doris::StorageReadOptions const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/segment_v2/lazy_init_segment_iterator.cpp:48
	25# doris::BetaRowsetReader::_init_iterator() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/beta_rowset_reader.cpp:330
	26# doris::BetaRowsetReader::_init_iterator_once()::$_0::operator()() const at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/beta_rowset_reader.cpp:295
	27# doris::Status doris::DorisCallOnce<doris::Status>::call<doris::BetaRowsetReader::_init_iterator_once()::$_0>(doris::BetaRowsetReader::_init_iterator_once()::$_0) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/util/once.h:92
	28# doris::BetaRowsetReader::_init_iterator_once() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/beta_rowset_reader.cpp:295
	29# doris::Status doris::BetaRowsetReader::_next_batch<doris::vectorized::Block>(doris::vectorized::Block*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/beta_rowset_reader.h:103
	30# doris::BetaRowsetReader::next_batch(doris::vectorized::Block*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/olap/rowset/beta_rowset_reader.h:56
	31# doris::vectorized::VCollectIterator::Level0Iterator::_refresh() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/vcollect_iterator.h:0
	32# doris::vectorized::VCollectIterator::Level0Iterator::refresh_current_row() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/vcollect_iterator.cpp:526
	33# doris::vectorized::VCollectIterator::Level0Iterator::ensure_first_row_ref() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/vcollect_iterator.cpp:497
	34# doris::vectorized::VCollectIterator::Level1Iterator::ensure_first_row_ref() at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/vcollect_iterator.cpp:715
	35# doris::vectorized::VCollectIterator::build_heap(std::vector<std::shared_ptr<doris::RowsetReader>, std::allocator<std::shared_ptr<doris::RowsetReader> > >&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/vcollect_iterator.cpp:190
	36# doris::vectorized::BlockReader::_init_collect_iter(doris::TabletReader::ReaderParams const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/block_reader.cpp:152
	37# doris::vectorized::BlockReader::init(doris::TabletReader::ReaderParams const&) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/olap/block_reader.cpp:226
	38# doris::vectorized::OlapScanner::_open_impl(doris::RuntimeState*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/exec/scan/olap_scanner.cpp:266
	39# doris::vectorized::Scanner::open(doris::RuntimeState*) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/exec/scan/scanner.h:84
	40# doris::vectorized::ScannerScheduler::_scanner_scan(std::shared_ptr<doris::vectorized::ScannerContext>, std::shared_ptr<doris::vectorized::ScanTask>) at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/exec/scan/scanner_scheduler.cpp:187
	41# doris::vectorized::ScannerScheduler::submit(std::shared_ptr<doris::vectorized::ScannerContext>, std::shared_ptr<doris::vectorized::ScanTask>)::$_0::operator()() const::{lambda()apache#1}::operator()() const::{lambda()apache#1}::operator()() const at /mnt/disk2/tengjianping/doris-4.0-dev/be/src/vec/exec/scan/scanner_scheduler.cpp:76
```
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jacktengg
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary: no additional blocking issues found in the current head.

Critical checkpoint conclusions:

  • Goal/test: The change targets legacy DecimalV2 segment metadata where ColumnMetaPB precision/frac default to 0. The current code fixes the segment-read path and adds unit coverage for legacy, modern, nested, and AggState DecimalV2 metadata.
  • Scope/focus: The implementation is small and localized to DataTypeFactory segment ColumnMetaPB handling plus focused tests.
  • Concurrency/lifecycle: No new shared state, locks, static initialization, or lifecycle-sensitive ownership paths are introduced.
  • Compatibility/data correctness: The fallback is now gated to OLAP_FIELD_TYPE_DECIMAL, preserving frac for non-decimal primitive types such as DATETIMEV2/TIMESTAMPTZ. DecimalV2 unknown original precision/scale uses the existing UINT32_MAX sentinel semantics.
  • Parallel paths: TabletColumn already represents unset legacy values as -1, which converts to the existing unknown sentinel; the fixed path is the ColumnMetaPB segment path where absent fields default to 0.
  • Tests: Added BE unit tests cover the reported path and recursive complex-type construction. I did not run the unit test in this review environment.
  • Observability/config/transactions/persistence/security: Not applicable; no new config, persistence format, logging, transaction, auth, or network behavior is introduced.
  • User focus: No additional user-provided review focus was specified.

Existing review context: the previously raised concern about applying UINT32_MAX to all primitive ColumnMetaPB types is not repeated here because the current head gates that behavior to DecimalV2 only.

@jacktengg
Copy link
Copy Markdown
Contributor Author

run buildall

jacktengg added a commit to jacktengg/incubator-doris that referenced this pull request May 25, 2026
…recision/frac (apache#63569)

Pick: apache#63569

Problem Summary: After upgrading from 3.1.4 to 4.0.4, queries on
DecimalV2 columns fail with:

    [INTERNAL_ERROR]meet invalid precision: real_precision=0,
    max_decimal_precision=27, min_decimal_precision=1

Root cause: Segments written by Doris < 2.1.0 (before apache#26572) do not
persist precision/frac in ColumnMetaPB; they default to 0 when read
back. Since apache#35222, DataTypeFactory passes those raw values as
original_precision/original_scale into DataTypeDecimalV2, which calls
check_type_precision(0) and throws. 3.1.4 was unaffected because the
old code hardcoded (27, 9).

Fix: In _create_primitive_data_type for OLAP_FIELD_TYPE_DECIMAL, when
precision is not positive (legacy segment), pass UINT32_MAX to
DataTypeDecimalV2 to signal that the original precision/scale are
unknown. DecimalScaleInfo<TYPE_DECIMALV2> already treats UINT32_MAX as
'unknown' and falls back to the in-memory (27, 9) representation in
get_original_precision()/get_original_scale().

Fix "meet invalid precision: real_precision=0" when querying DecimalV2
columns on segments written by Doris versions older than 2.1.0.

- Test: Unit Test
    - Added DataTypeDecimalTest.create_decimalv2_from_legacy_tablet_column
      covering: legacy TabletColumn (unset precision/frac), modern
      TabletColumn with decimal(26,6), and legacy segment_v2::ColumnMetaPB
      with default-0 precision/frac.
- Behavior changed: No
- Does this need documentation: No

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 174435 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7aa502e7c84c976882fb595050216006ee6c9e3d, data reload: false

query5	4319	669	538	538
query6	327	222	205	205
query7	4245	545	317	317
query8	322	228	221	221
query9	8857	4199	4166	4166
query10	457	344	303	303
query11	5794	2433	2252	2252
query12	179	132	126	126
query13	1289	633	427	427
query14	6189	5552	5286	5286
query14_1	4569	4545	4543	4543
query15	212	208	188	188
query16	999	472	448	448
query17	986	762	626	626
query18	2463	498	375	375
query19	231	226	173	173
query20	140	135	134	134
query21	225	152	119	119
query22	13908	13649	13459	13459
query23	17466	16664	16317	16317
query23_1	16514	16350	16498	16350
query24	7663	1855	1345	1345
query24_1	1355	1379	1362	1362
query25	598	531	479	479
query26	1332	341	176	176
query27	2679	600	363	363
query28	4459	2087	2115	2087
query29	1038	663	536	536
query30	309	247	204	204
query31	1123	1085	960	960
query32	93	77	81	77
query33	549	361	316	316
query34	1205	1157	667	667
query35	780	833	734	734
query36	1399	1446	1289	1289
query37	156	106	93	93
query38	3274	3198	3104	3104
query39	924	934	905	905
query39_1	896	925	879	879
query40	234	146	122	122
query41	70	65	67	65
query42	113	110	115	110
query43	345	353	322	322
query44	
query45	222	202	202	202
query46	1113	1239	761	761
query47	2353	2415	2247	2247
query48	416	389	303	303
query49	633	495	386	386
query50	1064	376	264	264
query51	4402	4329	4313	4313
query52	106	106	94	94
query53	260	290	204	204
query54	318	268	256	256
query55	96	95	94	94
query56	300	308	309	308
query57	1448	1427	1358	1358
query58	300	284	283	283
query59	1634	1751	1443	1443
query60	318	316	363	316
query61	164	156	149	149
query62	712	670	579	579
query63	254	204	213	204
query64	2443	812	664	664
query65	
query66	1754	506	358	358
query67	30311	30260	30192	30192
query68	
query69	495	352	324	324
query70	1114	1049	1056	1049
query71	322	282	271	271
query72	3010	2710	2405	2405
query73	878	768	428	428
query74	5121	5036	4824	4824
query75	2709	2645	2278	2278
query76	2273	1192	842	842
query77	420	429	355	355
query78	12497	12550	11902	11902
query79	1473	1022	752	752
query80	666	567	467	467
query81	458	296	248	248
query82	1377	158	126	126
query83	363	292	261	261
query84	358	156	122	122
query85	890	552	494	494
query86	407	364	340	340
query87	3453	3404	3292	3292
query88	3783	2793	2769	2769
query89	447	396	350	350
query90	2000	189	193	189
query91	183	172	144	144
query92	80	78	80	78
query93	1549	1410	862	862
query94	555	369	312	312
query95	689	493	378	378
query96	1070	778	372	372
query97	2786	2759	2600	2600
query98	237	230	241	230
query99	1188	1178	1039	1039
Total cold run time: 256624 ms
Total hot run time: 174435 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 32175 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit aee0b66bb4df599f5fcd6da8e4539185535835e5, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17785	4256	4328	4256
q2	q3	10803	1470	815	815
q4	4689	485	343	343
q5	7622	2292	2114	2114
q6	247	180	143	143
q7	1006	791	641	641
q8	9409	1834	1596	1596
q9	5224	4953	4993	4953
q10	6383	2257	1925	1925
q11	443	278	255	255
q12	649	436	302	302
q13	18110	3441	2731	2731
q14	266	259	239	239
q15	q16	828	785	719	719
q17	923	1041	980	980
q18	6959	5767	5605	5605
q19	1305	1376	1222	1222
q20	548	444	280	280
q21	6231	2893	2728	2728
q22	448	367	328	328
Total cold run time: 99878 ms
Total hot run time: 32175 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	5002	5093	5134	5093
q2	q3	4980	5329	4602	4602
q4	2196	2277	1661	1661
q5	4903	4749	4786	4749
q6	245	182	133	133
q7	1970	1848	1608	1608
q8	2529	2229	2227	2227
q9	7877	7457	7541	7457
q10	4793	4748	4292	4292
q11	577	427	391	391
q12	742	746	547	547
q13	3094	3421	2813	2813
q14	274	277	248	248
q15	q16	687	711	631	631
q17	1356	1301	1307	1301
q18	7521	7114	7010	7010
q19	1115	1133	1143	1133
q20	2250	2239	1979	1979
q21	5434	4791	4706	4706
q22	533	508	416	416
Total cold run time: 58078 ms
Total hot run time: 52997 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 173804 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit aee0b66bb4df599f5fcd6da8e4539185535835e5, data reload: false

query5	4326	665	526	526
query6	359	218	202	202
query7	4246	576	324	324
query8	326	239	228	228
query9	8839	4139	4101	4101
query10	450	345	303	303
query11	5836	2535	2240	2240
query12	179	125	147	125
query13	1263	609	437	437
query14	6105	5523	5154	5154
query14_1	4507	4537	4461	4461
query15	210	205	180	180
query16	965	457	439	439
query17	944	724	634	634
query18	2441	501	363	363
query19	208	200	163	163
query20	130	136	136	136
query21	215	135	117	117
query22	13632	13638	13539	13539
query23	17607	16737	16258	16258
query23_1	16512	16389	16509	16389
query24	7479	1826	1352	1352
query24_1	1323	1345	1348	1345
query25	577	518	446	446
query26	1297	327	176	176
query27	2688	564	341	341
query28	4506	2017	2009	2009
query29	1032	655	531	531
query30	310	244	206	206
query31	1149	1094	965	965
query32	92	80	75	75
query33	566	367	317	317
query34	1215	1122	664	664
query35	793	810	697	697
query36	1450	1416	1302	1302
query37	159	108	98	98
query38	3233	3204	3114	3114
query39	917	908	918	908
query39_1	870	913	887	887
query40	244	153	129	129
query41	73	70	71	70
query42	114	125	122	122
query43	337	340	303	303
query44	
query45	215	210	204	204
query46	1090	1189	756	756
query47	2411	2380	2269	2269
query48	410	440	315	315
query49	662	525	413	413
query50	1019	364	259	259
query51	4362	4308	4302	4302
query52	112	120	99	99
query53	263	297	210	210
query54	346	293	271	271
query55	98	96	93	93
query56	317	338	331	331
query57	1441	1443	1351	1351
query58	348	309	291	291
query59	1672	1699	1508	1508
query60	325	318	305	305
query61	170	160	152	152
query62	703	654	555	555
query63	242	208	211	208
query64	2410	817	631	631
query65	
query66	1744	482	358	358
query67	30335	30125	30125	30125
query68	
query69	479	346	308	308
query70	1075	993	1053	993
query71	303	276	278	276
query72	2924	2748	2444	2444
query73	859	775	436	436
query74	5121	4971	4808	4808
query75	2732	2638	2298	2298
query76	2274	1174	810	810
query77	419	420	335	335
query78	12558	12541	11941	11941
query79	1545	1025	795	795
query80	646	527	446	446
query81	462	290	245	245
query82	1353	159	127	127
query83	361	276	250	250
query84	307	148	109	109
query85	877	527	446	446
query86	389	342	303	303
query87	3470	3386	3286	3286
query88	3632	2788	2738	2738
query89	448	412	347	347
query90	1996	189	182	182
query91	179	168	147	147
query92	82	78	71	71
query93	1455	1418	952	952
query94	562	374	314	314
query95	674	400	439	400
query96	1070	801	334	334
query97	2748	2757	2630	2630
query98	232	225	227	225
query99	1172	1162	1046	1046
Total cold run time: 255602 ms
Total hot run time: 173804 ms

@jacktengg
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-H: Total hot run time: 31499 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit aee0b66bb4df599f5fcd6da8e4539185535835e5, data reload: false

------ Round 1 ----------------------------------
orders	Doris	NULL	NULL	0	0	0	NULL	0	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	17727	4049	4004	4004
q2	q3	10806	1411	868	868
q4	4706	486	358	358
q5	7982	2354	2128	2128
q6	408	178	136	136
q7	910	802	636	636
q8	9424	1727	1669	1669
q9	7079	5011	4975	4975
q10	6457	2353	1880	1880
q11	438	285	248	248
q12	686	433	295	295
q13	18192	3416	2788	2788
q14	271	265	235	235
q15	q16	833	769	716	716
q17	940	1019	1030	1019
q18	7003	5734	5523	5523
q19	1185	1210	991	991
q20	494	415	257	257
q21	5757	2647	2460	2460
q22	452	368	313	313
Total cold run time: 101750 ms
Total hot run time: 31499 ms

----- Round 2, with runtime_filter_mode=off -----
orders	Doris	NULL	NULL	150000000	42	6422171781	NULL	22778155	NULL	NULL	2023-12-26 18:27:23	2023-12-26 18:42:55	NULL	utf-8	NULL	NULL	
============================================
q1	4450	4507	4460	4460
q2	q3	4568	4938	4359	4359
q4	2217	2263	1444	1444
q5	4455	4472	5262	4472
q6	246	192	139	139
q7	2036	1917	1641	1641
q8	2573	2249	2213	2213
q9	8106	8002	8027	8002
q10	4813	4980	4321	4321
q11	610	434	392	392
q12	746	755	568	568
q13	3376	3730	3027	3027
q14	318	311	272	272
q15	q16	752	747	696	696
q17	1444	1418	1366	1366
q18	8014	7437	6775	6775
q19	1120	1101	1116	1101
q20	2240	2239	1964	1964
q21	5437	4727	4807	4727
q22	547	473	408	408
Total cold run time: 58068 ms
Total hot run time: 52347 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

TPC-DS: Total hot run time: 173113 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit aee0b66bb4df599f5fcd6da8e4539185535835e5, data reload: false

query5	4322	676	527	527
query6	326	214	197	197
query7	4311	526	314	314
query8	347	240	225	225
query9	8824	4143	4104	4104
query10	442	339	297	297
query11	5773	2610	2234	2234
query12	185	128	124	124
query13	1289	612	461	461
query14	6161	5516	5232	5232
query14_1	4518	4561	4540	4540
query15	211	206	179	179
query16	972	456	450	450
query17	1132	702	591	591
query18	2447	482	354	354
query19	208	193	170	170
query20	140	134	131	131
query21	212	136	118	118
query22	13601	13631	13380	13380
query23	17361	16505	16122	16122
query23_1	16404	16356	16440	16356
query24	7567	1782	1304	1304
query24_1	1324	1320	1330	1320
query25	575	474	413	413
query26	1334	314	177	177
query27	2706	582	378	378
query28	4433	2039	2051	2039
query29	1001	645	523	523
query30	312	261	202	202
query31	1118	1075	977	977
query32	93	75	76	75
query33	547	355	285	285
query34	1201	1145	669	669
query35	776	802	684	684
query36	1399	1455	1270	1270
query37	154	97	90	90
query38	3227	3173	3087	3087
query39	940	919	893	893
query39_1	898	897	887	887
query40	231	149	128	128
query41	66	63	63	63
query42	112	110	111	110
query43	331	341	295	295
query44	
query45	220	202	198	198
query46	1095	1224	731	731
query47	2407	2455	2183	2183
query48	403	416	308	308
query49	623	477	389	389
query50	1013	365	254	254
query51	4419	4307	4321	4307
query52	104	106	94	94
query53	246	282	215	215
query54	311	273	258	258
query55	96	93	85	85
query56	293	303	316	303
query57	1458	1400	1349	1349
query58	302	263	267	263
query59	1588	1652	1462	1462
query60	328	331	313	313
query61	161	154	163	154
query62	699	667	593	593
query63	243	207	202	202
query64	2428	799	645	645
query65	
query66	1704	476	359	359
query67	29630	30033	29897	29897
query68	
query69	468	338	306	306
query70	1043	1020	1013	1013
query71	304	277	271	271
query72	3046	2744	2551	2551
query73	845	787	447	447
query74	5212	4948	4803	4803
query75	2718	2648	2280	2280
query76	2297	1175	794	794
query77	420	430	342	342
query78	12486	12450	11957	11957
query79	1430	1094	777	777
query80	685	579	480	480
query81	453	281	251	251
query82	1382	160	122	122
query83	367	287	260	260
query84	266	145	122	122
query85	961	598	527	527
query86	401	332	311	311
query87	3445	3412	3257	3257
query88	3707	2819	2789	2789
query89	442	399	342	342
query90	1900	181	190	181
query91	182	163	138	138
query92	83	90	71	71
query93	1558	1380	881	881
query94	535	360	297	297
query95	691	397	348	348
query96	979	762	350	350
query97	2720	2777	2606	2606
query98	235	224	222	222
query99	1178	1153	1021	1021
Total cold run time: 254844 ms
Total hot run time: 173113 ms

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.80% (20874/38797)
Line Coverage 37.38% (197737/528950)
Region Coverage 33.70% (154990/459928)
Branch Coverage 34.69% (67469/194484)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.71% (28007/37997)
Line Coverage 57.68% (304310/527595)
Region Coverage 54.82% (254567/464351)
Branch Coverage 56.36% (110012/195210)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants