Skip to content

[feature](compression) Support per-column compression for non-cloud - #66169

Open
zwy991114 wants to merge 3 commits into
apache:masterfrom
zwy991114:feature/per-column-compression-codec
Open

[feature](compression) Support per-column compression for non-cloud#66169
zwy991114 wants to merge 3 commits into
apache:masterfrom
zwy991114:feature/per-column-compression-codec

Conversation

@zwy991114

@zwy991114 zwy991114 commented Jul 28, 2026

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Doris only supports a single compression codec configured at the table level (via PROPERTIES("compression"=...)), applied uniformly to every column. In real workloads, columns have very different data characteristics — highly redundant text columns (URLs, referers, search phrases) compress far better under a high-level ZSTD/LZ4HC codec, while numeric/low-cardinality columns gain little and pay the CPU cost. There was no way to tune the codec per column.

This PR adds per-column generic compression codec support for non-cloud (OLAP) tables. Users can specify a codec and optional level directly on a column:

CREATE TABLE t (
    k INT,
    url STRING COMPRESSION 'zstd:19',
    tag VARCHAR(64) COMPRESSION 'lz4hc:12'
)
DUPLICATE KEY(k)
DISTRIBUTED BY HASH(k) BUCKETS 1;

Compression ratio test on ClickBench hits:

Loaded the ClickBench hits dataset into two tables with identical schema. One table (baseline) uses the ZSTD level 3 default on every column; the other overrides five heavy text columns with COMPRESSION 'zstd:19'. After forcing full compaction on both, per-column sizes were read from information_schema.column_data_sizes.

Column Baseline(zstd:3) Per-column(zstd:19) Ratio improvement
OriginalURL 5.233 6.401 +22.3%
Referer 3.574 4.396 +23.0%
SearchPhrase 4.015 4.970 +23.8%
Title 4.676 5.690 +21.7%
URL 3.954 4.905 +24.1%

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?

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?

@zwy991114

Copy link
Copy Markdown
Author

run buildall

1 similar comment
@csun5285

Copy link
Copy Markdown
Contributor

run buildall

@csun5285

Copy link
Copy Markdown
Contributor

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.62% (1908/2458)
Line Coverage 64.46% (34145/52968)
Region Coverage 64.87% (17564/27076)
Branch Coverage 54.05% (9418/17424)

@github-actions github-actions Bot left a comment

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.

Requesting changes for seven P1 findings and one P2 finding. No additional user-provided review focus was supplied, so I reviewed the whole PR.

Critical checkpoint conclusions:

  • Goal and scope: the PR coherently adds a per-column codec and optional level across SQL, FE catalog/protocol, tablet schema, and both segment writers. The ordinary non-cloud scalar path is largely connected, but cloud/full schema change, compression-only MODIFY, light CCR SQL, complex AGG_STATE storage, codec lifetime/accounting, and test gaps mean the goal is not safely complete.
  • Size and focus: the cross-module scope is necessary for this feature and unrelated production changes were not found.
  • Concurrency and lifecycle: codec pools are mutex-protected, writer ownership keeps the observer pointer valid, and no new race, lock-order, or deadlock issue was found. The new owned-codec lifecycle does create the retained-workspace multiplier and allocation/free tracker mismatch called out inline.
  • Configuration and compatibility: no configuration item is added. Optional thrift/protobuf/footer fields remain readable by compatible readers; old BEs can ignore the write policy during a rolling upgrade and emit the table codec, which is storage-policy drift rather than unreadable data.
  • Parallel paths and conditions: legacy, vertical, row-binlog, schema-change, and compaction writers implement small-segment suppression > explicit override > table default when every physical schema node carries the policy. The cloud protobuf omission and complex AGG_STATE child/auxiliary metas are the exceptions. Compression in general Column.equals() also reaches routing/type guards that should not treat it as a logical change.
  • Tests and results: none of the changed tests observes requested-level application; the regression write is below the compression-suppression threshold, and the suite lacks the required generated result contract. Per the review-only task contract I did not run local builds/tests; this checkout also lacks .worktree_initialized, thirdparty/installed, and protoc. Live CI currently has compile, FE UT, macOS BE UT, style, license, and secret checks passing; BE UT is ERROR, Cloud UT is FAILURE, several regression/performance checks are pending, and the PR title checker is failing.
  • Observability and persistence: SHOW CREATE from the catalog column renders the policy, but reconstructed command SQL omits it. Local edit-log replay retains schema objects; the light CCR binlog executes the incomplete rawSql and loses the clause. Full cloud shadow-tablet protobuf construction separately drops the fields.
  • Data writes and transactions: no visible-version, transaction, delete-bitmap, or atomicity mechanism is changed. Segments remain readable because the actual codec is stored in the footer, but affected paths silently write a different policy from the DDL.
  • Performance: a private reusable native workspace per levelled column/open segment is an unbounded schema-width multiplier and is not included in segment buffer estimation.
  • Other: no security-sensitive behavior, new metric, or dynamic configuration requirement was introduced.

PR metadata also needs cleanup: the title does not match the required bracketed format (for example, [feature](compression) Support per-column compression for non-cloud); Issue Number and Related PR still contain #xxx; and this user-visible feature is marked both Release note: None and Behavior changed: No while documentation is checked without a link.

