Skip to content

[Feature](encoding) Add float_type_default_use_plain_encoding table property - #62085

Closed
bobhan1 wants to merge 2 commits into
apache:masterfrom
bobhan1:float-use-plain-encoding
Closed

[Feature](encoding) Add float_type_default_use_plain_encoding table property#62085
bobhan1 wants to merge 2 commits into
apache:masterfrom
bobhan1:float-use-plain-encoding

Conversation

@bobhan1

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:

FLOAT/DOUBLE types always default to BIT_SHUFFLE encoding. Users need a table property to control whether PLAIN encoding is used instead, similar to the existing integer_type_default_use_plain_encoding for integer types.

This PR adds a new immutable table property float_type_default_use_plain_encoding (boolean, default false):

  • When set to true, FLOAT/DOUBLE columns use PLAIN encoding instead of BIT_SHUFFLE
  • Cannot be modified after table creation (ALTER TABLE throws error)
  • Displayed in SHOW CREATE TABLE output
  • Orthogonal to storage format (V3 does not auto-enable this)
  • Propagated through both non-cloud (thrift) and cloud (protobuf) paths

Usage:

CREATETABLEt (k int, v1 float, v2 double)
DUPLICATE KEY(k)
DISTRIBUTED BY HASH(k) BUCKETS 1
PROPERTIES("float_type_default_use_plain_encoding"="true");

Release note

Add a new table property float_type_default_use_plain_encoding to control whether FLOAT/DOUBLE types use PLAIN encoding instead of the default BIT_SHUFFLE encoding.

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

@Thearas

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?

Add a new immutable table property 'float_type_default_use_plain_encoding'
that controls whether FLOAT/DOUBLE column types use PLAIN encoding instead
of the default BIT_SHUFFLE encoding.
- Property is boolean, defaults to false
- Cannot be modified after table creation (ALTER TABLE throws error)
- Displayed in SHOW CREATE TABLE output
- Orthogonal to storage format (V3 does not auto-enable this)
- Propagated through both non-cloud (thrift) and cloud (protobuf) paths
- BE encoding hook transforms BIT_SHUFFLE -> PLAIN for float/double types
when enabled
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bobhan1
bobhan1force-pushed the float-use-plain-encoding branch from 5f0eb61 to fe5ebb6CompareApril 3, 2026 04:09
@bobhan1

Copy link
Copy Markdown
ContributorAuthor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage78.48% (1798/2291)
Line Coverage64.18% (32288/50310)
Region Coverage65.04% (16186/24886)
Branch Coverage55.51% (8627/15542)

@doris-robot

Copy link
Copy Markdown

BE UT Coverage Report

