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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use crate::schema::types::{ParquetType, PrimitiveType};
#[cfg(feature = "serde_types")]
use serde_derive::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde_types", derive(Deserialize, Serialize))]
pub struct Descriptor {
pub primitive_type: PrimitiveType,
pub max_def_level: i16,
pub max_rep_level: i16,
}
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "serde_types", derive(Deserialize, Serialize))]
pub struct ColumnDescriptor {
pub descriptor: Descriptor,
pub path_in_schema: Vec<String>,
pub base_type: ParquetType,
}
impl ColumnDescriptor {
pub fn new(
descriptor: Descriptor,
path_in_schema: Vec<String>,
base_type: ParquetType,
) -> Self {
Self {
descriptor,
path_in_schema,
base_type,
}
}
}