Skip to content

[feature](jsonb) Add decimal type in JsonbDocument #51766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrhhsg
Copy link
Member

@mrhhsg mrhhsg commented Jun 16, 2025

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

@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 16, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17583	5675	5037	5037
q2	1933	283	166	166
q3	10397	1284	766	766
q4	10209	1015	515	515
q5	7593	2394	2351	2351
q6	181	162	134	134
q7	921	764	618	618
q8	9337	1509	1184	1184
q9	6803	5086	5165	5086
q10	6892	2341	1901	1901
q11	494	296	280	280
q12	345	354	225	225
q13	17784	3705	3123	3123
q14	231	247	208	208
q15	560	485	479	479
q16	437	425	386	386
q17	599	868	347	347
q18	7637	7235	7216	7216
q19	1846	974	567	567
q20	342	328	220	220
q21	3799	3184	2477	2477
q22	1068	1041	982	982
Total cold run time: 106991 ms
Total hot run time: 34268 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5200	5080	5030	5030
q2	234	328	213	213
q3	2218	2698	2319	2319
q4	1376	1810	1341	1341
q5	4285	4261	4385	4261
q6	220	176	134	134
q7	2014	1977	1849	1849
q8	2625	2598	2496	2496
q9	7219	7211	7174	7174
q10	2964	3154	2876	2876
q11	589	538	485	485
q12	727	776	622	622
q13	3599	3993	3377	3377
q14	310	299	269	269
q15	537	462	465	462
q16	451	483	452	452
q17	1169	1520	1429	1429
q18	7636	7558	7639	7558
q19	822	827	878	827
q20	2010	2088	1943	1943
q21	4770	4557	4412	4412
q22	1110	1084	1005	1005
Total cold run time: 52085 ms
Total hot run time: 50534 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 193862 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 b84629df2ce7db4b39ec0df453a384540bd4837a, data reload: false

query1	1458	1030	997	997
query2	6120	1876	1864	1864
query3	11093	4715	4695	4695
query4	55302	25938	23407	23407
query5	5067	562	487	487
query6	328	214	196	196
query7	4887	518	289	289
query8	285	240	224	224
query9	5357	2652	2653	2652
query10	439	344	279	279
query11	15135	15158	14807	14807
query12	160	106	106	106
query13	1055	515	422	422
query14	10291	6499	6513	6499
query15	200	195	184	184
query16	7051	666	498	498
query17	1068	739	567	567
query18	1569	401	329	329
query19	199	190	173	173
query20	139	145	118	118
query21	212	129	106	106
query22	4349	4376	4287	4287
query23	34359	33733	33710	33710
query24	6567	2453	2410	2410
query25	466	478	430	430
query26	680	281	159	159
query27	2262	523	357	357
query28	2946	2174	2176	2174
query29	595	559	437	437
query30	275	221	203	203
query31	869	850	781	781
query32	77	71	65	65
query33	485	427	319	319
query34	787	878	544	544
query35	814	854	762	762
query36	960	993	923	923
query37	110	105	88	88
query38	4250	4368	4170	4170
query39	1527	1476	1469	1469
query40	230	125	108	108
query41	64	56	58	56
query42	137	115	114	114
query43	512	504	488	488
query44	1326	849	864	849
query45	198	183	172	172
query46	880	1046	659	659
query47	1838	1851	1779	1779
query48	400	445	334	334
query49	650	506	395	395
query50	648	707	435	435
query51	4272	4313	4358	4313
query52	128	122	114	114
query53	230	260	190	190
query54	607	592	531	531
query55	88	86	86	86
query56	307	311	313	311
query57	1195	1251	1152	1152
query58	278	285	271	271
query59	2719	2758	2633	2633
query60	358	337	324	324
query61	148	131	131	131
query62	729	727	701	701
query63	258	194	208	194
query64	1467	1039	722	722
query65	4273	4140	4194	4140
query66	722	406	312	312
query67	15847	15720	15311	15311
query68	5748	889	528	528
query69	530	303	277	277
query70	1204	1151	1114	1114
query71	428	321	294	294
query72	6018	4996	5071	4996
query73	1354	779	352	352
query74	8929	9165	9083	9083
query75	3231	3180	2716	2716
query76	3842	1205	759	759
query77	559	368	287	287
query78	9970	10096	9444	9444
query79	1573	844	577	577
query80	662	512	445	445
query81	584	254	219	219
query82	195	127	93	93
query83	257	241	233	233
query84	295	112	86	86
query85	743	359	319	319
query86	365	307	292	292
query87	4420	4453	4280	4280
query88	2836	2279	2238	2238
query89	426	313	280	280
query90	1739	209	202	202
query91	146	147	113	113
query92	71	63	54	54
query93	2059	940	569	569
query94	682	412	274	274
query95	371	290	292	290
query96	480	564	272	272
query97	2678	2737	2681	2681
query98	237	210	204	204
query99	1346	1383	1279	1279
Total cold run time: 294280 ms
Total hot run time: 193862 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 28.66 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b84629df2ce7db4b39ec0df453a384540bd4837a, data reload: false

