iceberg-cpp
Loading...
Searching...
No Matches
v2_metadata_internal.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
23
25
26namespace iceberg {
27
30 public:
31 ManifestEntryAdapterV2(std::optional<int64_t> snapshot_id,
32 std::shared_ptr<PartitionSpec> partition_spec,
33 std::shared_ptr<Schema> current_schema, ManifestContent content);
34
35 Status Init() override;
36 Status Append(const ManifestEntry& entry) override;
37
38 static std::shared_ptr<Schema> EntrySchema(std::shared_ptr<StructType> partition_type);
39 static std::shared_ptr<Schema> WrapFileSchema(std::shared_ptr<StructType> file_schema);
40 static std::shared_ptr<StructType> DataFileType(
41 std::shared_ptr<StructType> partition_type);
42
43 protected:
44 Result<std::optional<int64_t>> GetSequenceNumber(
45 const ManifestEntry& entry) const override;
46 Result<std::optional<std::string>> GetReferenceDataFile(
47 const DataFile& file) const override;
48};
49
52 public:
53 ManifestFileAdapterV2(int64_t snapshot_id, std::optional<int64_t> parent_snapshot_id,
54 int64_t sequence_number)
55 : snapshot_id_(snapshot_id),
56 parent_snapshot_id_(parent_snapshot_id),
57 sequence_number_(sequence_number) {}
58 Status Init() override;
59 Status Append(const ManifestFile& file) override;
60
61 static const std::shared_ptr<Schema> kManifestListSchema;
62
63 protected:
64 Result<int64_t> GetSequenceNumber(const ManifestFile& file) const override;
65 Result<int64_t> GetMinSequenceNumber(const ManifestFile& file) const override;
66
67 private:
68 int64_t snapshot_id_;
69 std::optional<int64_t> parent_snapshot_id_;
70 int64_t sequence_number_;
71};
72
73} // namespace iceberg
Adapter to convert V2 ManifestEntry to ArrowArray.
Definition v2_metadata_internal.h:29
Adapter for appending a list of ManifestEntrys to an ArrowArray. Implemented by different versions wi...
Definition manifest_adapter_internal.h:61
Adapter to convert V2 ManifestFile to ArrowArray.
Definition v2_metadata_internal.h:51
Adapter for appending a list of ManifestFiles to an ArrowArray. Implemented by different versions wit...
Definition manifest_adapter_internal.h:110
ManifestContent
The type of files tracked by the manifest, either data or delete files; 0 for all v1 manifests.
Definition manifest_list.h:77
DataFile carries data file path, partition tuple, metrics, ...
Definition manifest_entry.h:62
A manifest is an immutable Avro file that lists data files or delete files, along with each file's pa...
Definition manifest_entry.h:307
Entry in a manifest list.
Definition manifest_list.h:85