Comment thread fe/fe-catalog/src/main/java/org/apache/doris/catalog/Column.java
Comment thread be/src/util/block_compression.cpp Outdated
Comment thread be/src/util/block_compression.cpp Outdated
Comment thread be/test/storage/segment/column_compression_roundtrip_test.cpp Outdated
Comment thread regression-test/suites/ddl_p0/test_column_compression.groovy Outdated
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 97.87% (92/94) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 58.18% (24679/42416)
Line Coverage 42.22% (246541/583967)
Region Coverage 38.10% (195874/514065)
Branch Coverage 39.24% (88499/225519)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17687	4149	4163	4149
q2	2061	332	201	201
q3	10832	1458	819	819
q4	4794	473	340	340
q5	8433	845	554	554
q6	334	168	137	137
q7	813	826	610	610
q8	10498	1568	1595	1568
q9	5817	4342	4324	4324
q10	6763	1752	1447	1447
q11	511	351	330	330
q12	764	577	459	459
q13	18065	3391	2783	2783
q14	268	260	252	252
q15	q16	788	784	709	709
q17	1064	1003	1055	1003
q18	6833	5905	5545	5545
q19	1156	1201	1067	1067
q20	801	692	563	563
q21	5462	2576	2324	2324
q22	448	354	294	294
Total cold run time: 104192 ms
Total hot run time: 29478 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4416	4308	4314	4308
q2	281	320	217	217
q3	4694	4968	4411	4411
q4	2051	2173	1352	1352
q5	4364	4239	4328	4239
q6	232	177	126	126
q7	2258	1895	1593	1593
q8	2494	2155	2155	2155
q9	7765	7624	7701	7624
q10	4758	4643	4196	4196
q11	755	428	393	393
q12	742	754	546	546
q13	3202	3617	2944	2944
q14	304	294	287	287
q15	q16	724	748	654	654
q17	1359	1370	1334	1334
q18	7928	7488	6956	6956
q19	1113	1080	1122	1080
q20	2233	2222	1933	1933
q21	5255	4552	4439	4439
q22	504	463	399	399
Total cold run time: 57432 ms
Total hot run time: 51186 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.87% (92/94) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.41% (31191/41363)
Line Coverage 59.94% (347740/580136)
Region Coverage 56.63% (292121/515856)
Branch Coverage 57.95% (130727/225587)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 177512 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 99ea75a16520b861ae1f049ac39979b2a433463d, data reload: false

query5	4312	642	477	477
query6	457	222	220	220
query7	4867	588	356	356
query8	330	187	173	173
query9	8754	4034	4029	4029
query10	452	358	299	299
query11	5912	2559	2115	2115
query12	155	107	100	100
query13	1272	598	440	440
query14	6257	5200	4880	4880
query14_1	4249	4232	4225	4225
query15	216	198	181	181
query16	1010	482	481	481
query17	1129	712	591	591
query18	2445	485	365	365
query19	210	187	162	162
query20	116	111	108	108
query21	240	161	131	131
query22	13515	13584	13387	13387
query23	17407	16495	16116	16116
query23_1	16208	16194	16196	16194
query24	7610	1747	1268	1268
query24_1	1292	1255	1301	1255
query25	575	464	388	388
query26	1322	354	213	213
query27	2585	627	399	399
query28	4505	1985	1985	1985
query29	1089	632	509	509
query30	348	276	228	228
query31	1126	1099	970	970
query32	111	66	62	62
query33	524	327	265	265
query34	1211	1167	652	652
query35	780	779	658	658
query36	1042	1032	872	872
query37	161	110	94	94
query38	1870	1724	1688	1688
query39	885	905	845	845
query39_1	832	826	844	826
query40	288	165	148	148
query41	69	61	64	61
query42	94	99	94	94
query43	329	326	279	279
query44	1412	768	757	757
query45	196	189	177	177
query46	1059	1193	748	748
query47	2138	2111	1980	1980
query48	408	417	292	292
query49	579	420	311	311
query50	1152	443	346	346
query51	10660	10687	10723	10687
query52	90	87	78	78
query53	262	283	201	201
query54	297	226	216	216
query55	76	69	67	67
query56	308	285	315	285
query57	1310	1301	1188	1188
query58	290	263	252	252
query59	1609	1695	1479	1479
query60	312	285	268	268
query61	149	149	145	145
query62	535	496	431	431
query63	246	203	199	199
query64	2837	1026	883	883
query65	4731	4662	4602	4602
query66	1827	500	388	388
query67	28780	29209	29185	29185
query68	3112	1549	962	962
query69	408	295	267	267
query70	895	813	830	813
query71	374	332	339	332
query72	2997	2891	2412	2412
query73	831	781	438	438
query74	5058	4918	4690	4690
query75	2532	2502	2132	2132
query76	2369	1171	798	798
query77	339	381	281	281
query78	11945	12070	11294	11294
query79	1448	1183	758	758
query80	1279	549	459	459
query81	541	341	296	296
query82	669	155	119	119
query83	370	322	296	296
query84	287	157	129	129
query85	1000	609	538	538
query86	407	242	236	236
query87	1835	1813	1759	1759
query88	3677	2794	2823	2794
query89	428	367	336	336
query90	1932	199	190	190
query91	203	189	160	160
query92	64	62	57	57
query93	1800	1475	1024	1024
query94	733	357	321	321
query95	785	497	459	459
query96	1058	839	377	377
query97	2618	2645	2516	2516
query98	214	211	197	197
query99	1092	1095	963	963
Total cold run time: 263129 ms
Total hot run time: 177512 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.77 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 99ea75a16520b861ae1f049ac39979b2a433463d, data reload: false

