iceberg-cpp
Loading...
Searching...
No Matches
statistics_file.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
24
25#include <cstdint>
26#include <string>
27#include <unordered_map>
28#include <vector>
29
30#include "iceberg/iceberg_export.h"
31
32namespace iceberg {
33
35struct ICEBERG_EXPORT BlobMetadata {
37 std::string type;
43 std::vector<int32_t> fields;
45 std::unordered_map<std::string, std::string> properties;
46
48 friend bool operator==(const BlobMetadata& lhs, const BlobMetadata& rhs) = default;
49};
50
52struct ICEBERG_EXPORT StatisticsFile {
54 int64_t snapshot_id;
56 std::string path;
62 std::vector<BlobMetadata> blob_metadata;
63
65 friend bool operator==(const StatisticsFile& lhs, const StatisticsFile& rhs) = default;
66};
67
69struct ICEBERG_EXPORT PartitionStatisticsFile {
72 int64_t snapshot_id;
74 std::string path;
77
79 friend bool operator==(const PartitionStatisticsFile& lhs,
80 const PartitionStatisticsFile& rhs) = default;
81};
82
84ICEBERG_EXPORT std::string ToString(const BlobMetadata& blob_metadata);
85
87ICEBERG_EXPORT std::string ToString(const StatisticsFile& statistics_file);
88
90ICEBERG_EXPORT std::string ToString(
91 const PartitionStatisticsFile& partition_statistics_file);
92
93} // namespace iceberg
Metadata about a statistics or indices blob.
Definition statistics_file.h:35
std::string type
Type of the blob.
Definition statistics_file.h:37
std::unordered_map< std::string, std::string > properties
Additional properties of the blob, specific to the blob type.
Definition statistics_file.h:45
int64_t source_snapshot_id
ID of the Iceberg table's snapshot the blob was computed from.
Definition statistics_file.h:39
int64_t source_snapshot_sequence_number
Sequence number of the Iceberg table's snapshot the blob was computed from.
Definition statistics_file.h:41
friend bool operator==(const BlobMetadata &lhs, const BlobMetadata &rhs)=default
Compare two BlobMetadatas for equality.
std::vector< int32_t > fields
Ordered list of fields the blob was calculated from.
Definition statistics_file.h:43
Represents a partition statistics file.
Definition statistics_file.h:69
int64_t snapshot_id
Definition statistics_file.h:72
std::string path
Fully qualified path to the file.
Definition statistics_file.h:74
int64_t file_size_in_bytes
The size of the partition statistics file in bytes.
Definition statistics_file.h:76
friend bool operator==(const PartitionStatisticsFile &lhs, const PartitionStatisticsFile &rhs)=default
Compare two PartitionStatisticsFiles for equality.
Represents a statistics file in the Puffin format.
Definition statistics_file.h:52
std::string path
Fully qualified path to the file.
Definition statistics_file.h:56
int64_t file_footer_size_in_bytes
The size of the file footer in bytes.
Definition statistics_file.h:60
friend bool operator==(const StatisticsFile &lhs, const StatisticsFile &rhs)=default
Compare two StatisticsFiles for equality.
int64_t file_size_in_bytes
The size of the file in bytes.
Definition statistics_file.h:58
int64_t snapshot_id
ID of the Iceberg table's snapshot the statistics file is associated with.
Definition statistics_file.h:54
std::vector< BlobMetadata > blob_metadata
List of statistics contained in the file.
Definition statistics_file.h:62