genegraph_storage/lancefmt/pb/lance.file.v2.rs
1// Vendored from the Lance v2.1 spec (lance crate v11.0.0), generated with
2// prost 0.14 from the .proto files in src/lancefmt/protos/ (Apache-2.0,
3// Copyright The Lance Authors). Regenerate rather than hand-editing; see
4// src/lancefmt/protos/README.md.
5// This file is @generated by prost-build.
6/// The deferred encoding is used to place the encoding itself in a different
7/// part of the file. This is most commonly used to allow encodings to be shared
8/// across different columns. For example, when writing a file with thousands of
9/// columns, where many pages have the exact same encoding, it can be useful
10/// to cut down on the size of the metadata by using a deferred encoding.
11#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
12pub struct DeferredEncoding {
13 /// Location of the buffer containing the encoding.
14 ///
15 /// * If sharing encodings across columns then this will be in a global buffer
16 /// * If sharing encodings across pages within a column this could be in a
17 /// column metadata buffer.
18 /// * This could also be a page buffer if the encoding is not shared, needs
19 /// to be written before the file ends, and the encoding is too large to load
20 /// unless we first determine the page needs to be read. This combination
21 /// seems unusual.
22 #[prost(uint64, tag = "1")]
23 pub buffer_location: u64,
24 #[prost(uint64, tag = "2")]
25 pub buffer_length: u64,
26}
27/// The encoding is placed directly in the metadata section
28#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
29pub struct DirectEncoding {
30 /// The bytes that make up the encoding embedded directly in the metadata
31 ///
32 /// This is the most common approach.
33 #[prost(bytes = "vec", tag = "1")]
34 pub encoding: ::prost::alloc::vec::Vec<u8>,
35}
36/// An encoding stores the information needed to decode a column or page
37///
38/// For example, it could describe if the page is using bit packing, and how many bits
39/// there are in each individual value.
40///
41/// At the column level it can be used to wrap columns with dictionaries or statistics.
42#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
43pub struct Encoding {
44 #[prost(oneof = "encoding::Location", tags = "1, 2, 3")]
45 pub location: ::core::option::Option<encoding::Location>,
46}
47/// Nested message and enum types in `Encoding`.
48pub mod encoding {
49 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
50 pub enum Location {
51 /// The encoding is stored elsewhere and not part of this protobuf message
52 #[prost(message, tag = "1")]
53 Indirect(super::DeferredEncoding),
54 /// The encoding is stored within this protobuf message
55 #[prost(message, tag = "2")]
56 Direct(super::DirectEncoding),
57 /// There is no encoding information
58 #[prost(message, tag = "3")]
59 None(()),
60 }
61}
62/// Each column has a metadata block that is placed at the end of the file.
63/// These may be read individually to allow for column projection.
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct ColumnMetadata {
66 /// Encoding information about the column itself. This typically describes
67 /// how to interpret the column metadata buffers. For example, it could
68 /// describe how statistics or dictionaries are stored in the column metadata.
69 #[prost(message, optional, tag = "1")]
70 pub encoding: ::core::option::Option<Encoding>,
71 /// The pages in the column
72 #[prost(message, repeated, tag = "2")]
73 pub pages: ::prost::alloc::vec::Vec<column_metadata::Page>,
74 /// The file offsets of each of the column metadata buffers
75 ///
76 /// There may be zero buffers.
77 #[prost(uint64, repeated, tag = "3")]
78 pub buffer_offsets: ::prost::alloc::vec::Vec<u64>,
79 /// The size (in bytes) of each of the column metadata buffers
80 ///
81 /// This field will have the same length as `buffer_offsets` and
82 /// may be empty.
83 #[prost(uint64, repeated, tag = "4")]
84 pub buffer_sizes: ::prost::alloc::vec::Vec<u64>,
85}
86/// Nested message and enum types in `ColumnMetadata`.
87pub mod column_metadata {
88 /// This describes a page of column data.
89 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
90 pub struct Page {
91 /// The file offsets for each of the page buffers
92 ///
93 /// The number of buffers is variable and depends on the encoding. There
94 /// may be zero buffers (e.g. constant encoded data) in which case this
95 /// could be empty.
96 #[prost(uint64, repeated, tag = "1")]
97 pub buffer_offsets: ::prost::alloc::vec::Vec<u64>,
98 /// The size (in bytes) of each of the page buffers
99 ///
100 /// This field will have the same length as `buffer_offsets` and
101 /// may be empty.
102 #[prost(uint64, repeated, tag = "2")]
103 pub buffer_sizes: ::prost::alloc::vec::Vec<u64>,
104 /// Logical length (e.g. # rows) of the page
105 #[prost(uint64, tag = "3")]
106 pub length: u64,
107 /// The encoding used to encode the page
108 #[prost(message, optional, tag = "4")]
109 pub encoding: ::core::option::Option<super::Encoding>,
110 /// The priority of the page
111 ///
112 /// For tabular data this will be the top-level row number of the first row
113 /// in the page (and top-level rows should not split across pages).
114 #[prost(uint64, tag = "5")]
115 pub priority: u64,
116 }
117}