query1	0.01	0.01	0.00
query2	0.14	0.07	0.08
query3	0.37	0.25	0.25
query4	1.61	0.24	0.26
query5	0.35	0.31	0.32
query6	1.17	0.67	0.67
query7	0.05	0.00	0.00
query8	0.10	0.08	0.07
query9	0.50	0.38	0.40
query10	0.59	0.59	0.59
query11	0.31	0.17	0.18
query12	0.32	0.19	0.18
query13	0.52	0.53	0.52
query14	0.93	0.94	0.93
query15	0.68	0.59	0.60
query16	0.39	0.39	0.39
query17	1.02	0.99	1.01
query18	0.31	0.30	0.31
query19	1.93	1.82	1.86
query20	0.02	0.02	0.02
query21	15.41	0.38	0.32
query22	4.83	0.13	0.14
query23	15.86	0.50	0.30
query24	2.44	0.62	0.44
query25	0.16	0.11	0.09
query26	0.73	0.27	0.21
query27	0.11	0.10	0.10
query28	3.51	0.89	0.55
query29	12.48	4.24	3.37
query30	0.39	0.27	0.27
query31	2.77	0.63	0.32
query32	3.23	0.60	0.47
query33	2.96	3.01	3.03
query34	15.87	4.06	3.34
query35	3.27	3.24	3.26
query36	0.65	0.53	0.52
query37	0.12	0.10	0.09
query38	0.07	0.07	0.07
query39	0.07	0.06	0.06
query40	0.20	0.17	0.17
query41	0.13	0.08	0.08
query42	0.09	0.06	0.06
query43	0.08	0.08	0.07
Total cold run time: 96.75 s
Total hot run time: 25.77 s

@zwy991114 zwy991114 changed the title feat(compression): support per-column compression for non-cloud [feature](compression) Support per-column compression for non-cloud Jul 29, 2026
@zwy991114
zwy991114 force-pushed the feature/per-column-compression-codec branch from 99ea75a to 3c2c514 Compare July 29, 2026 08:28
@zwy991114
zwy991114 requested a review from luwei16 as a code owner July 29, 2026 08:28
@zwy991114

Copy link
Copy Markdown
Author

run buildall

@zwy991114

Copy link
Copy Markdown
Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 54.29% (38/70) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17739	4135	4250	4135
q2	2026	331	215	215
q3	10814	1522	809	809
q4	4724	470	344	344
q5	8293	860	554	554
q6	314	213	138	138
q7	817	825	628	628
q8	10466	1712	1577	1577
q9	5928	4384	4398	4384
q10	6774	1747	1444	1444
q11	509	360	337	337
q12	778	582	470	470
q13	18095	3261	2747	2747
q14	262	260	234	234
q15	q16	790	783	714	714
q17	1003	965	980	965
q18	7069	5722	5480	5480
q19	1202	1315	1106	1106
q20	772	707	596	596
q21	5573	2589	2524	2524
q22	414	343	295	295
Total cold run time: 104362 ms
Total hot run time: 29696 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4500	4400	4402	4400
q2	285	321	210	210
q3	4570	4960	4393	4393
q4	2052	2134	1380	1380
q5	4415	4249	4278	4249
q6	233	189	247	189
q7	2197	1884	1607	1607
q8	2611	2224	2192	2192
q9	7852	7746	7818	7746
q10	4667	4616	4178	4178
q11	708	419	401	401
q12	745	799	573	573
q13	3333	3630	3066	3066
q14	303	289	269	269
q15	q16	699	726	671	671
q17	1410	1458	1359	1359
q18	8072	7372	6832	6832
q19	1093	1072	1088	1072
q20	2244	2201	1934	1934
q21	5274	4612	4476	4476
q22	531	471	429	429
Total cold run time: 57794 ms
Total hot run time: 51626 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 177250 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 3c2c514505f8986d935b6bf0e5efec2ead8a5b89, data reload: false

query5	4314	613	507	507
query6	455	218	198	198
query7	4852	618	359	359
query8	343	195	189	189
query9	8792	4102	4105	4102
query10	471	367	309	309
query11	5972	2362	2156	2156
query12	171	104	103	103
query13	1267	591	439	439
query14	6263	5201	4935	4935
query14_1	4314	4278	4272	4272
query15	217	211	180	180
query16	970	520	450	450
query17	1129	735	594	594
query18	2458	467	353	353
query19	209	195	153	153
query20	116	105	107	105
query21	233	158	136	136
query22	13527	13500	13428	13428
query23	17412	16603	16160	16160
query23_1	16313	16237	16177	16177
query24	7573	1801	1264	1264
query24_1	1340	1310	1325	1310
query25	593	482	392	392
query26	1347	381	224	224
query27	2556	586	383	383
query28	4450	2011	2017	2011
query29	1091	644	497	497
query30	345	267	225	225
query31	1125	1097	971	971
query32	108	69	62	62
query33	540	327	260	260
query34	1167	1150	661	661
query35	787	791	684	684
query36	1022	1056	864	864
query37	160	116	96	96
query38	1907	1733	1672	1672
query39	873	877	857	857
query39_1	832	873	849	849
query40	248	165	142	142
query41	65	64	63	63
query42	96	90	93	90
query43	330	323	292	292
query44	1458	792	740	740
query45	189	179	172	172
query46	1037	1206	746	746
query47	2098	2087	1997	1997
query48	409	421	301	301
query49	583	419	306	306
query50	1127	429	331	331
query51	10756	10785	10783	10783
query52	91	87	73	73
query53	255	273	210	210
query54	294	248	216	216
query55	75	69	71	69
query56	297	309	290	290
query57	1326	1286	1179	1179
query58	285	265	257	257
query59	1607	1654	1477	1477
query60	309	278	253	253
query61	159	147	141	141
query62	549	497	421	421
query63	243	205	204	204
query64	2839	1025	874	874
query65	4710	4605	4618	4605
query66	1808	498	381	381
query67	29315	29236	28514	28514
query68	3121	1510	953	953
query69	416	330	302	302
query70	949	838	840	838
query71	374	353	343	343
query72	3009	2701	2358	2358
query73	805	778	443	443
query74	5081	4925	4677	4677
query75	2574	2503	2136	2136
query76	2327	1203	813	813
query77	366	392	290	290
query78	11926	11831	11255	11255
query79	1368	1158	750	750
query80	1293	544	463	463
query81	524	332	287	287
query82	623	164	121	121
query83	375	339	305	305
query84	282	162	131	131
query85	966	604	516	516
query86	415	242	227	227
query87	1824	1815	1742	1742
query88	3772	2817	2827	2817
query89	443	385	326	326
query90	1945	202	201	201
query91	204	196	162	162
query92	59	60	55	55
query93	1633	1503	1012	1012
query94	735	365	312	312
query95	802	596	478	478
query96	1074	824	331	331
query97	2620	2609	2481	2481
query98	216	210	204	204
query99	1088	1113	964	964
Total cold run time: 263552 ms
Total hot run time: 177250 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.7 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 3c2c514505f8986d935b6bf0e5efec2ead8a5b89, data reload: false