query1	0.04	0.04	0.03
query2	0.07	0.04	0.03
query3	0.24	0.06	0.07
query4	1.62	0.10	0.10
query5	0.43	0.41	0.44
query6	1.15	0.66	0.68
query7	0.02	0.02	0.02
query8	0.05	0.04	0.04
query9	0.57	0.53	0.51
query10	0.57	0.59	0.56
query11	0.16	0.11	0.10
query12	0.14	0.12	0.12
query13	0.61	0.61	0.59
query14	0.79	0.80	0.78
query15	0.88	0.85	0.87
query16	0.38	0.39	0.37
query17	1.06	1.04	1.07
query18	0.24	0.22	0.21
query19	1.93	1.82	1.88
query20	0.02	0.01	0.01
query21	15.41	0.90	0.54
query22	0.77	1.15	0.95
query23	14.70	1.38	0.64
query24	7.30	1.50	0.34
query25	0.47	0.18	0.07
query26	0.69	0.16	0.13
query27	0.05	0.05	0.05
query28	9.14	0.88	0.45
query29	14.04	3.96	3.32
query30	0.25	0.08	0.06
query31	2.90	0.59	0.38
query32	3.23	0.57	0.48
query33	3.06	3.10	3.06
query34	15.87	5.09	4.54
query35	4.55	4.58	4.53
query36	0.68	0.50	0.50
query37	0.08	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.16	0.14	0.12
query41	0.08	0.03	0.02
query42	0.03	0.02	0.03
query43	0.04	0.04	0.03
Total cold run time: 104.56 s
Total hot run time: 28.66 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 61.23% (447/730) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.43% (15073/26713)
Line Coverage 45.16% (134716/298298)
Region Coverage 44.28% (67770/153053)
Branch Coverage 38.81% (34764/89568)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 77.06% (504/654) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.81% (20989/26300)
Line Coverage 72.72% (216832/298174)
Region Coverage 70.96% (127773/180064)
Branch Coverage 64.62% (66125/102330)

@@ -756,6 +767,99 @@ class JsonbIntVal : public JsonbValue {
}
};

