1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_std::prelude::*;

/// Compression codecs: <https://github.com/apache/parquet-format/blob/master/LogicalTypes.md>
#[derive(
	Clone, Encode, Decode, PartialEq, Debug, TypeInfo, Eq, MaxEncodedLen, Serialize, Deserialize,
)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum ColumnCompressionCodec {
	/// Uncompressed
	Uncompressed,
	/// Snappy, aka Zippy, compression
	Snappy,
	/// Gzip compression
	Gzip,
	/// Lempel-Zip-Obenhumer compression: <https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Oberhumer>
	Lzo,
	/// Brotli compression
	Brotli,
	/// Zstandard compression: <https://en.wikipedia.org/wiki/Zstd>
	ZSTD,
	/// Lz4 compression without block headers
	Lz4Raw,
}

impl Default for ColumnCompressionCodec {
	fn default() -> Self {
		Self::Uncompressed
	}
}