query1	0.00	0.00	0.00
query2	0.14	0.08	0.08
query3	0.36	0.22	0.24
query4	1.62	0.25	0.25
query5	0.32	0.31	0.32
query6	1.16	0.68	0.67
query7	0.04	0.02	0.00
query8	0.09	0.07	0.07
query9	0.53	0.39	0.38
query10	0.59	0.59	0.60
query11	0.31	0.18	0.18
query12	0.32	0.18	0.18
query13	0.54	0.54	0.52
query14	0.93	0.93	0.93
query15	0.69	0.59	0.61
query16	0.40	0.39	0.40
query17	1.04	1.00	1.03
query18	0.32	0.30	0.30
query19	1.89	1.83	1.82
query20	0.02	0.01	0.01
query21	15.41	0.38	0.31
query22	4.84	0.14	0.14
query23	15.83	0.51	0.29
query24	2.41	0.63	0.43
query25	0.15	0.11	0.10
query26	0.74	0.27	0.22
query27	0.10	0.10	0.10
query28	3.34	0.94	0.53
query29	12.50	4.31	3.34
query30	0.36	0.26	0.26
query31	2.76	0.62	0.32
query32	3.23	0.62	0.48
query33	2.98	2.97	2.98
query34	15.75	4.06	3.40
query35	3.29	3.28	3.28
query36	0.64	0.53	0.49
query37	0.13	0.09	0.10
query38	0.08	0.06	0.06
query39	0.08	0.06	0.06
query40	0.20	0.19	0.16
query41	0.12	0.08	0.07
query42	0.08	0.06	0.05
query43	0.07	0.06	0.07
Total cold run time: 96.4 s
Total hot run time: 25.7 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 96.90% (125/129) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.04% (25561/43292)
Line Coverage 43.12% (256254/594258)
Region Coverage 38.80% (202958/523075)
Branch Coverage 40.14% (92552/230564)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 96.90% (125/129) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.67% (31953/42228)
Line Coverage 60.28% (355846/590294)
Region Coverage 56.82% (298231/524836)
Branch Coverage 58.19% (134190/230618)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 34.06% (47/138) 🎉
Increment coverage report
Complete coverage report

@zwy991114

Copy link
Copy Markdown
Author

/review

@csun5285

csun5285 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

run buildall

@csun5285

csun5285 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Aug 8th, 2026 3:37 AM.
Workflow run: https://github.com/apache/doris/actions/runs/30893346618

The selected account is excluded until 2026-08-08T03:37:00Z. Please trigger /review again; another configured account may be available.

Comment thread gensrc/proto/olap_file.proto Outdated
optional int32 variant_doc_hash_shard_count = 33 [default = 64];
optional bool variant_enable_nested_group = 34 [default = false];
// per-column generic compression override; absent => inherit table-level compression
optional segment_v2.CompressionTypePB compression_type = 35;

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.

增加一个默认值是 unkown

Comment thread be/src/storage/tablet/tablet_schema.h Outdated
bool _has_default_value = false;
std::string _default_value;

bool _has_compression = false;

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.

不需要这个变量

Comment thread be/src/storage/tablet/tablet_schema.h Outdated
void set_type(FieldType type) { _type = type; }
bool is_key() const { return _is_key; }
bool is_nullable() const { return _is_nullable; }
bool has_compression() const { return _has_compression; }

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.

这个用 CompressionTypePB 是否是unkown 判断即可

writer_options.mow_ctx = _context.mow_context;
if (no_compression) {
writer_options.compression_type = NO_COMPRESSION;
writer_options.suppress_compression = true;

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.

这个变量不需要,当设置 ColumnMetaPB 的时候优先使用 TabletColumn 的 compression_type,如果 TabletColumn 的 compression_type 是 UNKOWN ,使用 writer_options.compression_type。

return s_instance;
}

Status get(segment_v2::CompressionTypePB type, int level, BlockCompressionCodec** codec) {

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.

这里如果是旧表的话会传入 level = 0,之前旧表的默认的 ZSTD 或者 LZ4HC 的 level 是 0 吗

&& modColumn.getDataType() == PrimitiveType.VARIANT) {
lightSchemaChange = olapTable.getEnableLightSchemaChange();
}
// compression-only change: the per-column codec is per-segment metadata,

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.

先不支持 schema change

@csun5285

