zwy991114 opened a new pull request, #66169:
URL: https://github.com/apache/doris/pull/66169
### 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 <!-- At least one of them must be included. -->
- [x] Regression test
- [x] 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 <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [x] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]