RoanHeNaN opened a new issue, #70500:
URL: https://github.com/apache/doris/issues/70500

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   branch-4.0 source (8a9961723ea4be00cdf923c60759607202c7e2e7); exact deployed 
patch version not collected.
   
   ### What's Wrong?
   
   information_schema.backend_tablets.COMPRESS_KIND reports COMPRESS_LZ4 even 
when the FE default_compression_type is ZSTD. This column is documented as the 
compression type, so the result suggests that the table uses LZ4 and makes it 
difficult to verify the actual compression setting.
   
   In branch-4.0, tablet_meta.cpp always sets TabletSchemaPB.compress_kind to 
COMPRESS_LZ4, while the configured algorithm is stored separately in 
TabletSchemaPB.compression_type. schema_tablets_scanner.cpp populates 
backend_tablets.COMPRESS_KIND from tablet->compress_kind(), so it reports the 
fixed metadata field instead of the segment page compression setting. 
SegmentWriter reads tablet_schema->compression_type() for page writing.
   
   This report concerns the system table result; it does not claim that page 
data is actually compressed with LZ4.
   
   ### What You Expected?
   
   Expose the configured segment page compression type (for example, ZSTD) in 
backend_tablets so users can inspect the effective tablet setting. A separate 
COMPRESSION_TYPE column would preserve the existing COMPRESS_KIND output for 
compatibility; alternatively, clarify the existing column semantics in the 
documentation.
   
   ### How to Reproduce?
   
   1. On a branch-4.0 cluster, run:
   ```sql
   CREATE TABLE compression_kind_repro (id INT) DUPLICATE KEY(id) DISTRIBUTED 
BY HASH(id) BUCKETS 1 PROPERTIES ("compression" = "zstd");
   SHOW TABLETS FROM compression_kind_repro;
   SELECT TABLET_ID, COMPRESS_KIND FROM information_schema.backend_tablets 
WHERE TABLET_ID = <tablet_id_from_show_tablets>;
   ```
   2. Observe `COMPRESS_LZ4` in the system table, although the table property 
requests ZSTD page compression. The source path above explains why the field is 
fixed to LZ4.
   
   ### Anything Else?
   
   Relevant code:
   - https://github.com/apache/doris/blob/branch-4.0/be/src/olap/tablet_meta.cpp
   - 
https://github.com/apache/doris/blob/branch-4.0/be/src/exec/schema_scanner/schema_tablets_scanner.cpp
   - 
https://github.com/apache/doris/blob/branch-4.0/be/src/olap/rowset/segment_v2/segment_writer.cpp
   
   Documentation: 
https://doris.apache.org/docs/4.x/table-design/column-compression/ and 
https://doris.apache.org/docs/4.x/admin-manual/system-tables/information_schema/backend_tablets/
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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

Reply via email to