csun5285 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  1. 需要调研一下其他的OLAP 系统的SQL语法是怎么指定压缩算法的,尽量避免独创SQL 语法
  2. 需要测试升降级,是否支持降级,如果不支持在PR 中说明
  3. https://github.com/apache/doris-website 向文档仓库提pr 说明这个功能

@csun5285

csun5285 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.57% (1912/2465)
Line Coverage 64.53% (34217/53024)
Region Coverage 64.44% (17276/26809)
Branch Coverage 53.95% (9251/17148)

@github-actions github-actions Bot left a comment

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.

Automated review of a5ef0e05db837749f8bde5a12186bd666badb0f9 against 8305fe71867fb2acab5a769fe9a098ada59aff50.

I found no additional unique inline finding after reviewing all 29 changed files and suppressing duplicates against the live review threads. This is not an approval: the existing threads and maintainer requirements still need resolution, notably the requested removal of schema-change support for now, mixed-version upgrade/downgrade behavior, compression metadata/default semantics, native ZSTD workspace accounting, production-path level oracles, and regression-test form.

The review focus file adds no extra guidance, so I reviewed the whole PR.

Syntax research requested by the maintainer also remains a product decision. Established systems use different conventions: ClickHouse documents per-column CODEC(ZSTD(3)), Impala/Kudu documents per-column COMPRESSION LZ4, and StarRocks documents compression as a table property. The proposed COMPRESSION 'zstd:9' form should therefore be aligned deliberately rather than treated as an established common syntax. Sources: ClickHouse, Impala/Kudu, StarRocks.

Required checkpoint conclusions:

  • Goal and proof: the code connects non-cloud scalar-column DDL through FE persistence/thrift and BE tablet/footer metadata to level-aware codecs. Unit coverage spans parsing, persistence, both writer metadata builders, codecs, and round trips, but the existing live test-oracle thread correctly notes that the production finalized-footer path and the small-segment regression path still do not prove the requested level is applied.
  • Scope and clarity: the core create/write path is reasonably localized. ADD/MODIFY and compression-only partition/distribution schema-change handling broaden the feature beyond the maintainer's requested current scope and should be removed or deferred as already requested.
  • Concurrency: the process-wide codec registry is mutex-protected; codec construction is outside the lock and duplicate insertion is reconciled under the lock. Returned codec pointers are stable while the production registry lives. The test-only clear hook is safe only under its current serial, no-live-observer use.
  • Lifecycle and static order: leveled codecs and their context pools are process-lifetime objects, avoiding per-column teardown. No new circular ownership or production observer race was found. The existing native allocation/free accounting thread remains unresolved because ZSTD may allocate workspace lazily during compression outside the intended tracker scope.
  • Configuration: no new dynamic configuration item is added. An absent/non-positive column level follows the existing codec singleton/configured-default path; explicit valid levels select bounded leveled instances.
  • Compatibility: absent optional protobuf/thrift fields normalize to inheritance of the table codec, and current enum identities are compile-time guarded. A mixed-version old BE can ignore and persist away a new FE's per-column policy, so rolling upgrade/downgrade support is not established; this matches the maintainer's existing request for testing and disclosure.
  • Parallel paths: ordinary legacy and vertical writers, row-binlog inheritance, segcompaction, and vertical compaction reach the changed metadata initialization. Cloud DDL and complex/AGG_STATE layouts are rejected instead of silently dropping the policy. No additional missed supported writer path was found.
  • Conditions and error handling: codec/type/level validation fails explicitly, and the non-cloud/complex-type gates explain the unsupported boundaries. Small-segment suppression precedence is documented in code but is already disputed in a live maintainer thread; no duplicate comment added.
  • Tests: positive and negative FE/unit coverage exists, and direct codec tests now compare byte streams across levels. Existing threads still cover the missing production-footer oracle, three-row suppression blind spot, upgrade/downgrade coverage, and regression-suite contract violations.
  • Expected results: the checked-in .out contains deterministic ordered query results, but SHOW assertions and final cleanup remain outside the required generated-result/debug-preservation style already reported inline.
  • Observability: this does not add a new distributed state machine, and existing status errors plus stored footer metadata are sufficient for the local write path. No new metric requirement was identified.
  • Persistence and failover: catalog Column state is Gson-persisted, schema-change records retain Column objects, and current FE-to-BE creation persists the fields into ColumnPB. No new master-failover ordering defect was found; mixed-version policy loss remains the compatibility blocker above.
  • Data writes and crash safety: transaction boundaries and segment commit behavior are unchanged; each segment footer records the codec needed for later reads. No new atomicity or crash-consistency defect was found beyond the existing memory-accounting concern.
  • FE/BE variables: codec and level flow through TColumn, ColumnPB, TabletColumn, and both ColumnMetaPB builders. Cloud is explicitly gated. The old-component drop case is the unresolved mixed-version issue.
  • Performance: sharing codecs by (type, level) removes per-column heavyweight pools, and validated levels bound the registry to a small fixed key set. The existing tracker/workspace issue still prevents treating memory accounting as complete.
  • Other issues: no additional correctness, security-boundary, nullable-column, planner-tree, or MoW-specific issue applies to this change. Documentation and release/behavior declarations should be updated as already requested by the maintainer.

