1#include "duckdb/storage/compression/chimp/chimp.hpp"
2#include "duckdb/storage/compression/chimp/chimp_compress.hpp"
3#include "duckdb/storage/compression/chimp/chimp_scan.hpp"
4#include "duckdb/storage/compression/chimp/chimp_fetch.hpp"
5#include "duckdb/storage/compression/chimp/chimp_analyze.hpp"
6
7#include "duckdb/function/compression/compression.hpp"
8#include "duckdb/function/compression_function.hpp"
9
10namespace duckdb {
11
12template <class T>
13CompressionFunction GetChimpFunction(PhysicalType data_type) {
14 return CompressionFunction(CompressionType::COMPRESSION_CHIMP, data_type, ChimpInitAnalyze<T>, ChimpAnalyze<T>,
15 ChimpFinalAnalyze<T>, ChimpInitCompression<T>, ChimpCompress<T>,
16 ChimpFinalizeCompress<T>, ChimpInitScan<T>, ChimpScan<T>, ChimpScanPartial<T>,
17 ChimpFetchRow<T>, ChimpSkip<T>);
18}
19
20CompressionFunction ChimpCompressionFun::GetFunction(PhysicalType type) {
21 switch (type) {
22 case PhysicalType::FLOAT:
23 return GetChimpFunction<float>(data_type: type);
24 case PhysicalType::DOUBLE:
25 return GetChimpFunction<double>(data_type: type);
26 default:
27 throw InternalException("Unsupported type for Chimp");
28 }
29}
30
31bool ChimpCompressionFun::TypeIsSupported(PhysicalType type) {
32 switch (type) {
33 case PhysicalType::FLOAT:
34 case PhysicalType::DOUBLE:
35 return true;
36 default:
37 return false;
38 }
39}
40
41} // namespace duckdb
42