Increment line coverage 90.91% (40/44) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage52.96% (20071/37899)
Line Coverage36.55% (188576/515986)
Region Coverage32.82% (146501/446412)
Branch Coverage33.96% (64143/188862)

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 29014 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit fe5ebb6d2a0ba2171e76588e0f5339038062ad61, 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	17620	3664	3654	3654
q2	q3	10684	881	616	616
q4	4680	466	368	368
q5	7457	1340	1140	1140
q6	185	177	143	143
q7	923	985	777	777
q8	9341	1444	1355	1355
q9	5548	5291	5283	5283
q10	6258	2037	1773	1773
q11	475	278	294	278
q12	639	452	285	285
q13	18039	2766	2156	2156
q14	283	287	260	260
q15	q16	858	848	785	785
q17	1080	1153	717	717
q18	6510	5697	5618	5618
q19	1174	1174	1083	1083
q20	555	426	299	299
q21	4782	2499	2051	2051
q22	500	444	373	373
Total cold run time: 97591 ms
Total hot run time: 29014 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	4490	4479	4556	4479
q2	q3	4602	4758	4231	4231
q4	2027	2071	1354	1354
q5	4899	4975	5216	4975
q6	186	170	136	136
q7	2046	1822	1639	1639
q8	3469	3103	3067	3067
q9	8292	8479	8267	8267
q10	4594	4525	4260	4260
q11	693	410	393	393
q12	684	747	492	492
q13	2689	3050	2353	2353
q14	285	286	275	275
q15	q16	761	797	666	666
q17	1279	1275	1193	1193
q18	8064	6964	6998	6964
q19	1147	1137	1169	1137
q20	2208	2204	1938	1938
q21	5959	5387	4898	4898
q22	608	523	427	427
Total cold run time: 58982 ms
Total hot run time: 53144 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 178692 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 fe5ebb6d2a0ba2171e76588e0f5339038062ad61, data reload: false
query5	4333	673	527	527
query6	337	228	214	214
query7	4303	602	320	320
query8	336	242	232	232
query9	8714	3865	3886	3865
query10	460	358	325	325
query11	6637	5488	5134	5134
query12	187	131	129	129
query13	1303	608	426	426
query14	5731	5174	4781	4781
query14_1	4183	4092	4129	4092
query15	218	208	186	186
query16	1020	471	473	471
query17	1162	804	669	669
query18	2515	494	388	388
query19	227	214	184	184
query20	144	137	129	129
query21	230	157	126	126
query22	13901	14866	14397	14397
query23	18291	17118	16700	16700
query23_1	16865	16909	16990	16909
query24	7572	1760	1379	1379
query24_1	1356	1367	1335	1335
query25	599	483	432	432
query26	1263	316	179	179
query27	2653	626	373	373
query28	4460	1916	1898	1898
query29	963	670	567	567
query30	303	236	201	201
query31	1093	1043	947	947
query32	87	72	78	72
query33	542	342	296	296
query34	1202	1187	677	677
query35	724	773	674	674
query36	1276	1212	1059	1059
query37	156	102	86	86
query38	3065	3030	2957	2957
query39	917	888	853	853
query39_1	838	843	839	839
query40	234	190	131	131
query41	62	59	59	59
query42	113	110	105	105
query43	308	317	274	274
query44 query45	207	199	190	190
query46	1144	1277	793	793
query47	2341	2367	2236	2236
query48	416	425	302	302
query49	641	528	438	438
query50	743	292	218	218
query51	4410	4280	4214	4214
query52	109	108	99	99
query53	255	266	204	204
query54	314	284	261	261
query55	102	99	90	90
query56	302	308	325	308
query57	1719	1660	1551	1551
query58	303	280	272	272
query59	2867	3009	2739	2739
query60	337	347	333	333
query61	159	158	161	158
query62	711	620	574	574
query63	252	205	213	205
query64	5321	1295	1023	1023
query65 query66	1484	481	368	368
query67	24265	24303	24287	24287
query68 query69	445	338	300	300
query70	1013	963	964	963
query71	328	288	271	271
query72	3000	2742	2512	2512
query73	817	838	488	488
query74	9884	9737	9566	9566
query75	2753	2614	2321	2321
query76	2323	1110	738	738
query77	394	400	343	343
query78	11420	11375	10796	10796
query79	1524	1161	814	814
query80	714	583	500	500
query81	465	280	237	237
query82	1327	157	124	124
query83	395	311	264	264
query84	258	154	123	123
query85	882	491	449	449
query86	391	317	305	305
query87	3304	3200	3080	3080
query88	3577	2699	2696	2696
query89	434	390	361	361
query90	1991	178	178	178
query91	182	171	140	140
query92	79	77	73	73
query93	971	962	557	557
query94	523	350	302	302
query95	674	465	333	333
query96	1064	806	352	352
query97	2682	2667	2583	2583
query98	253	226	221	221
query99	1075	1074	961	961
Total cold run time: 257695 ms
Total hot run time: 178692 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 91.78% (67/73) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage73.55% (27301/37118)
Line Coverage57.17% (294105/514415)
Region Coverage54.50% (245566/450550)
Branch Coverage56.13% (106332/189444)

…when true
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bobhan1
bobhan1force-pushed the float-use-plain-encoding branch from 2c9dc6e to dfcec16CompareApril 3, 2026 09:10
@bobhan1