No builds or tests were run locally because the authoritative review contract requires static analysis only. At review time, style/license/secret/cloud checks passed; BE, FE, compile, performance, macOS, and automated-review checks were still pending.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 96.90% (125/129) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.83% (32103/42335)
Line Coverage 60.49% (358127/592029)
Region Coverage 56.89% (299532/526548)
Branch Coverage 58.35% (135125/231568)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 50.00% (45/90) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17583	3935	3943	3935
q2	2035	340	203	203
q3	10878	1472	840	840
q4	4811	469	341	341
q5	8507	852	561	561
q6	339	171	136	136
q7	844	808	603	603
q8	10643	1727	1565	1565
q9	5593	4145	4126	4126
q10	6795	1639	1378	1378
q11	510	364	321	321
q12	716	579	454	454
q13	18084	3599	2767	2767
q14	263	263	234	234
q15	q16	742	732	659	659
q17	924	856	933	856
q18	6674	5640	5530	5530
q19	1156	1190	1111	1111
q20	776	682	561	561
q21	6032	2746	2684	2684
q22	448	371	311	311
Total cold run time: 104353 ms
Total hot run time: 29176 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5207	4560	4778	4560
q2	284	343	212	212
q3	4907	5244	4757	4757
q4	2227	2271	1426	1426
q5	4630	4510	4467	4467
q6	228	185	125	125
q7	1873	1709	1482	1482
q8	2221	1889	1857	1857
q9	6815	6726	6719	6719
q10	4236	4223	3819	3819
q11	508	382	339	339
q12	704	707	486	486
q13	2985	3279	2788	2788
q14	278	275	247	247
q15	q16	664	705	595	595
q17	1240	1205	1198	1198
q18	12131	11057	11809	11057
q19	1076	1082	1039	1039
q20	2192	2202	1899	1899
q21	5271	4506	4514	4506
q22	512	454	406	406
Total cold run time: 60189 ms
Total hot run time: 53984 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 165780 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 a5ef0e05db837749f8bde5a12186bd666badb0f9, data reload: false

query5	4301	604	446	446
query6	520	216	199	199
query7	4838	608	318	318
query8	319	158	143	143
query9	8771	4034	3989	3989
query10	475	346	299	299
query11	5823	2203	2059	2059
query12	147	99	96	96
query13	1248	630	429	429
query14	6125	4257	3930	3930
query14_1	3770	3774	3749	3749
query15	200	196	176	176
query16	966	495	442	442
query17	1102	685	536	536
query18	2423	464	336	336
query19	206	199	147	147
query20	109	99	101	99
query21	233	159	138	138
query22	13018	12996	12794	12794
query23	15824	14966	14535	14535
query23_1	14712	14800	14598	14598
query24	7474	1697	1233	1233
query24_1	1264	1245	1232	1232
query25	541	438	355	355
query26	1314	363	215	215
query27	2619	619	385	385
query28	4555	2056	2035	2035
query29	1088	641	463	463
query30	345	269	230	230
query31	1187	1119	1067	1067
query32	106	63	60	60
query33	525	301	230	230
query34	1248	1121	629	629
query35	732	740	638	638
query36	777	773	728	728
query37	167	108	91	91
query38	1847	1768	1670	1670
query39	832	833	802	802
query39_1	797	791	808	791
query40	255	163	146	146
query41	73	66	69	66
query42	100	93	98	93
query43	318	344	285	285
query44	1415	785	769	769
query45	189	177	172	172
query46	1092	1192	700	700
query47	1589	1547	1427	1427
query48	386	407	304	304
query49	584	414	302	302
query50	1037	437	344	344
query51	10693	10740	10239	10239
query52	88	90	74	74
query53	276	281	197	197
query54	277	234	215	215
query55	75	74	66	66
query56	290	301	302	301
query57	1036	1018	951	951
query58	287	255	258	255
query59	1530	1647	1399	1399
query60	309	271	251	251
query61	160	146	153	146
query62	398	319	275	275
query63	230	199	196	196
query64	2848	1080	1010	1010
query65	3902	3841	3812	3812
query66	1863	484	369	369
query67	28144	28249	27977	27977
query68	3314	1579	1013	1013
query69	420	293	276	276
query70	906	786	763	763
query71	358	349	312	312
query72	3271	2733	2077	2077
query73	827	769	415	415
query74	4647	4494	4297	4297
query75	2390	2343	1998	1998
query76	2341	1136	800	800
query77	327	379	276	276
query78	11186	11141	10553	10553
query79	1393	1154	777	777
query80	1271	547	469	469
query81	518	319	288	288
query82	659	173	141	141
query83	375	328	297	297
query84	287	154	130	130
query85	997	628	557	557
query86	402	234	227	227
query87	1999	1962	1821	1821
query88	3730	2806	2775	2775
query89	397	314	283	283
query90	1912	190	196	190
query91	207	188	166	166
query92	63	64	56	56
query93	1624	1501	970	970
query94	727	367	325	325
query95	792	611	474	474
query96	1020	832	336	336
query97	2492	2486	2364	2364
query98	204	190	186	186
query99	743	742	615	615
Total cold run time: 253920 ms
Total hot run time: 165780 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.14	0.09	0.08
query3	0.37	0.25	0.25
query4	1.61	0.25	0.25
query5	0.33	0.31	0.30
query6	1.17	0.66	0.67
query7	0.04	0.01	0.01
query8	0.10	0.07	0.07
query9	0.51	0.38	0.37
query10	0.58	0.56	0.59
query11	0.30	0.18	0.19
query12	0.32	0.19	0.19
query13	0.52	0.54	0.53
query14	0.92	0.91	0.92
query15	0.68	0.60	0.60
query16	0.38	0.39	0.38
query17	1.01	0.99	0.99
query18	0.29	0.28	0.28
query19	1.90	1.78	1.82
query20	0.02	0.02	0.02
query21	15.40	0.38	0.32
query22	4.85	0.13	0.14
query23	15.84	0.50	0.30
query24	2.23	0.63	0.45
query25	0.16	0.11	0.10
query26	0.74	0.27	0.22
query27	0.11	0.10	0.11
query28	3.41	0.84	0.44
query29	12.46	4.24	3.28
query30	0.37	0.28	0.27
query31	2.76	0.62	0.34
query32	3.26	0.63	0.48
query33	2.95	2.94	2.98
query34	15.63	3.93	3.27
query35	3.15	3.18	3.16
query36	0.65	0.56	0.50
query37	0.12	0.10	0.09
query38	0.09	0.07	0.07
query39	0.08	0.06	0.06
query40	0.20	0.18	0.16
query41	0.14	0.08	0.07
query42	0.08	0.06	0.06
query43	0.08	0.07	0.07
Total cold run time: 95.96 s
Total hot run time: 25.29 s

