lance_encoding/
constants.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright The Lance Authors
3
4//! Constants for Lance encoding metadata keys
5//!
6//! These constants define the metadata keys used in Arrow field metadata
7//! to configure various encoding behaviors in Lance.
8
9// Compression-related metadata keys
10/// Metadata key for specifying compression scheme (e.g., "lz4", "zstd", "none")
11pub const COMPRESSION_META_KEY: &str = "lance-encoding:compression";
12/// Metadata key for specifying compression level (applies to schemes that support levels)
13pub const COMPRESSION_LEVEL_META_KEY: &str = "lance-encoding:compression-level";
14/// Metadata key for specifying RLE (Run-Length Encoding) threshold
15pub const RLE_THRESHOLD_META_KEY: &str = "lance-encoding:rle-threshold";
16
17// Dictionary encoding metadata keys
18/// Metadata key for specifying dictionary encoding threshold divisor
19/// Set to a large value to discourage dictionary encoding
20/// Set to a small value to encourage dictionary encoding
21pub const DICT_DIVISOR_META_KEY: &str = "lance-encoding:dict-divisor";
22
23// NOTE: BLOB_META_KEY is defined in lance-core to avoid circular dependency
24
25// Packed struct encoding metadata keys
26/// Legacy metadata key for packed struct encoding (deprecated)
27pub const PACKED_STRUCT_LEGACY_META_KEY: &str = "packed";
28/// Metadata key for packed struct encoding
29pub const PACKED_STRUCT_META_KEY: &str = "lance-encoding:packed";
30
31// Structural encoding metadata keys
32/// Metadata key for specifying structural encoding type
33pub const STRUCTURAL_ENCODING_META_KEY: &str = "lance-encoding:structural-encoding";
34/// Value for miniblock structural encoding
35pub const STRUCTURAL_ENCODING_MINIBLOCK: &str = "miniblock";
36/// Value for fullzip structural encoding
37pub const STRUCTURAL_ENCODING_FULLZIP: &str = "fullzip";
38
39// Byte stream split metadata keys
40/// Metadata key for byte stream split encoding configuration
41pub const BSS_META_KEY: &str = "lance-encoding:bss";
42/// Default BSS mode
43pub const DEFAULT_BSS_MODE: &str = "auto";