Skip to content

Commit 0f79c7c

Browse files
committed
Merge branch 'main' into table-scan
2 parents 812a545 + 3cf5963 commit 0f79c7c

File tree

15 files changed

+16
-80
lines changed

15 files changed

+16
-80
lines changed

src/iceberg/json_internal.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "iceberg/util/formatter.h" // IWYU pragma: keep
4444
#include "iceberg/util/macros.h"
4545
#include "iceberg/util/timepoint.h"
46+
#include "iceberg/util/unreachable.h"
4647

4748
namespace iceberg {
4849

@@ -477,6 +478,8 @@ nlohmann::json ToJson(const Type& type) {
477478
case TypeId::kUuid:
478479
return "uuid";
479480
}
481+
internal::Unreachable(
482+
std::format("Unknown type id: {}", static_cast<int>(type.type_id())));
480483
}
481484

482485
nlohmann::json ToJson(const Schema& schema) {
@@ -1053,7 +1056,9 @@ Status ParsePartitionSpecs(const nlohmann::json& json, int8_t format_version,
10531056
int32_t next_partition_field_id = PartitionSpec::kLegacyPartitionDataIdStart;
10541057
std::vector<PartitionField> fields;
10551058
for (const auto& entry_json : partition_spec_json) {
1056-
ICEBERG_ASSIGN_OR_RAISE(auto field, PartitionFieldFromJson(entry_json));
1059+
ICEBERG_ASSIGN_OR_RAISE(
1060+
auto field, PartitionFieldFromJson(
1061+
entry_json, /*allow_field_id_missing=*/format_version == 1));
10571062
int32_t field_id = field->field_id();
10581063
if (field_id == SchemaField::kInvalidFieldId) {
10591064
// If the field ID is not set, we need to assign a new one

src/iceberg/partition_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ class ICEBERG_EXPORT PartitionField : public util::Formattable {
6262
return lhs.Equals(rhs);
6363
}
6464

65-
friend bool operator!=(const PartitionField& lhs, const PartitionField& rhs) {
66-
return !(lhs == rhs);
67-
}
68-
6965
private:
7066
/// \brief Compare two fields for equality.
7167
[[nodiscard]] bool Equals(const PartitionField& other) const;

src/iceberg/partition_spec.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ class ICEBERG_EXPORT PartitionSpec : public util::Formattable {
7575
return lhs.Equals(rhs);
7676
}
7777

78-
friend bool operator!=(const PartitionSpec& lhs, const PartitionSpec& rhs) {
79-
return !(lhs == rhs);
80-
}
81-
8278
private:
8379
/// \brief Compare two partition specs for equality.
8480
[[nodiscard]] bool Equals(const PartitionSpec& other) const;

src/iceberg/schema.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class ICEBERG_EXPORT Schema : public StructType {
5656

5757
friend bool operator==(const Schema& lhs, const Schema& rhs) { return lhs.Equals(rhs); }
5858

59-
friend bool operator!=(const Schema& lhs, const Schema& rhs) { return !(lhs == rhs); }
60-
6159
private:
6260
/// \brief Compare two schemas for equality.
6361
[[nodiscard]] bool Equals(const Schema& other) const;

src/iceberg/schema_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
7676
return lhs.Equals(rhs);
7777
}
7878

79-
friend bool operator!=(const SchemaField& lhs, const SchemaField& rhs) {
80-
return !(lhs == rhs);
81-
}
82-
8379
private:
8480
/// \brief Compare two fields for equality.
8581
[[nodiscard]] bool Equals(const SchemaField& other) const;

src/iceberg/schema_util.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "iceberg/util/checked_cast.h"
3030
#include "iceberg/util/formatter_internal.h"
3131
#include "iceberg/util/macros.h"
32+
#include "iceberg/util/unreachable.h"
3233

3334
namespace iceberg {
3435

@@ -172,6 +173,8 @@ std::string_view ToString(FieldProjection::Kind kind) {
172173
case FieldProjection::Kind::kNull:
173174
return "null";
174175
}
176+
internal::Unreachable(
177+
std::format("Unknown field projection kind: {}", static_cast<int>(kind)));
175178
}
176179

177180
std::string ToString(const FieldProjection& projection) {

src/iceberg/snapshot.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ struct ICEBERG_EXPORT SnapshotRef {
8080
return lhs.Equals(rhs);
8181
}
8282

83-
/// \brief Compare two branches for inequality.
84-
friend bool operator!=(const Branch& lhs, const Branch& rhs) { return !(lhs == rhs); }
85-
8683
private:
8784
/// \brief Compare two branches for equality.
8885
bool Equals(const Branch& other) const;
@@ -97,9 +94,6 @@ struct ICEBERG_EXPORT SnapshotRef {
9794
/// \brief Compare two tags for equality.
9895
friend bool operator==(const Tag& lhs, const Tag& rhs) { return lhs.Equals(rhs); }
9996

100-
/// \brief Compare two tags for inequality.
101-
friend bool operator!=(const Tag& lhs, const Tag& rhs) { return !(lhs == rhs); }
102-
10397
private:
10498
/// \brief Compare two tags for equality.
10599
bool Equals(const Tag& other) const;
@@ -117,11 +111,6 @@ struct ICEBERG_EXPORT SnapshotRef {
117111
return lhs.Equals(rhs);
118112
}
119113

120-
/// \brief Compare two snapshot refs for inequality.
121-
friend bool operator!=(const SnapshotRef& lhs, const SnapshotRef& rhs) {
122-
return !(lhs == rhs);
123-
}
124-
125114
private:
126115
/// \brief Compare two snapshot refs for equality.
127116
bool Equals(const SnapshotRef& other) const;
@@ -263,11 +252,6 @@ struct ICEBERG_EXPORT Snapshot {
263252
return lhs.Equals(rhs);
264253
}
265254

266-
/// \brief Compare two snapshots for inequality.
267-
friend bool operator!=(const Snapshot& lhs, const Snapshot& rhs) {
268-
return !(lhs == rhs);
269-
}
270-
271255
private:
272256
/// \brief Compare two snapshots for equality.
273257
bool Equals(const Snapshot& other) const;

src/iceberg/sort_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ class ICEBERG_EXPORT SortField : public util::Formattable {
113113
return lhs.Equals(rhs);
114114
}
115115

116-
friend bool operator!=(const SortField& lhs, const SortField& rhs) {
117-
return !(lhs == rhs);
118-
}
119-
120116
private:
121117
/// \brief Compare two fields for equality.
122118
[[nodiscard]] bool Equals(const SortField& other) const;

src/iceberg/sort_order.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ class ICEBERG_EXPORT SortOrder : public util::Formattable {
5555
return lhs.Equals(rhs);
5656
}
5757

58-
friend bool operator!=(const SortOrder& lhs, const SortOrder& rhs) {
59-
return !(lhs == rhs);
60-
}
61-
6258
private:
6359
/// \brief Compare two sort orders for equality.
6460
bool Equals(const SortOrder& other) const;

src/iceberg/statistics_file.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ struct ICEBERG_EXPORT BlobMetadata {
5050
lhs.source_snapshot_sequence_number == rhs.source_snapshot_sequence_number &&
5151
lhs.fields == rhs.fields && lhs.properties == rhs.properties;
5252
}
53-
54-
/// \brief Compare two BlobMetadatas for inequality.
55-
friend bool operator!=(const BlobMetadata& lhs, const BlobMetadata& rhs) {
56-
return !(lhs == rhs);
57-
}
5853
};
5954

6055
/// \brief Represents a statistics file in the Puffin format
@@ -77,11 +72,6 @@ struct ICEBERG_EXPORT StatisticsFile {
7772
lhs.file_footer_size_in_bytes == rhs.file_footer_size_in_bytes &&
7873
lhs.blob_metadata == rhs.blob_metadata;
7974
}
80-
81-
/// \brief Compare two StatisticsFiles for inequality.
82-
friend bool operator!=(const StatisticsFile& lhs, const StatisticsFile& rhs) {
83-
return !(lhs == rhs);
84-
}
8575
};
8676

8777
/// \brief Represents a partition statistics file
@@ -100,12 +90,6 @@ struct ICEBERG_EXPORT PartitionStatisticsFile {
10090
return lhs.snapshot_id == rhs.snapshot_id && lhs.path == rhs.path &&
10191
lhs.file_size_in_bytes == rhs.file_size_in_bytes;
10292
}
103-
104-
/// \brief Compare two PartitionStatisticsFiles for inequality.
105-
friend bool operator!=(const PartitionStatisticsFile& lhs,
106-
const PartitionStatisticsFile& rhs) {
107-
return !(lhs == rhs);
108-
}
10993
};
11094

11195
/// \brief Returns a string representation of a BlobMetadata

0 commit comments

Comments
 (0)