@zwy991114

Copy link
Copy Markdown
Author

run buildall

@zwy991114

Copy link
Copy Markdown
Author
  1. 需要调研一下其他的OLAP 系统的SQL语法是怎么指定压缩算法的,尽量避免独创SQL 语法
  2. 需要测试升降级,是否支持降级,如果不支持在PR 中说明
  3. https://github.com/apache/doris-website 向文档仓库提pr 说明这个功能
系统 粒度 SQL 示例 压缩等级
ClickHouse 列级 content String CODEC(ZSTD(9)) 支持
Amazon Redshift 列级 content VARCHAR ENCODE ZSTD 不支持
StarRocks 表级 PROPERTIES ("compression" = "ZSTD") 不支持
DuckDB 文件导出 COPY t TO 't.parquet' (COMPRESSION zstd) 通常不在表 DDL 指定
Snowflake / BigQuery 系统自动 表存储压缩算法不可通过普通 DDL 指定 不支持

ClickHouse

当前PR最接近ClickHouse 的设计:压缩配置属于列定义,并且算法参数使用函数式语法。

  CREATE TABLE events (
      id UInt64 CODEC(Delta, ZSTD(3)),
      content String CODEC(ZSTD(9))
  )
  ENGINE = MergeTree
  ORDER BY id;

它还支持组合预处理 Codec,例如 Delta 后接 ZSTD,并支持通过 ADD COLUMN、MODIFY COLUMN 修改 Codec。(clickhouse.com (https://clickhouse.com/docs/get-started/sample-datasets/wikistat))

Amazon Redshift

Redshift 使用列级 ENCODE:

  CREATE TABLE events (
      id BIGINT ENCODE DELTA,
      content VARCHAR(65535) ENCODE ZSTD
  );

也可以让系统自动选择:

  CREATE TABLE events (
      id BIGINT,
      content VARCHAR(65535)
  )
  ENCODE AUTO;

Redshift 的 encoding 是算法或数据编码类型,不暴露 ZSTD 数字等级。(docs.aws.amazon.com (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html))

StarRocks

StarRocks 目前是表级属性:

  CREATE TABLE events (
      id BIGINT,
      content STRING
  )
  ENGINE = OLAP
  DUPLICATE KEY(id)
  DISTRIBUTED BY HASH(id)
  PROPERTIES (
      "compression" = "ZSTD"
  );

支持 LZ4、ZSTD、zlib 和 Snappy;只能建表时设置,不能按列或通过 ALTER 修改,也不暴露压缩等级。(docs.starrocks.io (https://docs.starrocks.io/docs/table_design/data_compression/))

DuckDB

DuckDB 的原生表通常不在列定义中指定压缩算法,显式算法主要用于 Parquet 输出:

  COPY events TO 'events.parquet'
  (FORMAT parquet, COMPRESSION zstd);

这是文件级配置,不属于表的持久化 Schema。(duckdb.org (https://duckdb.org/docs/current/data/parquet/overview))

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.58% (1913/2466)
Line Coverage 64.54% (34225/53029)
Region Coverage 64.45% (17282/26816)
Branch Coverage 53.95% (9254/17152)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 74.29% (52/70) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 60.00% (42/70) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17611	4035	4014	4014
q2	2022	326	211	211
q3	10801	1404	778	778
q4	4772	466	338	338
q5	8536	844	563	563
q6	341	169	134	134
q7	812	841	596	596
q8	10620	1598	1592	1592
q9	5438	4095	4043	4043
q10	6833	1640	1387	1387
q11	516	340	314	314
q12	710	585	472	472
q13	18117	3316	2776	2776
q14	262	252	244	244
q15	q16	738	735	667	667
q17	992	1164	914	914
q18	6666	5605	5631	5605
q19	1161	1311	1155	1155
q20	775	664	573	573
q21	5645	2643	2417	2417
q22	433	358	296	296
Total cold run time: 103801 ms
Total hot run time: 29089 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4348	4257	4213	4213
q2	269	324	207	207
q3	4595	4891	4384	4384
q4	2190	2279	1395	1395
q5	4215	4096	4151	4096
q6	232	173	125	125
q7	1679	1961	1639	1639
q8	2432	2071	2039	2039
q9	7319	7264	7167	7167
q10	4363	4268	3855	3855
q11	573	397	403	397
q12	736	750	513	513
q13	3380	3534	3012	3012
q14	312	316	283	283
q15	q16	701	697	626	626
q17	1309	1303	1318	1303
q18	12157	11064	11912	11064
q19	1201	1165	1171	1165
q20	2268	2221	2016	2016
q21	5661	4538	4537	4537
q22	541	489	416	416
Total cold run time: 60481 ms
Total hot run time: 54452 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 166789 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 df151fc0c2d356d7540ce8343fb00b3adc55f782, data reload: false

query5	4317	589	454	454
query6	466	218	211	211
query7	4876	570	320	320
query8	321	166	152	152
query9	8793	4015	3983	3983
query10	500	362	309	309
query11	5876	2207	2031	2031
query12	163	100	98	98
query13	1281	610	433	433
query14	6076	4271	3970	3970
query14_1	3827	3808	3787	3787
query15	211	196	177	177
query16	1068	489	475	475
query17	939	714	570	570
query18	2481	476	351	351
query19	211	188	161	161
query20	105	102	100	100
query21	239	164	144	144
query22	13045	12928	12744	12744
query23	15823	14950	14654	14654
query23_1	14687	14799	14825	14799
query24	7553	1730	1252	1252
query24_1	1269	1227	1249	1227
query25	566	448	385	385
query26	1335	347	202	202
query27	2626	599	359	359
query28	4546	2010	1991	1991
query29	1073	625	498	498
query30	342	262	233	233
query31	1190	1117	1065	1065
query32	108	64	63	63
query33	551	329	253	253
query34	1202	1134	647	647
query35	753	764	649	649
query36	770	771	724	724
query37	163	109	96	96
query38	1850	1770	1684	1684
query39	835	843	796	796
query39_1	773	823	806	806
query40	256	181	150	150
query41	118	65	61	61
query42	91	92	91	91
query43	317	333	278	278
query44	1429	768	769	768
query45	191	173	165	165
query46	1100	1234	730	730
query47	1582	1571	1461	1461
query48	406	424	304	304
query49	570	420	290	290
query50	1075	415	337	337
query51	10738	10803	10637	10637
query52	91	87	77	77
query53	259	269	202	202
query54	281	239	219	219
query55	77	71	67	67
query56	326	300	300	300
query57	1033	1022	924	924
query58	299	251	270	251
query59	1532	1607	1366	1366
query60	330	288	259	259
query61	160	183	148	148
query62	395	319	266	266
query63	233	202	202	202
query64	2840	1026	843	843
query65	3877	3812	3819	3812
query66	1850	472	362	362
query67	28301	28109	27933	27933
query68	3103	1536	1020	1020
query69	429	318	271	271
query70	886	784	775	775
query71	368	351	296	296
query72	3017	2754	2375	2375
query73	857	800	435	435
query74	4634	4466	4286	4286
query75	2378	2342	1987	1987
query76	2320	1181	765	765
query77	343	406	283	283
query78	11179	11153	10633	10633
query79	1350	1160	741	741
query80	652	565	468	468
query81	490	329	289	289
query82	628	182	138	138
query83	407	322	299	299
query84	334	160	134	134
query85	922	605	534	534
query86	317	242	221	221
query87	1967	1947	1841	1841
query88	3731	2753	2807	2753
query89	401	317	289	289
query90	1969	201	196	196
query91	202	191	164	164
query92	67	61	57	57
query93	1566	1566	951	951
query94	539	351	308	308
query95	783	522	548	522
query96	1119	800	345	345
query97	2463	2472	2345	2345
query98	202	187	187	187
query99	744	730	608	608
Total cold run time: 253116 ms
Total hot run time: 166789 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.15	0.08	0.08
query3	0.36	0.24	0.24
query4	1.61	0.25	0.24
query5	0.34	0.32	0.32
query6	1.17	0.65	0.66
query7	0.04	0.01	0.01
query8	0.09	0.07	0.07
query9	0.52	0.37	0.37
query10	0.57	0.58	0.58
query11	0.30	0.17	0.17
query12	0.31	0.19	0.18
query13	0.52	0.52	0.52
query14	0.92	0.92	0.91
query15	0.68	0.59	0.59
query16	0.37	0.38	0.41
query17	1.02	1.01	0.98
query18	0.28	0.26	0.27
query19	1.85	1.78	1.74
query20	0.02	0.01	0.01
query21	15.46	0.39	0.31
query22	4.81	0.14	0.13
query23	15.86	0.50	0.29
query24	2.52	0.59	0.44
query25	0.16	0.11	0.11
query26	0.73	0.26	0.22
query27	0.10	0.10	0.10
query28	3.47	0.83	0.43
query29	12.46	4.13	3.20
query30	0.38	0.27	0.27
query31	2.78	0.60	0.33
query32	3.23	0.60	0.49
query33	2.89	3.13	2.94
query34	15.77	3.92	3.26
query35	3.19	3.16	3.19
query36	0.65	0.54	0.52
query37	0.17	0.10	0.08
query38	0.08	0.06	0.07
query39	0.07	0.06	0.06
query40	0.19	0.17	0.17
query41	0.13	0.09	0.08
query42	0.09	0.06	0.05
query43	0.08	0.07	0.07
Total cold run time: 96.4 s
Total hot run time: 25.08 s

| COMMITTED
| COMPACT
| COMPLETE
| COMPRESSION

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.

建议把 ZSTD,LZ4 这种也设计成关键字,不靠字符串解析

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.

可以结合编码方式也一起考虑下,下一步支持设置列的编码方式

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.

压缩和编码

| CURRENT_DATE | defaultTimestamp=CURRENT_TIMESTAMP (LEFT_PAREN defaultValuePrecision=number RIGHT_PAREN)?))?
(ON UPDATE CURRENT_TIMESTAMP (LEFT_PAREN onUpdateValuePrecision=number RIGHT_PAREN)?)?
(COMMENT comment=STRING_LITERAL)?
(COMPRESSION compression=STRING_LITERAL)?

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.

comment应该永远在最后

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.

4 participants