reifydb_compression/select.rs
1// Copyright (c) reifydb.com 2025
2// This file is licensed under the AGPL-3.0-or-later, see license.md file
3
4use reifydb_core::value::column::ColumnData;
5
6use crate::{BoxedColumnCompressor, strategy::none::NoneCompressor};
7
8/// Select the best compressor for a given column based on its type and characteristics
9pub fn select_compressor(_data: &ColumnData) -> BoxedColumnCompressor {
10 // match data.get_type() {
11 // Type::Boolean => Box::new(BitPackCompressor::new()),
12 // Type::Utf8 => {
13 // // For now, always use dictionary for strings
14 // // TODO: Add cardinality check to decide between dictionary and zstd
15 // Box::new(DictionaryCompressor::new())
16 // }
17 // Type::Int1 | Type::Int2 | Type::Int4 | Type::Int8 | Type::Int16 => {
18 // // For now, use delta for integers
19 // // TODO: Check if sorted to decide between delta and zstd
20 // Box::new(DeltaCompressor::new())
21 // }
22 // Type::Uint1 | Type::Uint2 | Type::Uint4 | Type::Uint8 | Type::Uint16 => {
23 // Box::new(DeltaCompressor::new())
24 // }
25 // Type::Float4 | Type::Float8 => {
26 // // Floating point typically doesn't compress well with delta
27 // unimplemented!()
28 // }
29 // Type::Date | Type::DateTime | Type::Time => {
30 // // Temporal data often has patterns
31 // Box::new(DeltaCompressor::new())
32 // }
33 // _ => unimplemented!(),
34 // }
35 Box::new(NoneCompressor {})
36}