Copy link
Copy Markdown
ContributorAuthor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage78.48% (1798/2291)
Line Coverage64.17% (32286/50310)
Region Coverage65.02% (16182/24886)
Branch Coverage55.49% (8625/15542)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 90.91% (40/44) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage52.97% (20074/37896)
Line Coverage36.55% (188529/515874)
Region Coverage32.80% (146388/446306)
Branch Coverage33.95% (64099/188808)

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 28957 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit dfcec16306feb818d78697a1b94da5b2ba881c2c, 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	17899	3757	3706	3706
q2	q3	10695	874	616	616
q4	4680	465	358	358
q5	7474	1340	1140	1140
q6	186	167	135	135
q7	914	949	761	761
q8	9308	1459	1307	1307
q9	5571	5316	5272	5272
q10	6254	2059	1748	1748
q11	471	282	278	278
q12	636	403	281	281
q13	18025	2791	2179	2179
q14	281	284	267	267
q15	q16	863	859	784	784
q17	1072	1136	771	771
q18	6450	5770	5546	5546
q19	1137	1268	1105	1105
q20	547	429	285	285
q21	4197	2557	2073	2073
q22	528	436	345	345
Total cold run time: 97188 ms
Total hot run time: 28957 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	4649	4539	4765	4539
q2	q3	4646	4731	4167	4167
q4	2072	2078	1331	1331
q5	5016	5043	5299	5043
q6	194	169	140	140
q7	2020	1800	1640	1640
q8	3332	3047	3079	3047
q9	8304	8234	8249	8234
q10	4413	4463	4344	4344
q11	603	427	388	388
q12	678	864	498	498
q13	2785	3119	2336	2336
q14	304	306	282	282
q15	q16	767	785	760	760
q17	1292	1306	1240	1240
q18	7842	7019	6991	6991
q19	1120	1142	1161	1142
q20	2271	2256	2106	2106
q21	6003	5370	4818	4818
q22	534	496	434	434
Total cold run time: 58845 ms
Total hot run time: 53480 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 178538 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 dfcec16306feb818d78697a1b94da5b2ba881c2c, data reload: false
query5	4340	666	515	515
query6	349	225	207	207
query7	4231	588	327	327
query8	340	236	219	219
query9	8720	3885	3908	3885
query10	455	374	319	319
query11	6920	5511	5151	5151
query12	192	132	125	125
query13	1309	608	459	459
query14	5679	5217	4760	4760
query14_1	4129	4121	4124	4121
query15	217	207	190	190
query16	1035	512	436	436
query17	1144	726	604	604
query18	2601	495	366	366
query19	225	204	170	170
query20	140	132	126	126
query21	224	149	119	119
query22	13954	14880	14563	14563
query23	18177	17347	16611	16611
query23_1	16783	16925	16670	16670
query24	7553	1736	1331	1331
query24_1	1344	1345	1372	1345
query25	599	491	439	439
query26	1257	327	178	178
query27	2672	606	363	363
query28	4484	1924	1883	1883
query29	951	684	602	602
query30	300	224	196	196
query31	1098	1040	945	945
query32	87	70	71	70
query33	547	349	287	287
query34	1189	1143	696	696
query35	757	767	675	675
query36	1243	1242	1100	1100
query37	155	100	81	81
query38	3096	3020	3069	3020
query39	915	889	868	868
query39_1	856	835	836	835
query40	244	147	130	130
query41	62	59	58	58
query42	116	107	107	107
query43	321	326	287	287
query44 query45	209	199	185	185
query46	1205	1267	845	845
query47	2327	2361	2243	2243
query48	447	423	326	326
query49	631	542	437	437
query50	784	298	229	229
query51	4468	4360	4289	4289
query52	112	107	96	96
query53	254	267	197	197
query54	322	274	263	263
query55	98	94	89	89
query56	314	301	312	301
query57	1699	1723	1641	1641
query58	298	280	272	272
query59	2879	2963	2750	2750
query60	338	337	320	320
query61	159	152	156	152
query62	692	622	566	566
query63	239	191	199	191
query64	5249	1432	968	968
query65 query66	1420	482	372	372
query67	24294	24348	24151	24151
query68 query69	441	339	315	315
query70	979	1016	961	961
query71	336	278	280	278
query72	3025	2731	2402	2402
query73	815	811	429	429
query74	9926	9761	9573	9573
query75	2745	2618	2315	2315
query76	2306	1123	740	740
query77	397	420	346	346
query78	11288	11271	10786	10786
query79	1466	1076	789	789
query80	731	614	532	532
query81	449	285	244	244
query82	1155	157	124	124
query83	392	301	267	267
query84	281	158	130	130
query85	954	566	522	522
query86	388	311	300	300
query87	3232	3204	3098	3098
query88	3584	2701	2695	2695
query89	432	396	377	377
query90	1969	180	178	178
query91	192	178	153	153
query92	78	81	73	73
query93	970	935	576	576
query94	556	329	282	282
query95	654	456	346	346
query96	963	800	347	347
query97	2679	2667	2541	2541
query98	239	234	237	234
query99	1061	1059	953	953
Total cold run time: 257342 ms
Total hot run time: 178538 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 90.91% (40/44) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage73.65% (27333/37112)
Line Coverage57.24% (294402/514293)
Region Coverage54.49% (245459/450440)
Branch Coverage56.18% (106406/189390)

@bobhan1

Copy link
Copy Markdown
ContributorAuthor

use #62649 instead

@bobhan1bobhan1 closed this Apr 21, 2026
Sign up for freeto 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.

4 participants

@bobhan1@Thearas@hello-stephen@doris-robot