genegraph_storage/lancefmt/pb/lance.table.rs
1// This file is @generated by prost-build.
2/// UUID type. encoded as 16 bytes.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct Uuid {
5 #[prost(bytes = "vec", tag = "1")]
6// Includes lance.table (table.proto) and lance.transaction (transaction.proto),
7 pub uuid: ::prost::alloc::vec::Vec<u8>,
8}
9/// Manifest is a global section shared between all the files.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Manifest {
12 /// All fields of the dataset, including the nested fields.
13 #[prost(message, repeated, tag = "1")]
14 pub fields: ::prost::alloc::vec::Vec<super::file::Field>,
15 /// Schema metadata.
16 #[prost(map = "string, bytes", tag = "5")]
17 pub schema_metadata: ::std::collections::HashMap<
18 ::prost::alloc::string::String,
19 ::prost::alloc::vec::Vec<u8>,
20 >,
21 /// Fragments of the dataset.
22 #[prost(message, repeated, tag = "2")]
23 pub fragments: ::prost::alloc::vec::Vec<DataFragment>,
24 /// Snapshot version number.
25 #[prost(uint64, tag = "3")]
26 pub version: u64,
27 /// The file position of the version auxiliary data.
28 /// * It is not inheritable between versions.
29 /// * It is not loaded by default during query.
30 #[prost(uint64, tag = "4")]
31 pub version_aux_data: u64,
32 /// The version of the writer that created this file.
33 ///
34 /// This information may be used to detect whether the file may have known bugs
35 /// associated with that writer.
36 #[prost(message, optional, tag = "13")]
37 pub writer_version: ::core::option::Option<manifest::WriterVersion>,
38 /// If present, the file position of the index metadata.
39 #[prost(uint64, optional, tag = "6")]
40 pub index_section: ::core::option::Option<u64>,
41 /// Version creation Timestamp, UTC timezone
42 #[prost(message, optional, tag = "7")]
43 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
44 /// Optional version tag
45 #[prost(string, tag = "8")]
46 pub tag: ::prost::alloc::string::String,
47 /// Feature flags for readers.
48 ///
49 /// A bitmap of flags that indicate which features are required to be able to
50 /// read the table. If a reader does not recognize a flag that is set, it
51 /// should not attempt to read the dataset.
52 ///
53 /// Known flags:
54 /// * 1 << 0: deletion files are present
55 /// * 1 << 1: row ids are stable and stored as part of the fragment metadata.
56 /// * 1 << 2: use v2 format (deprecated)
57 /// * 1 << 3: table config is present
58 /// * 1 << 4: dataset uses multiple base paths
59 /// * 1 << 5: transaction file writes are disabled
60 /// * 1 << 6: data overlay files are present (see DataOverlayFile). Readers that do
61 /// not understand overlays must refuse the dataset, since ignoring an overlay
62 /// would silently return stale base values.
63 /// * 1 << 7: some index declares covering columns, so IndexMetadata.fields means
64 /// the keyed columns followed by the carried ones named in covering_fields (see
65 /// IndexMetadata). Readers that do not understand it must refuse the dataset,
66 /// since selecting an index by membership of fields would answer a query on a
67 /// merely-carried column with an index keyed on a different column. Writers must
68 /// refuse it too: one that treats every entry of fields as keyed would maintain
69 /// the index against the wrong dependency set.
70 #[prost(uint64, tag = "9")]
71 pub reader_feature_flags: u64,
72 /// Feature flags for writers.
73 ///
74 /// A bitmap of flags that indicate which features must be used when writing to the
75 /// dataset. If a writer does not recognize a flag that is set, it should not attempt to
76 /// write to the dataset.
77 ///
78 /// The flag identities are the same as for reader_feature_flags, but the values of
79 /// reader_feature_flags and writer_feature_flags are not required to be identical.
80 #[prost(uint64, tag = "10")]
81 pub writer_feature_flags: u64,
82 /// The highest fragment ID that has been used so far.
83 ///
84 /// This ID is not guaranteed to be present in the current version, but it may
85 /// have been used in previous versions.
86 ///
87 /// For a single fragment, will be zero. For no fragments, will be absent.
88 #[prost(uint32, optional, tag = "11")]
89 pub max_fragment_id: ::core::option::Option<u32>,
90 /// Path to the transaction file, relative to `{root}/_transactions`. The file at that
91 /// location contains a wire-format serialized Transaction message representing the
92 /// transaction that created this version.
93 ///
94 /// This string field "transaction_file" may be empty if no transaction file was written.
95 ///
96 /// The path format is "{read_version}-{uuid}.txn" where {read_version} is the version of
97 /// the table the transaction read from (serialized to decimal with no padding digits),
98 /// and {uuid} is a hyphen-separated UUID.
99 #[prost(string, tag = "12")]
100 pub transaction_file: ::prost::alloc::string::String,
101 /// The file position of the transaction content. None if transaction is empty
102 /// This transaction content begins with the transaction content length as u32
103 /// If the transaction proto message has a length of `len`, the message ends at `len` + 4
104 #[prost(uint64, optional, tag = "21")]
105 pub transaction_section: ::core::option::Option<u64>,
106 /// The next unused row id. If zero, then the table does not have any rows.
107 ///
108 /// This is only used if the "stable_row_ids" feature flag is set.
109 #[prost(uint64, tag = "14")]
110 pub next_row_id: u64,
111 /// The data storage format
112 ///
113 /// This specifies what format is used to store the data files.
114 #[prost(message, optional, tag = "15")]
115 pub data_format: ::core::option::Option<manifest::DataStorageFormat>,
116 /// Table config.
117 ///
118 /// Keys with the prefix "lance." are reserved for the Lance library. Other
119 /// libraries may wish to similarly prefix their configuration keys
120 /// appropriately.
121 #[prost(map = "string, string", tag = "16")]
122 pub config: ::std::collections::HashMap<
123 ::prost::alloc::string::String,
124 ::prost::alloc::string::String,
125 >,
126 /// Metadata associated with the table.
127 ///
128 /// This is a key-value map that can be used to store arbitrary metadata
129 /// associated with the table.
130 ///
131 /// This is different than configuration, which is used to tell libraries how
132 /// to read, write, or manage the table.
133 ///
134 /// This is different than schema metadata, which is used to describe the
135 /// data itself and is attached to the output schema of scans.
136 #[prost(map = "string, string", tag = "19")]
137 pub table_metadata: ::std::collections::HashMap<
138 ::prost::alloc::string::String,
139 ::prost::alloc::string::String,
140 >,
141 /// The base paths of data files.
142 ///
143 /// This is used to determine the base path of a data file. In common cases data file paths are under current dataset base path.
144 /// But for shallow cloning, importing file and other multi-tier storage cases, the actual data files could be outside of the current dataset.
145 /// This field is used with the `base_id` in `lance.file.File` and `lance.file.DeletionFile`.
146 ///
147 /// For example, if we have a dataset with base path `s3://bucket/dataset`, we have a DataFile with base_id 0, we get the actual data file path by:
148 /// base_paths\[id = 0\] + /data/ + file.path
149 /// the key(a.k.a index) starts from 0, increased by 1 for each new base path.
150 #[prost(message, repeated, tag = "18")]
151 pub base_paths: ::prost::alloc::vec::Vec<BasePath>,
152 /// The branch of the dataset. None means main branch.
153 #[prost(string, optional, tag = "20")]
154 pub branch: ::core::option::Option<::prost::alloc::string::String>,
155}
156/// Nested message and enum types in `Manifest`.
157pub mod manifest {
158 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
159 pub struct WriterVersion {
160 /// The name of the library that created this file.
161 #[prost(string, tag = "1")]
162 pub library: ::prost::alloc::string::String,
163 /// The version of the library that created this file. Because we cannot assume
164 /// that the library is semantically versioned, this is a string. However, if it
165 /// is semantically versioned, it should be a valid semver string without any 'v'
166 /// prefix. For example: `2.0.0`, `2.0.0-rc.1`.
167 ///
168 /// For forward compatibility with older readers, when writing new manifests this
169 /// field should contain only the core version (major.minor.patch) without any
170 /// prerelease or build metadata. The prerelease/build info should be stored in
171 /// the separate prerelease and build_metadata fields instead.
172 #[prost(string, tag = "2")]
173 pub version: ::prost::alloc::string::String,
174 /// Optional semver prerelease identifier.
175 ///
176 /// This field stores the prerelease portion of a semantic version separately
177 /// from the core version number. For example, if the full version is "2.0.0-rc.1",
178 /// the version field would contain "2.0.0" and prerelease would contain "rc.1".
179 ///
180 /// This separation ensures forward compatibility: older readers can parse the
181 /// clean version field without errors, while newer readers can reconstruct the
182 /// full semantic version by combining version, prerelease, and build_metadata.
183 ///
184 /// If absent, the version field is used as-is.
185 #[prost(string, optional, tag = "3")]
186 pub prerelease: ::core::option::Option<::prost::alloc::string::String>,
187 /// Optional semver build metadata.
188 ///
189 /// This field stores the build metadata portion of a semantic version separately
190 /// from the core version number. For example, if the full version is
191 /// "2.0.0-rc.1+build.123", the version field would contain "2.0.0", prerelease
192 /// would contain "rc.1", and build_metadata would contain "build.123".
193 ///
194 /// If absent, no build metadata is present.
195 #[prost(string, optional, tag = "4")]
196 pub build_metadata: ::core::option::Option<::prost::alloc::string::String>,
197 }
198 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
199 pub struct DataStorageFormat {
200 /// The format of the data files (e.g. "lance")
201 #[prost(string, tag = "1")]
202 pub file_format: ::prost::alloc::string::String,
203 /// The max format version of the data files. The format of the version can vary by
204 /// file_format and is not required to follow semver.
205 ///
206 /// Every file in this version of the dataset has the same file_format version.
207 #[prost(string, tag = "2")]
208 pub version: ::prost::alloc::string::String,
209 }
210}
211/// external dataset base path
212#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
213pub struct BasePath {
214 #[prost(uint32, tag = "1")]
215 pub id: u32,
216 /// This is an alias name of the base path, it is optional.
217 /// When we use shallow clone and the target version is a tag, the tag name will be set here.
218 #[prost(string, optional, tag = "2")]
219 pub name: ::core::option::Option<::prost::alloc::string::String>,
220 /// Flag indicating whether this path is a dataset root path or file directory:
221 /// - true: Path is a dataset root (actual files under subdirectories like `data`, '_deletions')
222 /// - false: Path is a direct file directory (scenario like importing files)
223 #[prost(bool, tag = "3")]
224 pub is_dataset_root: bool,
225 /// Note: This absolute path will be directly used by Path:parse(),
226 #[prost(string, tag = "4")]
227 pub path: ::prost::alloc::string::String,
228}
229/// Auxiliary Data attached to a version.
230/// Only load on-demand.
231#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct VersionAuxData {
233 /// key-value metadata.
234 #[prost(map = "string, bytes", tag = "3")]
235 pub metadata: ::std::collections::HashMap<
236 ::prost::alloc::string::String,
237 ::prost::alloc::vec::Vec<u8>,
238 >,
239}
240/// Metadata describing an index.
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct IndexMetadata {
243 /// Unique ID of an index. It is unique across all the dataset versions.
244 #[prost(message, optional, tag = "1")]
245 pub uuid: ::core::option::Option<Uuid>,
246 /// The columns to build the index. These refer to file.Field.id.
247 ///
248 /// fields\[0\] is always a column the index is keyed on. Trailing entries may
249 /// instead be merely carried, not keyed on -- see `covering_fields` below.
250 #[prost(int32, repeated, tag = "2")]
251 pub fields: ::prost::alloc::vec::Vec<i32>,
252 /// Index name. Must be unique within one dataset version.
253 #[prost(string, tag = "3")]
254 pub name: ::prost::alloc::string::String,
255 /// The version of the dataset this index was built from.
256 #[prost(uint64, tag = "4")]
257 pub dataset_version: u64,
258 /// A bitmap of the included fragment ids.
259 ///
260 /// This may by used to determine how much of the dataset is covered by the
261 /// index. This information can be retrieved from the dataset by looking at
262 /// the dataset at `dataset_version`. However, since the old version may be
263 /// deleted while the index is still in use, this information is also stored
264 /// in the index.
265 ///
266 /// The bitmap is stored as a 32-bit Roaring bitmap.
267 #[prost(bytes = "vec", tag = "5")]
268 pub fragment_bitmap: ::prost::alloc::vec::Vec<u8>,
269 /// Details, specific to the index type, which are needed to load / interpret the index
270 ///
271 /// Indices should avoid putting large amounts of information in this field, as it will
272 /// bloat the manifest.
273 ///
274 /// Indexes are plugins, and so the format of the details message is flexible and not fully
275 /// defined by the table format. However, there are some conventions that should be followed:
276 ///
277 /// - When Lance APIs refer to indexes they will use the type URL of the index details as the
278 /// identifier for the index type. If a user provides a simple string identifier like
279 /// "btree" then it will be converted to "/lance.table.BTreeIndexDetails"
280 /// - Type URLs comparisons are case-insensitive. Thereform an index must have a unique type
281 /// URL ignoring case.
282 #[prost(message, optional, tag = "6")]
283 pub index_details: ::core::option::Option<::prost_types::Any>,
284 /// The minimum lance version that this index is compatible with.
285 #[prost(int32, optional, tag = "7")]
286 pub index_version: ::core::option::Option<i32>,
287 /// Timestamp when the index was created (UTC timestamp in milliseconds since epoch)
288 ///
289 /// This field is optional for backward compatibility. For existing indices created before
290 /// this field was added, this will be None/null.
291 #[prost(uint64, optional, tag = "8")]
292 pub created_at: ::core::option::Option<u64>,
293 /// The base path index of the data file. Used when the file is imported or referred from another dataset.
294 /// Lance use it as key of the base_paths field in Manifest to determine the actual base path of the data file.
295 #[prost(uint32, optional, tag = "9")]
296 pub base_id: ::core::option::Option<u32>,
297 /// List of files and their sizes for this index segment.
298 /// This enables skipping HEAD calls when opening indices and allows reporting
299 /// of index sizes without extra IO.
300 /// If this is empty, the index files sizes are unknown.
301 #[prost(message, repeated, tag = "10")]
302 pub files: ::prost::alloc::vec::Vec<IndexFile>,
303 /// The subset of `fields` whose values this index co-locates alongside its own
304 /// data, so a query projecting only those columns can be answered from the
305 /// index without a take against the base table.
306 ///
307 /// Must be a suffix of `fields`: the columns the index is keyed on come first,
308 /// the columns it merely carries come last, and at least one keyed column
309 /// always remains. Empty for an index that carries no extra columns, which is
310 /// every index written before this field existed.
311 ///
312 /// Carried columns are listed in `fields` as well. That is deliberate: every
313 /// consumer that reads `fields` as the index's dependency set -- staleness,
314 /// commit conflict detection, schema evolution guards -- then covers them with
315 /// no change and no way to forget one.
316 ///
317 /// This declaration is not authoritative for what the segment can actually
318 /// serve. The segment's own storage schema is: a reader must confirm the
319 /// storage carries a column before answering a query from it, and fall back to
320 /// a take against the base table otherwise. A declaration naming columns the
321 /// storage does not hold is a legal state, not corruption -- a maintenance
322 /// operation that cannot carry the values through a rebuild is permitted to
323 /// withdraw the payload while leaving this declaration in place.
324 #[prost(int32, repeated, tag = "11")]
325 pub covering_fields: ::prost::alloc::vec::Vec<i32>,
326}
327/// Metadata about a single file within an index segment.
328#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
329pub struct IndexFile {
330 /// Path relative to the index directory (e.g., "index.idx", "auxiliary.idx")
331 #[prost(string, tag = "1")]
332 pub path: ::prost::alloc::string::String,
333 /// Size of the file in bytes
334 #[prost(uint64, tag = "2")]
335 pub size_bytes: u64,
336}
337/// Index Section, containing a list of index metadata for one dataset version.
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct IndexSection {
340 #[prost(message, repeated, tag = "1")]
341 pub indices: ::prost::alloc::vec::Vec<IndexMetadata>,
342}
343/// A DataFragment is a set of files which represent the different columns of the same
344/// rows. If column exists in the schema of a dataset, but the file for that column does
345/// not exist within a DataFragment of that dataset, that column consists entirely of
346/// nulls.
347#[derive(Clone, PartialEq, ::prost::Message)]
348pub struct DataFragment {
349 /// The ID of a DataFragment is unique within a dataset.
350 #[prost(uint64, tag = "1")]
351 pub id: u64,
352 #[prost(message, repeated, tag = "2")]
353 pub files: ::prost::alloc::vec::Vec<DataFile>,
354 /// Optional overlay files for this fragment, which supply new values for a
355 /// subset of cells without rewriting the base data files. This MUST be empty
356 /// if the data overlay files feature flag (64) is not set in the manifest.
357 ///
358 /// Order is significant: a later entry is newer than an earlier one. When two
359 /// overlays cover the same (offset, field) and share a `committed_version`, the
360 /// later entry wins. See DataOverlayFile for the full resolution rules.
361 #[prost(message, repeated, tag = "11")]
362 pub overlays: ::prost::alloc::vec::Vec<DataOverlayFile>,
363 /// File that indicates which rows, if any, should be considered deleted.
364 #[prost(message, optional, tag = "3")]
365 pub deletion_file: ::core::option::Option<DeletionFile>,
366 /// Number of original rows in the fragment, this includes rows that are now marked with
367 /// deletion tombstones. To compute the current number of rows, subtract
368 /// `deletion_file.num_deleted_rows` from this value.
369 #[prost(uint64, tag = "4")]
370 pub physical_rows: u64,
371 /// A serialized RowIdSequence message (see rowids.proto).
372 ///
373 /// These are the row ids for the fragment, in order of the rows as they appear.
374 /// That is, if a fragment has 3 rows, and the row ids are \[1, 42, 3\], then the
375 /// first row is row 1, the second row is row 42, and the third row is row 3.
376 #[prost(oneof = "data_fragment::RowIdSequence", tags = "5, 6")]
377 pub row_id_sequence: ::core::option::Option<data_fragment::RowIdSequence>,
378 #[prost(oneof = "data_fragment::LastUpdatedAtVersionSequence", tags = "7, 8")]
379 pub last_updated_at_version_sequence: ::core::option::Option<
380 data_fragment::LastUpdatedAtVersionSequence,
381 >,
382 #[prost(oneof = "data_fragment::CreatedAtVersionSequence", tags = "9, 10")]
383 pub created_at_version_sequence: ::core::option::Option<
384 data_fragment::CreatedAtVersionSequence,
385 >,
386}
387/// Nested message and enum types in `DataFragment`.
388pub mod data_fragment {
389 /// A serialized RowIdSequence message (see rowids.proto).
390 ///
391 /// These are the row ids for the fragment, in order of the rows as they appear.
392 /// That is, if a fragment has 3 rows, and the row ids are \[1, 42, 3\], then the
393 /// first row is row 1, the second row is row 42, and the third row is row 3.
394 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
395 pub enum RowIdSequence {
396 /// If small (< 200KB), the row ids are stored inline.
397 #[prost(bytes, tag = "5")]
398 InlineRowIds(::prost::alloc::vec::Vec<u8>),
399 /// Otherwise, stored as part of a file.
400 #[prost(message, tag = "6")]
401 ExternalRowIds(super::ExternalFile),
402 }
403 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
404 pub enum LastUpdatedAtVersionSequence {
405 /// If small (< 200KB), the row latest updated versions are stored inline.
406 #[prost(bytes, tag = "7")]
407 InlineLastUpdatedAtVersions(::prost::alloc::vec::Vec<u8>),
408 /// Otherwise, stored as part of a file.
409 #[prost(message, tag = "8")]
410 ExternalLastUpdatedAtVersions(super::ExternalFile),
411 }
412 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
413 pub enum CreatedAtVersionSequence {
414 /// If small (< 200KB), the row created at versions are stored inline.
415 #[prost(bytes, tag = "9")]
416 InlineCreatedAtVersions(::prost::alloc::vec::Vec<u8>),
417 /// Otherwise, stored as part of a file.
418 #[prost(message, tag = "10")]
419 ExternalCreatedAtVersions(super::ExternalFile),
420 }
421}
422#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
423pub struct DataFile {
424 /// Path to the root relative to the dataset's URI.
425 #[prost(string, tag = "1")]
426 pub path: ::prost::alloc::string::String,
427 /// The ids of the fields/columns in this file.
428 ///
429 /// When a DataFile object is created in memory, every value in fields is assigned -1 by
430 /// default. An object with a value in fields of -1 must not be stored to disk. -2 is
431 /// used for "tombstoned", meaning a field that is no longer in use. This is often
432 /// because the original field id was reassigned to a different data file.
433 ///
434 /// In Lance v1 IDs are assigned based on position in the file, offset by the max
435 /// existing field id in the table (if any already). So when a fragment is first created
436 /// with one file of N columns, the field ids will be 1, 2, ..., N. If a second fragment
437 /// is created with M columns, the field ids will be N+1, N+2, ..., N+M.
438 ///
439 /// In Lance v1 there is one field for each field in the input schema, this includes
440 /// nested fields (both struct and list). Fixed size list fields have only a single
441 /// field id (these are not considered nested fields in Lance v1).
442 ///
443 /// This allows column indices to be calculated from field IDs and the input schema.
444 ///
445 /// In Lance v2 the field IDs generally follow the same pattern but there is no
446 /// way to calculate the column index from the field ID. This is because a given
447 /// field could be encoded in many different ways, some of which occupy a different
448 /// number of columns. For example, a struct field could be encoded into N + 1 columns
449 /// or it could be encoded into a single packed column. To determine column indices
450 /// the column_indices property should be used instead.
451 ///
452 /// In Lance v1 these ids must be sorted but might not always be contiguous.
453 #[prost(int32, repeated, tag = "2")]
454 pub fields: ::prost::alloc::vec::Vec<i32>,
455 /// The top-level column indices for each field in the file.
456 ///
457 /// If the data file is version 1 then this property will be empty
458 ///
459 /// Otherwise there must be one entry for each field in `fields`.
460 ///
461 /// Some fields may not correspond to a top-level column in the file. In these cases
462 /// the index will -1.
463 ///
464 /// For example, consider the schema:
465 ///
466 /// - dimension: packed-struct (0):
467 /// - x: u32 (1)
468 /// - y: u32 (2)
469 /// - path: `list<u32>` (3)
470 /// - embedding: `fsl<768>` (4)
471 /// - fp64
472 /// - borders: `fsl<4>` (5)
473 /// - simple-struct (6)
474 /// - margin: fp64 (7)
475 /// - padding: fp64 (8)
476 ///
477 /// One possible column indices array could be:
478 /// \[0, -1, -1, 1, 3, 4, 5, 6, 7\]
479 ///
480 /// This reflects quite a few phenomenon:
481 /// - The packed struct is encoded into a single column and there is no top-level column
482 /// for the x or y fields
483 /// - The variable sized list is encoded into two columns
484 /// - The embedding is encoded into a single column (common for FSL of primitive) and there
485 /// is not "FSL column"
486 /// - The borders field actually does have an "FSL column"
487 ///
488 /// The column indices table may not have duplicates (other than -1)
489 #[prost(int32, repeated, tag = "3")]
490 pub column_indices: ::prost::alloc::vec::Vec<i32>,
491 /// The major file version used to create the file
492 #[prost(uint32, tag = "4")]
493 pub file_major_version: u32,
494 /// The minor file version used to create the file
495 ///
496 /// If both `file_major_version` and `file_minor_version` are set to 0,
497 /// then this is a version 0.1 or version 0.2 file.
498 #[prost(uint32, tag = "5")]
499 pub file_minor_version: u32,
500 /// The known size of the file on disk in bytes.
501 ///
502 /// This is used to quickly find the footer of the file.
503 ///
504 /// When this is zero, it should be interpreted as "unknown".
505 #[prost(uint64, tag = "6")]
506 pub file_size_bytes: u64,
507 /// The base path index of the data file. Used when the file is imported or referred from another dataset.
508 /// Lance use it as key of the base_paths field in Manifest to determine the actual base path of the data file.
509 #[prost(uint32, optional, tag = "7")]
510 pub base_id: ::core::option::Option<u32>,
511}
512/// An overlay file supplies new values for a subset of (row offset, field) cells
513/// within a fragment, without rewriting the fragment's base data files. It is
514/// used for efficient updates when only a small fraction of rows and/or columns
515/// change.
516///
517/// On read, a cell is resolved by consulting the fragment's overlays from newest
518/// to oldest: the first overlay that covers that (offset, field) wins; if none
519/// cover it, the value falls through to the base data file. Because deletions
520/// take precedence over overlays, an overlay value for an offset that is also
521/// marked deleted is dead and is ignored.
522///
523/// The overlay's data file does NOT store a row-offset key column. Within a value
524/// column, the position of a covered offset's value is the rank (0-based count of
525/// set bits below it) of that offset within the field's coverage bitmap. Because
526/// fields may cover different offset sets, the value columns of a single overlay
527/// data file may have different lengths (which the Lance file format permits).
528#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
529pub struct DataOverlayFile {
530 /// The data file storing the overlay's new cell values, one value column per
531 /// field in `data_file.fields`. No row-offset key column is stored.
532 #[prost(message, optional, tag = "1")]
533 pub data_file: ::core::option::Option<DataFile>,
534 /// The dataset version at which this overlay became effective: the version of
535 /// the commit that introduced it, NOT the version it was read from. It is
536 /// stamped at commit time and re-stamped if the commit is retried, in the same
537 /// way as the created-at / last-updated-at version sequences.
538 ///
539 /// This drives two orderings:
540 /// * Versus index builds: an index whose `dataset_version` >= this value
541 /// already incorporates this overlay. Otherwise the overlay's covered cells
542 /// are excluded from index results for the affected fields and re-evaluated
543 /// against their current values (see the Data Overlay Files specification).
544 /// * Versus other overlays: when two overlays cover the same (offset, field),
545 /// the one with the higher `committed_version` wins. Overlays that share a
546 /// `committed_version` are ordered by their position in
547 /// `DataFragment.overlays`, where a later entry is newer and wins.
548 #[prost(uint64, tag = "3")]
549 pub committed_version: u64,
550 /// Which (offset, field) cells this overlay provides values for.
551 #[prost(oneof = "data_overlay_file::Coverage", tags = "2, 4")]
552 pub coverage: ::core::option::Option<data_overlay_file::Coverage>,
553}
554/// Nested message and enum types in `DataOverlayFile`.
555pub mod data_overlay_file {
556 /// Which (offset, field) cells this overlay provides values for.
557 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
558 pub enum Coverage {
559 /// A single 32-bit Roaring bitmap of physical row offsets that applies to
560 /// every field in `data_file.fields` (a "dense" / rectangular overlay).
561 /// Every covered offset has a value for every field. This is the common case
562 /// for a plain UPDATE, where one SET list is applied to one set of rows.
563 #[prost(bytes, tag = "2")]
564 SharedOffsetBitmap(::prost::alloc::vec::Vec<u8>),
565 /// Per-field coverage for a "sparse" overlay, used when different fields cover
566 /// different offset sets (e.g. a MERGE with multiple WHEN MATCHED branches).
567 #[prost(message, tag = "4")]
568 FieldCoverage(super::FieldCoverage),
569 }
570}
571/// Per-field coverage for a sparse overlay.
572#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
573pub struct FieldCoverage {
574 /// One entry per field in the overlay's `data_file.fields`, in the same order.
575 /// Each is a 32-bit Roaring bitmap of the physical row offsets covered for that
576 /// field. An offset present in a field's bitmap but mapped to a NULL value
577 /// means the cell is overridden to NULL (distinct from an offset that is absent,
578 /// which falls through to the base data file).
579 #[prost(bytes = "vec", repeated, tag = "1")]
580 pub offset_bitmaps: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
581}
582/// Deletion File
583///
584/// The path of the deletion file is constructed as:
585/// {root}/_deletions/{fragment_id}-{read_version}-{id}.{extension}
586/// where {extension} depends on DeletionFileType.
587#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
588pub struct DeletionFile {
589 /// Type of deletion file.
590 #[prost(enumeration = "deletion_file::DeletionFileType", tag = "1")]
591 pub file_type: i32,
592 /// The version of the dataset this deletion file was built from.
593 #[prost(uint64, tag = "2")]
594 pub read_version: u64,
595 /// An opaque id used to differentiate this file from others written by concurrent
596 /// writers.
597 #[prost(uint64, tag = "3")]
598 pub id: u64,
599 /// The number of rows that are marked as deleted.
600 #[prost(uint64, tag = "4")]
601 pub num_deleted_rows: u64,
602 /// The base path index of the deletion file. Used when the file is imported or referred from another
603 /// dataset. Lance uses it as key of the base_paths field in Manifest to determine the actual base
604 /// path of the deletion file.
605 #[prost(uint32, optional, tag = "7")]
606 pub base_id: ::core::option::Option<u32>,
607}
608/// Nested message and enum types in `DeletionFile`.
609pub mod deletion_file {
610 /// Type of deletion file, intended as a way to increase efficiency of the storage of deleted row
611 /// offsets. If there are sparsely deleted rows, then ARROW_ARRAY is the most efficient. If there
612 /// are densely deleted rows, then BITMAP is the most efficient.
613 #[derive(
614 Clone,
615 Copy,
616 Debug,
617 PartialEq,
618 Eq,
619 Hash,
620 PartialOrd,
621 Ord,
622 ::prost::Enumeration
623 )]
624 #[repr(i32)]
625 pub enum DeletionFileType {
626 /// A single Int32Array of deleted row offsets, stored as an Arrow IPC file with one batch and
627 /// one column. Has a .arrow extension.
628 ArrowArray = 0,
629 /// A Roaring Bitmap of deleted row offsets. Has a .bin extension.
630 Bitmap = 1,
631 }
632 impl DeletionFileType {
633 /// String value of the enum field names used in the ProtoBuf definition.
634 ///
635 /// The values are not transformed in any way and thus are considered stable
636 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
637 pub fn as_str_name(&self) -> &'static str {
638 match self {
639 Self::ArrowArray => "ARROW_ARRAY",
640 Self::Bitmap => "BITMAP",
641 }
642 }
643 /// Creates an enum from field names used in the ProtoBuf definition.
644 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
645 match value {
646 "ARROW_ARRAY" => Some(Self::ArrowArray),
647 "BITMAP" => Some(Self::Bitmap),
648 _ => None,
649 }
650 }
651 }
652}
653#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
654pub struct ExternalFile {
655 /// Path to the file, relative to the root of the table.
656 #[prost(string, tag = "1")]
657 pub path: ::prost::alloc::string::String,
658 /// The byte offset in the file where the data starts.
659 #[prost(uint64, tag = "2")]
660 pub offset: u64,
661 /// The size of the data in the file, in bytes.
662 #[prost(uint64, tag = "3")]
663 pub size: u64,
664}
665#[derive(Clone, PartialEq, ::prost::Message)]
666pub struct FragmentReuseIndexDetails {
667 #[prost(oneof = "fragment_reuse_index_details::Content", tags = "1, 2")]
668 pub content: ::core::option::Option<fragment_reuse_index_details::Content>,
669}
670/// Nested message and enum types in `FragmentReuseIndexDetails`.
671pub mod fragment_reuse_index_details {
672 #[derive(Clone, PartialEq, ::prost::Message)]
673 pub struct InlineContent {
674 #[prost(message, repeated, tag = "1")]
675 pub versions: ::prost::alloc::vec::Vec<Version>,
676 }
677 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
678 pub struct FragmentDigest {
679 #[prost(uint64, tag = "1")]
680 pub id: u64,
681 #[prost(uint64, tag = "2")]
682 pub physical_rows: u64,
683 #[prost(uint64, tag = "3")]
684 pub num_deleted_rows: u64,
685 }
686 /// A summarized version of the RewriteGroup information in a Rewrite transaction
687 #[derive(Clone, PartialEq, ::prost::Message)]
688 pub struct Group {
689 /// A roaring treemap of the changed row addresses.
690 /// When combined with the old fragment IDs and new fragment IDs,
691 /// it can recover the full mapping of old row addresses to either new row addresses or deleted.
692 /// this mapping can then be used to remap indexes or satisfy index queries for the new unindexed fragments.
693 #[prost(bytes = "vec", tag = "1")]
694 pub changed_row_addrs: ::prost::alloc::vec::Vec<u8>,
695 #[prost(message, repeated, tag = "2")]
696 pub old_fragments: ::prost::alloc::vec::Vec<FragmentDigest>,
697 #[prost(message, repeated, tag = "3")]
698 pub new_fragments: ::prost::alloc::vec::Vec<FragmentDigest>,
699 }
700 #[derive(Clone, PartialEq, ::prost::Message)]
701 pub struct Version {
702 /// The dataset_version at the time the index adds this version entry
703 #[prost(uint64, tag = "1")]
704 pub dataset_version: u64,
705 #[prost(message, repeated, tag = "3")]
706 pub groups: ::prost::alloc::vec::Vec<Group>,
707 }
708 #[derive(Clone, PartialEq, ::prost::Oneof)]
709 pub enum Content {
710 /// if < 200KB, store the content inline, otherwise store the InlineContent bytes in external file
711 #[prost(message, tag = "1")]
712 Inline(InlineContent),
713 #[prost(message, tag = "2")]
714 External(super::ExternalFile),
715 }
716}
717/// Shard manifest containing epoch-based fencing and WAL state.
718/// Each shard has exactly one active writer at any time.
719#[derive(Clone, PartialEq, ::prost::Message)]
720pub struct ShardManifest {
721 /// Shard identifier (UUID v4).
722 #[prost(message, optional, tag = "11")]
723 pub shard_id: ::core::option::Option<Uuid>,
724 /// Manifest version number.
725 /// Matches the version encoded in the filename.
726 #[prost(uint64, tag = "1")]
727 pub version: u64,
728 /// Shard spec ID this shard was created with.
729 /// Set at shard creation and immutable thereafter.
730 /// A value of 0 indicates a manually-created shard not governed by any spec.
731 #[prost(uint32, tag = "10")]
732 pub shard_spec_id: u32,
733 /// Computed shard field values as raw Arrow scalar bytes, keyed by shard
734 /// field id. The byte encoding follows Arrow's little-endian convention:
735 /// int32 is 4 LE bytes, utf8 is raw UTF-8 bytes, etc. The receiver looks
736 /// up the result_type from the ShardingSpec to interpret each value.
737 #[prost(message, repeated, tag = "14")]
738 pub shard_field_entries: ::prost::alloc::vec::Vec<ShardFieldEntry>,
739 /// Writer fencing token - monotonically increasing.
740 /// A writer must increment this when claiming the shard.
741 #[prost(uint64, tag = "2")]
742 pub writer_epoch: u64,
743 /// The most recent WAL entry position that has been flushed to a MemTable.
744 /// During recovery, replay starts from replay_after_wal_entry_position + 1.
745 /// WAL positions are 1-based, so the default value 0 unambiguously means
746 /// "no flush has ever stamped this shard" and recovery replays from 1.
747 #[prost(uint64, tag = "3")]
748 pub replay_after_wal_entry_position: u64,
749 /// The most recent WAL entry position observed at the time the manifest was
750 /// updated. WAL positions are 1-based; default 0 means no entry has been
751 /// written yet. This is a hint, not authoritative - recovery must list
752 /// files to find actual state.
753 #[prost(uint64, tag = "4")]
754 pub wal_entry_position_last_seen: u64,
755 /// Generation to assign to the next SSTable (incremented after each MemTable flush).
756 #[prost(uint64, tag = "6")]
757 pub current_generation: u64,
758 /// List of SSTables created by flushing MemTables and their directory paths.
759 #[prost(message, repeated, tag = "8")]
760 pub sstables: ::prost::alloc::vec::Vec<SsTable>,
761 /// Lifecycle status. Default ACTIVE; SEALED marks an in-flight drop
762 /// (drop-table 2PC). A SEALED manifest refuses claims at claim_epoch.
763 #[prost(enumeration = "ShardStatus", tag = "15")]
764 pub status: i32,
765}
766/// A shard field value stored as raw Arrow scalar bytes.
767#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
768pub struct ShardFieldEntry {
769 /// Shard field id (matches ShardingField.field_id in the ShardingSpec).
770 #[prost(string, tag = "1")]
771 pub field_id: ::prost::alloc::string::String,
772 /// Raw Arrow scalar value bytes in little-endian encoding.
773 /// The data type is determined by the result_type of the matching ShardingField.
774 #[prost(bytes = "vec", tag = "2")]
775 pub value: ::prost::alloc::vec::Vec<u8>,
776}
777/// An SSTable: the immutable result of flushing a MemTable, stored as a Lance dataset.
778#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
779pub struct SsTable {
780 /// Generation number identifying this SSTable.
781 #[prost(uint64, tag = "1")]
782 pub generation: u64,
783 /// Directory name relative to the shard directory.
784 #[prost(string, tag = "2")]
785 pub path: ::prost::alloc::string::String,
786}
787/// A pointer to the latest SSTable compacted for a shard.
788#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
789pub struct CompactedSsTable {
790 /// Shard identifier (UUID v4).
791 #[prost(message, optional, tag = "1")]
792 pub shard_id: ::core::option::Option<Uuid>,
793 /// Generation of the latest SSTable compacted into the base table for this shard.
794 #[prost(uint64, tag = "2")]
795 pub generation: u64,
796}
797/// Tracks which compacted SSTable generation a base table index has been rebuilt to cover.
798/// Used to determine whether to read from SSTable indexes or base table.
799#[derive(Clone, PartialEq, ::prost::Message)]
800pub struct IndexCatchupProgress {
801 /// Name of the base table index (must match an entry in maintained_indexes).
802 #[prost(string, tag = "1")]
803 pub index_name: ::prost::alloc::string::String,
804 /// Per-shard progress: the generation up to which this index covers.
805 ///
806 /// An absent shard means *unknown*: this index has recorded no catch-up for
807 /// that shard, so its SSTables must be retained and a repair scheduled.
808 #[prost(message, repeated, tag = "2")]
809 pub caught_up_generations: ::prost::alloc::vec::Vec<CompactedSsTable>,
810}
811/// Index details for MemWAL Index, stored in IndexMetadata.index_details.
812/// This is the centralized structure for all MemWAL metadata:
813/// - Configuration (sharding specs, indexes to maintain)
814/// - SSTable compaction progress
815/// - Shard state snapshots
816///
817/// Writers read this index to get configuration before writing.
818/// Readers may use shard snapshots in this index as a point-in-time
819/// optimization. Readers that need the latest shard set should list shard
820/// directories in storage and read each shard's latest manifest.
821/// A background process updates the index periodically to keep shard snapshots current.
822///
823/// Shard snapshots are stored as a Lance file with one row per shard.
824/// The schema records shard discovery fields. Full mutable shard state remains
825/// authoritative in the shard manifest files.
826/// shard_id: utf8
827/// shard_spec_id: uint32
828/// shard_field_{field_id}: typed per the matching ShardingField.result_type
829#[derive(Clone, PartialEq, ::prost::Message)]
830pub struct MemWalIndexDetails {
831 /// Snapshot timestamp (Unix timestamp in milliseconds).
832 #[prost(int64, tag = "1")]
833 pub snapshot_ts_millis: i64,
834 /// Number of shards in the snapshot.
835 /// Used to determine storage format without reading the snapshot data.
836 #[prost(uint32, tag = "2")]
837 pub num_shards: u32,
838 /// Inline shard snapshots for small shard counts.
839 /// When num_shards <= threshold (implementation-defined, e.g., 100),
840 /// snapshots are stored inline as serialized bytes.
841 /// Format: Lance file bytes with the shard snapshot schema.
842 #[prost(bytes = "vec", optional, tag = "3")]
843 pub inline_snapshots: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
844 /// Sharding specs defining how to derive shard identifiers.
845 /// This configuration determines how rows are partitioned into shards.
846 #[prost(message, repeated, tag = "7")]
847 pub sharding_specs: ::prost::alloc::vec::Vec<ShardingSpec>,
848 /// Indexes from the base table to maintain in MemTables.
849 /// These are index names referencing indexes defined on the base table.
850 /// The primary key btree index is always maintained implicitly and
851 /// should not be listed here.
852 ///
853 /// For vector indexes, MemTables inherit quantization parameters (PQ codebook,
854 /// SQ params) from the base table index to ensure distance comparability.
855 #[prost(string, repeated, tag = "8")]
856 pub maintained_indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
857 /// Latest SSTable compacted into the base table for each shard.
858 /// This is updated atomically with merge-insert data commits, enabling
859 /// conflict resolution when multiple compactors operate concurrently.
860 ///
861 /// Note: This is separate from shard snapshots because:
862 /// 1. compacted_sstables is updated by compactors (atomic with data commit)
863 /// 2. shard snapshots are updated by background index builder
864 #[prost(message, repeated, tag = "9")]
865 pub compacted_sstables: ::prost::alloc::vec::Vec<CompactedSsTable>,
866 /// Per-index catchup progress tracking.
867 /// When data is compacted into the base table, base table indexes are rebuilt
868 /// asynchronously. This field tracks which generation each index covers.
869 ///
870 /// For indexed queries, if an index's caught_up_generation < compacted_generation,
871 /// readers should use SSTable indexes for the gap instead of
872 /// scanning unindexed data in the base table.
873 ///
874 /// An index absent from this list has recorded no catch-up, so the SSTables it
875 /// would need stay live until a repair records it. Only the dedicated WAL
876 /// index-repair path may add entries here;
877 /// ordinary index operations have their entry removed automatically when they
878 /// change an index, since they do not report what the new index covers.
879 #[prost(message, repeated, tag = "10")]
880 pub index_catchup: ::prost::alloc::vec::Vec<IndexCatchupProgress>,
881 /// Default ShardWriter configuration values for this MemWAL index.
882 ///
883 /// A free-form string map persisted so that every writer — across
884 /// processes and restarts — starts from the same default writer
885 /// configuration. These are defaults only: an individual writer may
886 /// still override any value at runtime in its own ShardWriterConfig
887 /// (which is not persisted).
888 #[prost(map = "string, string", tag = "11")]
889 pub writer_config_defaults: ::std::collections::HashMap<
890 ::prost::alloc::string::String,
891 ::prost::alloc::string::String,
892 >,
893}
894/// Sharding spec definition.
895#[derive(Clone, PartialEq, ::prost::Message)]
896pub struct ShardingSpec {
897 /// Unique identifier for this spec within the index.
898 /// IDs are never reused.
899 #[prost(uint32, tag = "1")]
900 pub spec_id: u32,
901 /// Sharding field definitions that determine how to compute shard identifiers.
902 #[prost(message, repeated, tag = "2")]
903 pub fields: ::prost::alloc::vec::Vec<ShardingField>,
904}
905/// Sharding field definition.
906#[derive(Clone, PartialEq, ::prost::Message)]
907pub struct ShardingField {
908 /// Unique string identifier for this shard field.
909 #[prost(string, tag = "1")]
910 pub field_id: ::prost::alloc::string::String,
911 /// Field IDs referencing source columns in the schema.
912 #[prost(int32, repeated, tag = "2")]
913 pub source_ids: ::prost::alloc::vec::Vec<i32>,
914 /// Well-known shard transform name (e.g., "identity", "year", "bucket").
915 /// Mutually exclusive with expression.
916 #[prost(string, optional, tag = "3")]
917 pub transform: ::core::option::Option<::prost::alloc::string::String>,
918 /// DataFusion SQL expression for custom logic.
919 /// Mutually exclusive with transform.
920 #[prost(string, optional, tag = "4")]
921 pub expression: ::core::option::Option<::prost::alloc::string::String>,
922 /// Output type of the shard value (Arrow type name).
923 #[prost(string, tag = "5")]
924 pub result_type: ::prost::alloc::string::String,
925 /// Transform parameters (e.g., num_buckets for bucket transform).
926 #[prost(map = "string, string", tag = "6")]
927 pub parameters: ::std::collections::HashMap<
928 ::prost::alloc::string::String,
929 ::prost::alloc::string::String,
930 >,
931}
932/// Lifecycle status of a WAL shard. Drives drop-table two-phase commit:
933/// a SEALED shard refuses new writer claims (reversible) until the drop
934/// commits (the shard dir is deleted) or rolls back (status -> ACTIVE).
935#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
936#[repr(i32)]
937pub enum ShardStatus {
938 /// Normal: the shard accepts writer claims.
939 Active = 0,
940 /// A drop is in flight: claims are refused. Reversible to ACTIVE.
941 Sealed = 1,
942}
943impl ShardStatus {
944 /// String value of the enum field names used in the ProtoBuf definition.
945 ///
946 /// The values are not transformed in any way and thus are considered stable
947 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
948 pub fn as_str_name(&self) -> &'static str {
949 match self {
950 Self::Active => "ACTIVE",
951 Self::Sealed => "SEALED",
952 }
953 }
954 /// Creates an enum from field names used in the ProtoBuf definition.
955 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
956 match value {
957 "ACTIVE" => Some(Self::Active),
958 "SEALED" => Some(Self::Sealed),
959 _ => None,
960 }
961 }
962}
963/// A transaction represents the changes to a dataset.
964///
965/// This has two purposes:
966/// 1. When retrying a commit, the transaction can be used to re-build an updated
967/// manifest.
968/// 2. When there's a conflict, this can be used to determine whether the other
969/// transaction is compatible with this one.
970#[derive(Clone, PartialEq, ::prost::Message)]
971pub struct Transaction {
972 /// The version of the dataset this transaction was built from.
973 ///
974 /// For example, for a delete transaction this means the version of the dataset
975 /// that was read from while evaluating the deletion predicate.
976 #[prost(uint64, tag = "1")]
977 pub read_version: u64,
978 /// The UUID that unique identifies a transaction.
979 #[prost(string, tag = "2")]
980 pub uuid: ::prost::alloc::string::String,
981 /// Optional version tag.
982 #[prost(string, tag = "3")]
983 pub tag: ::prost::alloc::string::String,
984 /// Optional properties for the transaction
985 /// __lance_commit_message is a reserved key
986 #[prost(map = "string, string", tag = "4")]
987 pub transaction_properties: ::std::collections::HashMap<
988 ::prost::alloc::string::String,
989 ::prost::alloc::string::String,
990 >,
991 /// The operation of this transaction.
992 #[prost(
993 oneof = "transaction::Operation",
994 tags = "100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115"
995 )]
996 pub operation: ::core::option::Option<transaction::Operation>,
997}
998/// Nested message and enum types in `Transaction`.
999pub mod transaction {
1000 /// Add new rows to the dataset.
1001 #[derive(Clone, PartialEq, ::prost::Message)]
1002 pub struct Append {
1003 /// The new fragments to append.
1004 ///
1005 /// Fragment IDs are not yet assigned.
1006 #[prost(message, repeated, tag = "1")]
1007 pub fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1008 }
1009 /// Mark rows as deleted.
1010 #[derive(Clone, PartialEq, ::prost::Message)]
1011 pub struct Delete {
1012 /// The fragments to update
1013 ///
1014 /// The fragment IDs will match existing fragments in the dataset.
1015 #[prost(message, repeated, tag = "1")]
1016 pub updated_fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1017 /// The fragments to delete entirely.
1018 #[prost(uint64, repeated, tag = "2")]
1019 pub deleted_fragment_ids: ::prost::alloc::vec::Vec<u64>,
1020 /// The predicate that was evaluated
1021 ///
1022 /// This may be used to determine whether the delete would have affected
1023 /// files written by a concurrent transaction.
1024 #[prost(string, tag = "3")]
1025 pub predicate: ::prost::alloc::string::String,
1026 }
1027 /// Create or overwrite the entire dataset.
1028 #[derive(Clone, PartialEq, ::prost::Message)]
1029 pub struct Overwrite {
1030 /// The new fragments
1031 ///
1032 /// Fragment IDs are not yet assigned.
1033 #[prost(message, repeated, tag = "1")]
1034 pub fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1035 /// The new schema
1036 #[prost(message, repeated, tag = "2")]
1037 pub schema: ::prost::alloc::vec::Vec<super::super::file::Field>,
1038 /// Schema metadata.
1039 #[prost(map = "string, bytes", tag = "3")]
1040 pub schema_metadata: ::std::collections::HashMap<
1041 ::prost::alloc::string::String,
1042 ::prost::alloc::vec::Vec<u8>,
1043 >,
1044 /// Key-value pairs to merge with existing config.
1045 #[prost(map = "string, string", tag = "4")]
1046 pub config_upsert_values: ::std::collections::HashMap<
1047 ::prost::alloc::string::String,
1048 ::prost::alloc::string::String,
1049 >,
1050 /// The base paths to be added for the initial dataset creation
1051 #[prost(message, repeated, tag = "5")]
1052 pub initial_bases: ::prost::alloc::vec::Vec<super::BasePath>,
1053 }
1054 /// Add or replace a new secondary index.
1055 ///
1056 /// This is also used to remove an index (we are replacing it with nothing)
1057 ///
1058 /// - new_indices: the modified indices, empty if dropping indices only
1059 /// - removed_indices: the indices that are being replaced
1060 #[derive(Clone, PartialEq, ::prost::Message)]
1061 pub struct CreateIndex {
1062 #[prost(message, repeated, tag = "1")]
1063 pub new_indices: ::prost::alloc::vec::Vec<super::IndexMetadata>,
1064 #[prost(message, repeated, tag = "2")]
1065 pub removed_indices: ::prost::alloc::vec::Vec<super::IndexMetadata>,
1066 }
1067 /// An operation that rewrites but does not change the data in the table. These
1068 /// kinds of operations just rearrange data.
1069 #[derive(Clone, PartialEq, ::prost::Message)]
1070 pub struct Rewrite {
1071 /// The old fragments that are being replaced
1072 ///
1073 /// DEPRECATED: use groups instead.
1074 ///
1075 /// These should all have existing fragment IDs.
1076 #[prost(message, repeated, tag = "1")]
1077 pub old_fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1078 /// The new fragments
1079 ///
1080 /// DEPRECATED: use groups instead.
1081 ///
1082 /// These fragments IDs are not yet assigned.
1083 #[prost(message, repeated, tag = "2")]
1084 pub new_fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1085 /// Groups of files that have been rewritten
1086 #[prost(message, repeated, tag = "3")]
1087 pub groups: ::prost::alloc::vec::Vec<rewrite::RewriteGroup>,
1088 /// Indices that have been rewritten
1089 #[prost(message, repeated, tag = "4")]
1090 pub rewritten_indices: ::prost::alloc::vec::Vec<rewrite::RewrittenIndex>,
1091 }
1092 /// Nested message and enum types in `Rewrite`.
1093 pub mod rewrite {
1094 /// During a rewrite an index may be rewritten. We only serialize the UUID
1095 /// since a rewrite should not change the other index parameters.
1096 #[derive(Clone, PartialEq, ::prost::Message)]
1097 pub struct RewrittenIndex {
1098 /// The id of the index that will be replaced
1099 #[prost(message, optional, tag = "1")]
1100 pub old_id: ::core::option::Option<super::super::Uuid>,
1101 /// the id of the new index
1102 #[prost(message, optional, tag = "2")]
1103 pub new_id: ::core::option::Option<super::super::Uuid>,
1104 /// the new index details
1105 #[prost(message, optional, tag = "3")]
1106 pub new_index_details: ::core::option::Option<::prost_types::Any>,
1107 /// the version of the new index
1108 #[prost(uint32, tag = "4")]
1109 pub new_index_version: u32,
1110 /// Files in the new index with their sizes.
1111 /// Empty if file sizes are not available (e.g. older writers).
1112 #[prost(message, repeated, tag = "5")]
1113 pub new_index_files: ::prost::alloc::vec::Vec<super::super::IndexFile>,
1114 }
1115 /// A group of rewrite files that are all part of the same rewrite.
1116 #[derive(Clone, PartialEq, ::prost::Message)]
1117 pub struct RewriteGroup {
1118 /// The old fragment that is being replaced
1119 ///
1120 /// This should have an existing fragment ID.
1121 #[prost(message, repeated, tag = "1")]
1122 pub old_fragments: ::prost::alloc::vec::Vec<super::super::DataFragment>,
1123 /// The new fragment
1124 ///
1125 /// The ID should have been reserved by an earlier
1126 /// reserve operation
1127 #[prost(message, repeated, tag = "2")]
1128 pub new_fragments: ::prost::alloc::vec::Vec<super::super::DataFragment>,
1129 }
1130 }
1131 /// An operation that merges in a new column, altering the schema.
1132 #[derive(Clone, PartialEq, ::prost::Message)]
1133 pub struct Merge {
1134 /// The updated fragments
1135 ///
1136 /// These should all have existing fragment IDs.
1137 #[prost(message, repeated, tag = "1")]
1138 pub fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1139 /// The new schema
1140 #[prost(message, repeated, tag = "2")]
1141 pub schema: ::prost::alloc::vec::Vec<super::super::file::Field>,
1142 /// Schema metadata.
1143 #[prost(map = "string, bytes", tag = "3")]
1144 pub schema_metadata: ::std::collections::HashMap<
1145 ::prost::alloc::string::String,
1146 ::prost::alloc::vec::Vec<u8>,
1147 >,
1148 /// Set when this merge makes no nullability-affecting schema change: it
1149 /// introduces no field that data staged against an earlier schema could
1150 /// not safely omit. Without the assertion (including transactions written
1151 /// before this field existed) the merge conservatively conflicts with
1152 /// concurrent value-writes, which can only cause a retry.
1153 #[prost(bool, tag = "4")]
1154 pub preserves_nullability: bool,
1155 }
1156 /// An operation that projects a subset of columns, altering the schema.
1157 #[derive(Clone, PartialEq, ::prost::Message)]
1158 pub struct Project {
1159 /// The new schema
1160 #[prost(message, repeated, tag = "1")]
1161 pub schema: ::prost::alloc::vec::Vec<super::super::file::Field>,
1162 /// Set when this projection makes no nullability-affecting schema change,
1163 /// as a rename or a drop does not. Without the assertion (including
1164 /// transactions written before this field existed) the projection
1165 /// conservatively conflicts with concurrent value-writes, which can only
1166 /// cause a retry. A nullability tightening must not set this.
1167 #[prost(bool, tag = "2")]
1168 pub preserves_nullability: bool,
1169 }
1170 /// An operation that restores a dataset to a previous version.
1171 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1172 pub struct Restore {
1173 /// The version to restore to
1174 #[prost(uint64, tag = "1")]
1175 pub version: u64,
1176 }
1177 /// An operation that reserves fragment ids for future use in
1178 /// a rewrite operation.
1179 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1180 pub struct ReserveFragments {
1181 #[prost(uint32, tag = "1")]
1182 pub num_fragments: u32,
1183 }
1184 /// An operation that clones a dataset.
1185 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1186 pub struct Clone {
1187 /// - true: Performs a metadata-only clone (copies manifest without data files).
1188 /// The cloned dataset references original data through `base_paths`,
1189 /// suitable for experimental scenarios or rapid metadata migration.
1190 /// - false: Performs a full deep clone using the underlying object storage's native
1191 /// copy API (e.g., S3 CopyObject, GCS rewrite). This leverages server-side
1192 /// bulk copy operations to bypass download/upload bottlenecks, achieving
1193 /// near-linear speedup for large datasets (typically 3-10x faster than
1194 /// manual file transfers). The operation maintains atomicity and data
1195 /// integrity guarantees provided by the storage backend.
1196 #[prost(bool, tag = "1")]
1197 pub is_shallow: bool,
1198 /// the reference name in the source dataset
1199 /// in most cases it should be the branch or tag name in the source dataset
1200 #[prost(string, optional, tag = "2")]
1201 pub ref_name: ::core::option::Option<::prost::alloc::string::String>,
1202 /// the version of the source dataset for cloning
1203 #[prost(uint64, tag = "3")]
1204 pub ref_version: u64,
1205 /// the absolute base path of the source dataset for cloning
1206 #[prost(string, tag = "4")]
1207 pub ref_path: ::prost::alloc::string::String,
1208 /// if the target dataset is a branch, this is the branch name of the target dataset
1209 #[prost(string, optional, tag = "5")]
1210 pub branch_name: ::core::option::Option<::prost::alloc::string::String>,
1211 }
1212 /// Exact set of key hashes for conflict detection.
1213 /// Used when the number of inserted rows is small.
1214 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1215 pub struct ExactKeySetFilter {
1216 /// 64-bit hashes of the inserted row keys.
1217 #[prost(uint64, repeated, tag = "1")]
1218 pub key_hashes: ::prost::alloc::vec::Vec<u64>,
1219 }
1220 /// Bloom filter for key existence tests.
1221 /// Used when the number of rows is large.
1222 #[derive(Clone, PartialEq, ::prost::Message)]
1223 pub struct BloomFilter {
1224 /// Bitset backing the bloom filter (SBBF format).
1225 #[prost(bytes = "vec", tag = "1")]
1226 pub bitmap: ::prost::alloc::vec::Vec<u8>,
1227 /// Number of bits in the bitmap.
1228 #[prost(uint32, tag = "2")]
1229 pub num_bits: u32,
1230 /// Number of items the filter was sized for.
1231 /// Used for intersection validation (filters with different sizes cannot be compared).
1232 /// Default: 8192
1233 #[prost(uint64, tag = "3")]
1234 pub number_of_items: u64,
1235 /// False positive probability the filter was sized for.
1236 /// Used for intersection validation (filters with different parameters cannot be compared).
1237 /// Default: 0.00057
1238 #[prost(double, tag = "4")]
1239 pub probability: f64,
1240 }
1241 /// A filter for checking key existence in set of rows inserted by a merge insert operation.
1242 /// Only created when the merge insert's ON columns match the schema's unenforced primary key.
1243 /// The presence of this filter indicates strict primary key conflict detection should be used.
1244 /// Can use either an exact set (for small row counts) or a Bloom filter (for large row counts).
1245 #[derive(Clone, PartialEq, ::prost::Message)]
1246 pub struct KeyExistenceFilter {
1247 /// Field IDs of columns participating in the key (must match unenforced primary key).
1248 #[prost(int32, repeated, tag = "1")]
1249 pub field_ids: ::prost::alloc::vec::Vec<i32>,
1250 /// The underlying data structure storing the key hashes.
1251 #[prost(oneof = "key_existence_filter::Data", tags = "2, 3")]
1252 pub data: ::core::option::Option<key_existence_filter::Data>,
1253 }
1254 /// Nested message and enum types in `KeyExistenceFilter`.
1255 pub mod key_existence_filter {
1256 /// The underlying data structure storing the key hashes.
1257 #[derive(Clone, PartialEq, ::prost::Oneof)]
1258 pub enum Data {
1259 /// Exact set of key hashes (used for small number of rows).
1260 #[prost(message, tag = "2")]
1261 Exact(super::ExactKeySetFilter),
1262 /// Bloom filter (used for large number of rows).
1263 #[prost(message, tag = "3")]
1264 Bloom(super::BloomFilter),
1265 }
1266 }
1267 /// Serialized as sorted distinct local physical row offsets within the fragment (0-based).
1268 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1269 pub struct UInt32List {
1270 #[prost(uint32, repeated, tag = "1")]
1271 pub values: ::prost::alloc::vec::Vec<u32>,
1272 }
1273 /// An operation that updates rows but does not add or remove rows.
1274 #[derive(Clone, PartialEq, ::prost::Message)]
1275 pub struct Update {
1276 /// The fragments that have been removed. These are fragments where all rows
1277 /// have been updated and moved to a new fragment.
1278 #[prost(uint64, repeated, tag = "1")]
1279 pub removed_fragment_ids: ::prost::alloc::vec::Vec<u64>,
1280 /// The fragments that have been updated.
1281 #[prost(message, repeated, tag = "2")]
1282 pub updated_fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1283 /// The new fragments where updated rows have been moved to.
1284 #[prost(message, repeated, tag = "3")]
1285 pub new_fragments: ::prost::alloc::vec::Vec<super::DataFragment>,
1286 /// The ids of the fields that have been modified.
1287 #[prost(uint32, repeated, tag = "4")]
1288 pub fields_modified: ::prost::alloc::vec::Vec<u32>,
1289 /// / SSTables to mark as compacted after this transaction.
1290 #[prost(message, repeated, tag = "5")]
1291 pub compacted_sstables: ::prost::alloc::vec::Vec<super::CompactedSsTable>,
1292 /// / The fields that used to judge whether to preserve the new frag's id into
1293 /// / the frag bitmap of the specified indices.
1294 #[prost(uint32, repeated, tag = "6")]
1295 pub fields_for_preserving_frag_bitmap: ::prost::alloc::vec::Vec<u32>,
1296 /// The mode of update
1297 #[prost(enumeration = "UpdateMode", tag = "7")]
1298 pub update_mode: i32,
1299 /// Filter for checking existence of keys in newly inserted rows, used for conflict detection.
1300 /// Only tracks keys from INSERT operations during merge insert, not updates.
1301 #[prost(message, optional, tag = "8")]
1302 pub inserted_rows: ::core::option::Option<KeyExistenceFilter>,
1303 /// Per-fragment physical row offsets that matched an update_columns hash join (RewriteColumns).
1304 /// Deprecated: use updated_fragment_offset_bitmaps (field 10) instead.
1305 #[prost(map = "uint64, message", tag = "9")]
1306 pub updated_fragment_offsets: ::std::collections::HashMap<u64, UInt32List>,
1307 /// Per-fragment matched offsets as portable RoaringBitmap bytes (replaces field 9).
1308 /// Writers emit field 10 only. Readers prefer field 10; fall back to field 9 for
1309 /// manifests written before this change.
1310 #[prost(map = "uint64, bytes", tag = "10")]
1311 pub updated_fragment_offset_bitmaps: ::std::collections::HashMap<
1312 u64,
1313 ::prost::alloc::vec::Vec<u8>,
1314 >,
1315 }
1316 /// An entry for a map update. If value is not set, the key will be removed from the map.
1317 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1318 pub struct UpdateMapEntry {
1319 /// The key of the map entry to update.
1320 #[prost(string, tag = "1")]
1321 pub key: ::prost::alloc::string::String,
1322 /// The value to set for the key.
1323 #[prost(string, optional, tag = "2")]
1324 pub value: ::core::option::Option<::prost::alloc::string::String>,
1325 }
1326 #[derive(Clone, PartialEq, ::prost::Message)]
1327 pub struct UpdateMap {
1328 #[prost(message, repeated, tag = "1")]
1329 pub update_entries: ::prost::alloc::vec::Vec<UpdateMapEntry>,
1330 /// If true, the map will be replaced entirely with the new entries.
1331 /// If false, the new entries will be merged with the existing map.
1332 #[prost(bool, tag = "2")]
1333 pub replace: bool,
1334 }
1335 /// An operation that updates the table config, table metadata, schema metadata,
1336 /// or field metadata.
1337 #[derive(Clone, PartialEq, ::prost::Message)]
1338 pub struct UpdateConfig {
1339 #[prost(message, optional, tag = "6")]
1340 pub config_updates: ::core::option::Option<UpdateMap>,
1341 #[prost(message, optional, tag = "7")]
1342 pub table_metadata_updates: ::core::option::Option<UpdateMap>,
1343 #[prost(message, optional, tag = "8")]
1344 pub schema_metadata_updates: ::core::option::Option<UpdateMap>,
1345 #[prost(map = "int32, message", tag = "9")]
1346 pub field_metadata_updates: ::std::collections::HashMap<i32, UpdateMap>,
1347 /// Deprecated -------------------------------
1348 #[prost(map = "string, string", tag = "1")]
1349 pub upsert_values: ::std::collections::HashMap<
1350 ::prost::alloc::string::String,
1351 ::prost::alloc::string::String,
1352 >,
1353 #[prost(string, repeated, tag = "2")]
1354 pub delete_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1355 #[prost(map = "string, string", tag = "3")]
1356 pub schema_metadata: ::std::collections::HashMap<
1357 ::prost::alloc::string::String,
1358 ::prost::alloc::string::String,
1359 >,
1360 #[prost(map = "uint32, message", tag = "4")]
1361 pub field_metadata: ::std::collections::HashMap<
1362 u32,
1363 update_config::FieldMetadataUpdate,
1364 >,
1365 }
1366 /// Nested message and enum types in `UpdateConfig`.
1367 pub mod update_config {
1368 #[derive(Clone, PartialEq, ::prost::Message)]
1369 pub struct FieldMetadataUpdate {
1370 #[prost(map = "string, string", tag = "5")]
1371 pub metadata: ::std::collections::HashMap<
1372 ::prost::alloc::string::String,
1373 ::prost::alloc::string::String,
1374 >,
1375 }
1376 }
1377 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1378 pub struct DataReplacementGroup {
1379 #[prost(uint64, tag = "1")]
1380 pub fragment_id: u64,
1381 #[prost(message, optional, tag = "2")]
1382 pub new_file: ::core::option::Option<super::DataFile>,
1383 }
1384 /// An operation that replaces the data in a region of the table with new data.
1385 #[derive(Clone, PartialEq, ::prost::Message)]
1386 pub struct DataReplacement {
1387 #[prost(message, repeated, tag = "1")]
1388 pub replacements: ::prost::alloc::vec::Vec<DataReplacementGroup>,
1389 }
1390 /// Overlay files to append to a single fragment, in order (the last entry is
1391 /// newest). The overlays are appended to the fragment's existing `overlays`
1392 /// list; they do not replace it, so overlays written by concurrent commits are
1393 /// preserved.
1394 #[derive(Clone, PartialEq, ::prost::Message)]
1395 pub struct DataOverlayGroup {
1396 #[prost(uint64, tag = "1")]
1397 pub fragment_id: u64,
1398 /// Each DataOverlayFile.committed_version is left 0 by the writer and stamped
1399 /// to the new dataset version at commit time (re-stamped on retry), in the
1400 /// same way as the created-at / last-updated-at version sequences. The fields
1401 /// touched are read from each overlay's `data_file.fields`.
1402 #[prost(message, repeated, tag = "2")]
1403 pub overlays: ::prost::alloc::vec::Vec<super::DataOverlayFile>,
1404 }
1405 /// Attach overlay files to fragments, supplying new values for a subset of
1406 /// (row offset, field) cells without rewriting the fragments' base data files.
1407 /// See the DataOverlayFile message in table.proto for resolution, coverage, and
1408 /// versioning rules, and the Data Overlay Files and Transactions specifications
1409 /// for the (intentionally permissive) conflict semantics.
1410 #[derive(Clone, PartialEq, ::prost::Message)]
1411 pub struct DataOverlay {
1412 #[prost(message, repeated, tag = "1")]
1413 pub groups: ::prost::alloc::vec::Vec<DataOverlayGroup>,
1414 }
1415 /// Update SSTable compaction progress in the MemWAL index.
1416 /// This operation is used during merge-insert to atomically record which
1417 /// SSTables have been compacted into the base table.
1418 #[derive(Clone, PartialEq, ::prost::Message)]
1419 pub struct UpdateMemWalState {
1420 /// SSTables being marked as compacted.
1421 #[prost(message, repeated, tag = "1")]
1422 pub compacted_sstables: ::prost::alloc::vec::Vec<super::CompactedSsTable>,
1423 }
1424 /// An operation that updates base paths in the dataset.
1425 #[derive(Clone, PartialEq, ::prost::Message)]
1426 pub struct UpdateBases {
1427 /// The new base paths to add to the manifest.
1428 #[prost(message, repeated, tag = "1")]
1429 pub new_bases: ::prost::alloc::vec::Vec<super::BasePath>,
1430 }
1431 /// The mode of update operation
1432 #[derive(
1433 Clone,
1434 Copy,
1435 Debug,
1436 PartialEq,
1437 Eq,
1438 Hash,
1439 PartialOrd,
1440 Ord,
1441 ::prost::Enumeration
1442 )]
1443 #[repr(i32)]
1444 pub enum UpdateMode {
1445 /// / rows are deleted in current fragments and rewritten in new fragments.
1446 /// / This is most optimal when the majority of columns are being rewritten
1447 /// / or only a few rows are being updated.
1448 RewriteRows = 0,
1449 /// / within each fragment, columns are fully rewritten and inserted as new data files.
1450 /// / Old versions of columns are tombstoned. This is most optimal when most rows are affected
1451 /// / but a small subset of columns are affected.
1452 RewriteColumns = 1,
1453 }
1454 impl UpdateMode {
1455 /// String value of the enum field names used in the ProtoBuf definition.
1456 ///
1457 /// The values are not transformed in any way and thus are considered stable
1458 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1459 pub fn as_str_name(&self) -> &'static str {
1460 match self {
1461 Self::RewriteRows => "REWRITE_ROWS",
1462 Self::RewriteColumns => "REWRITE_COLUMNS",
1463 }
1464 }
1465 /// Creates an enum from field names used in the ProtoBuf definition.
1466 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1467 match value {
1468 "REWRITE_ROWS" => Some(Self::RewriteRows),
1469 "REWRITE_COLUMNS" => Some(Self::RewriteColumns),
1470 _ => None,
1471 }
1472 }
1473 }
1474 /// The operation of this transaction.
1475 #[derive(Clone, PartialEq, ::prost::Oneof)]
1476 pub enum Operation {
1477 #[prost(message, tag = "100")]
1478 Append(Append),
1479 #[prost(message, tag = "101")]
1480 Delete(Delete),
1481 #[prost(message, tag = "102")]
1482 Overwrite(Overwrite),
1483 #[prost(message, tag = "103")]
1484 CreateIndex(CreateIndex),
1485 #[prost(message, tag = "104")]
1486 Rewrite(Rewrite),
1487 #[prost(message, tag = "105")]
1488 Merge(Merge),
1489 #[prost(message, tag = "106")]
1490 Restore(Restore),
1491 #[prost(message, tag = "107")]
1492 ReserveFragments(ReserveFragments),
1493 #[prost(message, tag = "108")]
1494 Update(Update),
1495 #[prost(message, tag = "109")]
1496 Project(Project),
1497 #[prost(message, tag = "110")]
1498 UpdateConfig(UpdateConfig),
1499 #[prost(message, tag = "111")]
1500 DataReplacement(DataReplacement),
1501 #[prost(message, tag = "112")]
1502 UpdateMemWalState(UpdateMemWalState),
1503 #[prost(message, tag = "113")]
1504 Clone(Clone),
1505 #[prost(message, tag = "114")]
1506 UpdateBases(UpdateBases),
1507 #[prost(message, tag = "115")]
1508 DataOverlay(DataOverlay),
1509 }
1510}