template <typename T>
requires std::same_as<T, vectorized::Decimal256> || std::same_as<T, vectorized::Decimal128V3>
class JsonbDecimalVal : public JsonbValue {
Copy link
Contributor

Choose a reason for hiding this comment

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

把Decimal继承NumberValT吧?NumberValT

Copy link
Contributor

Choose a reason for hiding this comment

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

NumberValT <DecimalField>

Copy link
Contributor

Choose a reason for hiding this comment

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

应该不太行,我们的decimal field 没有precision 信息。。。。

Copy link
Contributor

Choose a reason for hiding this comment

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

另外,就是如果后面有人去改了decimal field 里的东西会直接影响这里的持久化,所以最好不要让他跟decimal field 有关系

T_Decimal256 = 0x0F, // Decimal256
T_Date = 0x10, // v2 only
T_DateTime = 0x11, // v2 only
T_Time = 0x12, // v2 only
Copy link
Contributor

Choose a reason for hiding this comment

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

不需要Ip类型吗

@@ -133,6 +137,11 @@ enum class JsonbType : char {
T_Array = 0x0B,
T_Int128 = 0x0C,
T_Float = 0x0D,
T_Decimal = 0x0E, // DecimalV3 only
Copy link
Contributor

Choose a reason for hiding this comment

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

Decimal32/Decimal64 都变成Decimal128吗

@Mryange
Copy link
Contributor

Mryange commented Jun 17, 2025

我看没有改
intern_json(const JsonbValue* val)这个函数。
那jsonb 转json的纯文本,这些新加的类型怎么办。

@@ -133,6 +137,11 @@ enum class JsonbType : char {
T_Array = 0x0B,
T_Int128 = 0x0C,
T_Float = 0x0D,
T_Decimal = 0x0E, // DecimalV3 only
T_Decimal256 = 0x0F, // Decimal256
Copy link
Contributor

Choose a reason for hiding this comment

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

为什么decimal256 和 decimalv3 是两个?

@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 17, 2025

run buildall

@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 17, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17621	5124	4989	4989
q2	1944	301	188	188
q3	10269	1281	697	697
q4	10225	984	524	524
q5	7514	2339	2341	2339
q6	177	162	133	133
q7	910	744	616	616
q8	9319	1283	1042	1042
q9	6843	5032	5043	5032
q10	6882	2367	1955	1955
q11	494	287	276	276
q12	350	358	214	214
q13	17764	3656	3104	3104
q14	244	242	218	218
q15	566	484	484	484
q16	423	446	371	371
q17	600	870	362	362
q18	7850	7264	7100	7100
q19	1295	956	544	544
q20	331	342	222	222
q21	3805	3102	2316	2316
q22	1056	1034	975	975
Total cold run time: 106482 ms
Total hot run time: 33701 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5028	5018	4994	4994
q2	245	326	220	220
q3	2189	2683	2302	2302
q4	1342	1741	1335	1335
q5	4211	4102	4354	4102
q6	219	168	126	126
q7	2002	1913	1783	1783
q8	2577	2536	2436	2436
q9	7171	7200	7067	7067
q10	3032	3273	2832	2832
q11	573	527	491	491
q12	677	750	622	622
q13	3447	3824	3227	3227
q14	304	295	281	281
q15	527	477	492	477
q16	432	501	425	425
q17	1139	1543	1363	1363
q18	7847	7511	7423	7423
q19	792	802	933	802
q20	1984	2032	1935	1935
q21	4933	4522	4398	4398
q22	1060	1021	981	981
Total cold run time: 51731 ms
Total hot run time: 49622 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 186269 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 96c9d261cb375ebb1a1c5716054c5c6180004f42, data reload: false

query1	1002	405	395	395
query2	6542	1818	1840	1818
query3	6751	229	224	224
query4	26064	23960	23489	23489
query5	4380	630	464	464
query6	303	198	197	197
query7	4627	482	275	275
query8	251	215	216	215
query9	8623	2632	2638	2632
query10	478	330	286	286
query11	15270	15071	14879	14879
query12	161	108	104	104
query13	1663	523	428	428
query14	8799	5977	6057	5977
query15	189	186	172	172
query16	7109	638	478	478
query17	923	703	574	574
query18	1993	435	304	304
query19	189	182	157	157
query20	133	121	118	118
query21	210	123	111	111
query22	4070	4128	4111	4111
query23	33878	33108	33010	33010
query24	8452	2316	2373	2316
query25	519	453	382	382
query26	1232	269	151	151
query27	2773	503	357	357
query28	4351	2120	2097	2097
query29	793	564	447	447
query30	283	229	188	188
query31	929	815	738	738
query32	75	69	66	66
query33	579	385	320	320
query34	819	842	551	551
query35	772	844	730	730
query36	971	983	887	887
query37	113	106	77	77
query38	4101	4176	4147	4147
query39	1481	1439	1399	1399
query40	213	124	116	116
query41	98	58	62	58
query42	128	111	116	111
query43	481	491	478	478
query44	1296	809	798	798
query45	176	172	167	167
query46	850	1016	637	637
query47	1754	1813	1727	1727
query48	383	413	307	307
query49	756	471	386	386
query50	633	667	405	405
query51	4074	4167	4147	4147
query52	120	140	96	96
query53	218	249	185	185
query54	573	575	515	515
query55	84	84	81	81
query56	299	296	286	286
query57	1160	1204	1145	1145
query58	268	254	252	252
query59	2707	2599	2632	2599
query60	319	337	310	310
query61	131	128	127	127
query62	806	700	673	673
query63	222	189	188	188
query64	4374	1002	689	689
query65	4246	4192	4232	4192
query66	1164	420	329	329
query67	15961	15511	15332	15332
query68	7582	871	525	525
query69	496	316	282	282
query70	1176	1127	1159	1127
query71	416	321	290	290
query72	5767	4922	4911	4911
query73	719	684	351	351
query74	9301	9131	8813	8813
query75	3148	3182	2685	2685
query76	3174	1183	741	741
query77	480	388	317	317
query78	10028	10168	9425	9425
query79	2439	811	592	592
query80	637	507	472	472
query81	501	259	219	219
query82	458	125	104	104
query83	253	247	238	238
query84	292	103	105	103
query85	792	361	321	321
query86	375	317	275	275
query87	4394	4503	4337	4337
query88	3692	2234	2247	2234
query89	383	320	338	320
query90	1908	201	207	201
query91	146	148	113	113
query92	76	65	61	61
query93	1979	943	579	579
query94	727	416	302	302
query95	366	287	288	287
query96	494	569	278	278
query97	2677	2769	2664	2664
query98	238	215	211	211
query99	1336	1393	1284	1284
Total cold run time: 271795 ms
Total hot run time: 186269 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 28.86 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 96c9d261cb375ebb1a1c5716054c5c6180004f42, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.07	0.07
query4	1.61	0.09	0.11
query5	0.42	0.44	0.42
query6	1.19	0.66	0.66
query7	0.02	0.02	0.02
query8	0.05	0.03	0.04
query9	0.57	0.52	0.51
query10	0.57	0.58	0.57
query11	0.16	0.10	0.11
query12	0.15	0.11	0.12
query13	0.64	0.61	0.62
query14	0.83	0.82	0.79
query15	0.88	0.84	0.87
query16	0.38	0.38	0.38
query17	1.08	1.04	1.07
query18	0.23	0.21	0.22
query19	1.95	1.82	1.88
query20	0.01	0.02	0.01
query21	15.41	0.89	0.55
query22	0.75	1.24	0.71
query23	14.82	1.36	0.57
query24	7.44	1.60	0.32
query25	0.28	0.10	0.11
query26	0.68	0.17	0.14
query27	0.06	0.06	0.05
query28	9.15	0.85	0.46
query29	12.52	3.94	3.31
query30	0.29	0.09	0.07
query31	2.82	0.59	0.39
query32	3.22	0.56	0.46
query33	2.99	3.08	3.11
query34	16.16	5.38	4.72
query35	4.80	4.79	4.81
query36	0.69	0.49	0.49
query37	0.09	0.06	0.07
query38	0.04	0.04	0.03
query39	0.03	0.02	0.02
query40	0.18	0.15	0.13
query41	0.07	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 103.65 s
Total hot run time: 28.86 s

// If enable_json_decimal_as_string is true, we output decimal as string
// to avoid precision loss.
os_.put('"');
os_.write(value_str.data(), value_str.size());
Copy link
Member

Choose a reason for hiding this comment

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

why not just keep this branch ? string_to_float will lost precision, and user maybe confused?

}

private:
uint32_t _precision;
Copy link
Member

Choose a reason for hiding this comment

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

is uint_8 enough for _precision and _scale?

return JsonbDocument::checkAndCreateDocument(getOutput()->getBuffer(),
getOutput()->getSize());
JsonbDocument* doc = nullptr;
auto st = JsonbDocument::checkAndCreateDocument(getOutput()->getBuffer(),
Copy link
Member

Choose a reason for hiding this comment

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

use THROW_IF_ERROR

template <JsonbDecimalType T>
void JsonbToJson::decimal_to_json(const T& value, const uint32_t precision, const uint32_t scale) {
auto value_str = value.to_string(precision, scale);
if (config::enable_json_decimal_as_string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

不要加这种config,没什么意义。
jsonb ---> json string, 对于decimal 我们的预定义行为就是转成number,或者说float。 如果用户认为应该是string,那么应该用户自己去处理一下jsonb 里的decimal,提前转成string。我们不要把一些用户能自己做的事情,或者可选的事情,变成我们这里的开关。

@yiguolei yiguolei changed the title [opt](jsonb) Add decimal/date/datatime type in JsonbDocument [feature](jsonb) Add decimal/date/datatime type in JsonbDocument Jun 18, 2025
sizeof(uint32_t) * 2); // decimal128
}
case JsonbType::T_Decimal256: {
return (sizeof(type_) + sizeof(vectorized::Decimal256::NativeType) +
Copy link
Contributor

Choose a reason for hiding this comment

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

这种逻辑应该移动到decimal的jsonb value 里来维护,否则后面有人去把scale 改成uint8,直接废了

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 61.37% (529/862) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.40% (15082/26740)
Line Coverage 45.14% (134813/298682)
Region Coverage 44.26% (67796/153187)
Branch Coverage 38.82% (34807/89666)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 60.15% (474/788) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 61.40% (16154/26309)
Line Coverage 50.87% (151826/298433)
Region Coverage 48.17% (86770/180121)
Branch Coverage 41.68% (42683/102396)

@mrhhsg mrhhsg changed the title [feature](jsonb) Add decimal/date/datatime type in JsonbDocument [feature](jsonb) Add decimal type in JsonbDocument Jun 18, 2025
@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 18, 2025

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17594	5118	4992	4992
q2	1938	283	184	184
q3	10386	1318	710	710
q4	10233	995	535	535
q5	7551	2374	2340	2340
q6	184	162	128	128
q7	882	743	618	618
q8	9332	1306	1186	1186
q9	6775	5077	5091	5077
q10	6905	2381	1970	1970
q11	508	293	290	290
q12	349	350	210	210
q13	17788	3655	3016	3016
q14	243	229	213	213
q15	546	482	481	481
q16	435	436	379	379
q17	631	860	394	394
q18	7520	7216	7083	7083
q19	2196	970	554	554
q20	330	334	231	231
q21	3972	3176	2346	2346
q22	1023	994	969	969
Total cold run time: 107321 ms
Total hot run time: 33906 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5150	5029	5050	5029
q2	247	314	225	225
q3	2151	2613	2333	2333
q4	1349	1757	1373	1373
q5	4223	4121	4443	4121
q6	224	183	137	137
q7	1978	1930	1746	1746
q8	2582	2612	2545	2545
q9	7191	7121	7076	7076
q10	3125	3268	2818	2818
q11	566	523	493	493
q12	676	752	615	615
q13	3488	3970	3289	3289
q14	278	292	278	278
q15	531	476	464	464
q16	435	492	421	421
q17	1155	1518	1396	1396
q18	7449	7132	6982	6982
q19	795	804	856	804
q20	1901	1966	1824	1824
q21	4713	4397	4227	4227
q22	1045	1020	963	963
Total cold run time: 51252 ms
Total hot run time: 49159 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185414 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 b36a2740789a36dc611351824623644b86cff441, data reload: false

query1	981	381	385	381
query2	6537	1818	1800	1800
query3	6745	231	215	215
query4	25962	23710	23628	23628
query5	4861	649	458	458
query6	306	211	195	195
query7	4634	485	299	299
query8	267	217	218	217
query9	8687	2630	2631	2630
query10	511	329	272	272
query11	15356	15119	14789	14789
query12	168	110	108	108
query13	1686	525	391	391
query14	9354	6022	6146	6022
query15	203	186	166	166
query16	7349	627	459	459
query17	1133	684	552	552
query18	1994	412	296	296
query19	188	188	160	160
query20	126	119	147	119
query21	215	134	104	104
query22	4222	4187	4056	4056
query23	33963	32833	32921	32833
query24	8416	2328	2375	2328
query25	537	457	381	381
query26	725	261	152	152
query27	2711	504	337	337
query28	4327	2126	2094	2094
query29	671	540	422	422
query30	284	218	193	193
query31	912	856	751	751
query32	69	64	60	60
query33	540	352	317	317
query34	798	835	539	539
query35	773	813	711	711
query36	941	976	881	881
query37	108	99	74	74
query38	4101	4103	4028	4028
query39	1481	1434	1397	1397
query40	215	127	111	111
query41	68	63	65	63
query42	123	109	109	109
query43	493	518	483	483
query44	1322	818	817	817
query45	177	173	169	169
query46	834	1022	627	627
query47	1738	1782	1741	1741
query48	397	421	315	315
query49	716	498	420	420
query50	653	679	412	412
query51	4193	4135	4077	4077
query52	112	108	103	103
query53	229	261	188	188
query54	593	577	512	512
query55	118	82	85	82
query56	307	298	277	277
query57	1177	1184	1115	1115
query58	269	254	254	254
query59	2582	2603	2483	2483
query60	313	314	324	314
query61	124	124	130	124
query62	812	711	644	644
query63	226	187	185	185
query64	3149	1045	706	706
query65	4237	4172	4190	4172
query66	971	413	307	307
query67	15715	15473	15349	15349
query68	7951	894	527	527
query69	469	297	260	260
query70	1154	1063	1135	1063
query71	479	321	302	302
query72	5257	4717	4685	4685
query73	685	590	348	348
query74	8835	9128	8936	8936
query75	3835	3190	2699	2699
query76	3656	1195	764	764
query77	785	381	302	302
query78	10122	10139	9375	9375
query79	2205	782	579	579
query80	592	512	448	448
query81	499	255	226	226
query82	446	125	100	100
query83	259	245	232	232
query84	252	108	101	101
query85	780	351	369	351
query86	401	299	287	287
query87	4366	4414	4338	4338
query88	3706	2284	2269	2269
query89	383	312	288	288
query90	1854	207	202	202
query91	136	137	114	114
query92	74	65	59	59
query93	1711	933	598	598
query94	658	390	309	309
query95	374	292	285	285
query96	504	570	279	279
query97	2683	2783	2659	2659
query98	238	219	206	206
query99	1430	1393	1249	1249
Total cold run time: 271484 ms
Total hot run time: 185414 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 29.88 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b36a2740789a36dc611351824623644b86cff441, data reload: false

query1	0.04	0.03	0.03
query2	0.07	0.04	0.03
query3	0.24	0.06	0.07
query4	1.62	0.10	0.11
query5	0.44	0.42	0.40
query6	1.17	0.67	0.66
query7	0.02	0.02	0.02
query8	0.05	0.03	0.03
query9	0.58	0.49	0.52
query10	0.56	0.58	0.58
query11	0.15	0.12	0.11
query12	0.14	0.11	0.12
query13	0.62	0.60	0.61
query14	0.81	0.80	0.81
query15	0.87	0.87	0.88
query16	0.38	0.38	0.39
query17	1.04	1.07	1.10
query18	0.22	0.21	0.22
query19	1.94	1.84	1.88
query20	0.02	0.01	0.01
query21	15.40	0.92	0.54
query22	0.76	1.08	0.60
query23	15.14	1.37	0.63
query24	6.57	1.97	1.15
query25	0.49	0.12	0.23
query26	0.44	0.18	0.14
query27	0.07	0.05	0.05
query28	10.41	0.90	0.45
query29	12.53	4.11	3.41
query30	0.27	0.09	0.06
query31	2.82	0.61	0.40
query32	3.25	0.56	0.47
query33	3.01	3.11	3.14
query34	15.91	5.43	4.75
query35	4.89	4.82	4.77
query36	0.70	0.51	0.49
query37	0.08	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.03	0.03
query40	0.16	0.14	0.14
query41	0.08	0.03	0.02
query42	0.04	0.03	0.02
query43	0.04	0.03	0.03
Total cold run time: 104.12 s
Total hot run time: 29.88 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 62.00% (478/771) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.39% (15067/26719)
Line Coverage 45.13% (134720/298523)
Region Coverage 44.25% (67756/153110)
Branch Coverage 38.79% (34747/89566)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 61.54% (456/741) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 61.19% (16085/26289)
Line Coverage 50.71% (151271/298315)
Region Coverage 48.01% (86465/180088)
Branch Coverage 41.50% (42462/102330)

@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 19, 2025

run buildall

}
case JsonbType::T_Null:
case JsonbType::T_True:
case JsonbType::T_False:
default:
return 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的default 为什么不是抛异常?而是返回一个0?

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17584	5283	4924	4924
q2	1948	298	214	214
q3	10239	1295	734	734
q4	10219	1005	551	551
q5	7501	2392	2289	2289
q6	185	162	132	132
q7	895	768	638	638
q8	9334	1276	1107	1107
q9	6802	5143	5161	5143
q10	6967	2393	1986	1986
q11	500	300	283	283
q12	352	372	220	220
q13	17773	3763	3143	3143
q14	228	226	225	225
q15	564	488	498	488
q16	441	462	386	386
q17	629	872	388	388
q18	7638	7070	6964	6964
q19	1994	968	569	569
q20	347	350	242	242
q21	4121	3232	2464	2464
q22	1073	1029	965	965
Total cold run time: 107334 ms
Total hot run time: 34055 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5200	5049	5241	5049
q2	243	331	237	237
q3	2180	2660	2285	2285
q4	1376	1786	1325	1325
q5	4223	4165	4414	4165
q6	215	171	133	133
q7	2000	1929	1741	1741
q8	2604	2654	2518	2518
q9	7045	7112	6982	6982
q10	3100	3298	2862	2862
q11	565	530	490	490
q12	693	781	619	619
q13	3583	3941	3325	3325
q14	283	307	268	268
q15	522	496	492	492
q16	443	481	441	441
q17	1154	1559	1403	1403
q18	7514	7212	7076	7076
q19	823	772	876	772
q20	1940	1992	1844	1844
q21	4921	4403	4337	4337
q22	1054	1035	957	957
Total cold run time: 51681 ms
Total hot run time: 49321 ms

void JsonbToJson::decimal_to_json(const T& value, const uint32_t precision, const uint32_t scale) {
auto value_str = value.to_string(precision, scale);

StringParser::ParseResult result;
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为什么要先转string,然后再转float?我们decimal 转float 没有直接的方法?cast 里是怎么实现的?

@doris-robot
Copy link

TPC-DS: Total hot run time: 188464 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 59c6ef93fe6b55654a492e99033cdcb5bfed0cb6, data reload: false

query1	992	403	414	403
query2	6534	1969	1910	1910
query3	6748	229	227	227
query4	26332	23834	23617	23617
query5	4366	680	473	473
query6	287	199	192	192
query7	4630	520	297	297
query8	271	232	214	214
query9	8601	2792	2808	2792
query10	497	350	287	287
query11	15616	15094	14876	14876
query12	157	120	121	120
query13	1672	557	426	426
query14	8919	6334	6363	6334
query15	207	195	171	171
query16	7372	655	465	465
query17	1217	746	606	606
query18	2000	430	320	320
query19	206	203	179	179
query20	136	128	125	125
query21	225	138	111	111
query22	4240	4113	4088	4088
query23	34092	33334	33218	33218
query24	8520	2486	2436	2436
query25	563	452	404	404
query26	1246	276	160	160
query27	2734	534	359	359
query28	4322	2211	2205	2205
query29	783	580	439	439
query30	293	227	209	209
query31	931	868	805	805
query32	70	69	65	65
query33	564	364	316	316
query34	827	898	567	567
query35	798	827	731	731
query36	993	1025	923	923
query37	117	107	80	80
query38	4199	4190	4098	4098
query39	1493	1425	1437	1425
query40	214	129	124	124
query41	64	61	62	61
query42	126	117	112	112
query43	528	543	515	515
query44	1394	872	865	865
query45	183	178	171	171
query46	897	1067	663	663
query47	1793	1811	1728	1728
query48	383	439	323	323
query49	744	490	412	412
query50	682	707	435	435
query51	4124	4199	4180	4180
query52	115	114	97	97
query53	237	270	192	192
query54	605	597	518	518
query55	94	85	84	84
query56	298	318	308	308
query57	1173	1184	1121	1121
query58	279	278	261	261
query59	2708	2866	2708	2708
query60	337	338	319	319
query61	126	129	129	129
query62	860	716	671	671
query63	237	201	200	200
query64	4355	1026	696	696
query65	4295	4204	4206	4204
query66	1146	412	332	332
query67	16037	15717	15338	15338
query68	7984	945	563	563
query69	473	312	272	272
query70	1214	1139	1119	1119
query71	473	340	324	324
query72	5734	4732	4695	4695
query73	679	619	377	377
query74	9209	8827	8717	8717
query75	3895	3203	2717	2717
query76	3688	1230	865	865
query77	806	396	310	310
query78	10149	10094	9537	9537
query79	2977	870	608	608
query80	805	550	462	462
query81	498	264	232	232
query82	489	129	100	100
query83	298	270	244	244
query84	300	113	97	97
query85	795	356	395	356
query86	386	287	302	287
query87	4451	4470	4393	4393
query88	3694	2372	2368	2368
query89	408	315	306	306
query90	1831	215	215	215
query91	141	142	115	115
query92	84	63	57	57
query93	2224	1022	635	635
query94	672	405	313	313
query95	393	306	296	296
query96	532	621	294	294
query97	2826	2794	2660	2660
query98	248	210	215	210
query99	1439	1395	1280	1280
Total cold run time: 277599 ms
Total hot run time: 188464 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 29.54 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 59c6ef93fe6b55654a492e99033cdcb5bfed0cb6, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.03
query3	0.25	0.08	0.06
query4	1.60	0.10	0.11
query5	0.45	0.41	0.42
query6	1.15	0.67	0.68
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.58	0.53	0.51
query10	0.59	0.59	0.58
query11	0.16	0.11	0.11
query12	0.15	0.11	0.12
query13	0.64	0.62	0.61
query14	0.82	0.82	0.83
query15	0.92	0.89	0.90
query16	0.40	0.39	0.38
query17	1.07	1.06	1.07
query18	0.24	0.22	0.21
query19	2.01	1.90	1.91
query20	0.02	0.01	0.01
query21	15.40	0.91	0.57
query22	0.78	1.23	0.78
query23	14.73	1.39	0.66
query24	6.65	2.31	0.34
query25	0.35	0.18	0.14
query26	0.52	0.17	0.14
query27	0.07	0.06	0.06
query28	9.37	0.93	0.47
query29	12.54	3.98	3.37
query30	0.25	0.09	0.08
query31	2.83	0.64	0.41
query32	3.24	0.56	0.49
query33	3.06	3.05	3.16
query34	16.13	5.51	4.79
query35	4.86	4.85	4.80
query36	0.70	0.51	0.49
query37	0.09	0.07	0.07
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	0.14
query41	0.09	0.03	0.03
query42	0.03	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 103.24 s
Total hot run time: 29.54 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 45.30% (477/1053) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.39% (15067/26719)
Line Coverage 45.13% (134719/298518)
Region Coverage 44.25% (67751/153112)
Branch Coverage 38.80% (34749/89566)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 44.42% (454/1022) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 61.04% (16048/26289)
Line Coverage 50.53% (150743/298310)
Region Coverage 47.83% (86144/180090)
Branch Coverage 41.35% (42317/102330)

@mrhhsg
Copy link
Member Author

mrhhsg commented Jun 19, 2025

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants