Skip to content

Commit 45c9312

Browse files
committed
write null to invalid snapshot id
1 parent 45514cf commit 45c9312

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/iceberg/json_internal.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ constexpr std::string_view kStatisticsPath = "statistics-path";
160160
constexpr std::string_view kFileSizeInBytes = "file-size-in-bytes";
161161
constexpr std::string_view kFileFooterSizeInBytes = "file-footer-size-in-bytes";
162162
constexpr std::string_view kBlobMetadata = "blob-metadata";
163-
constexpr int8_t kMinNullCurrentSnapshotVersion = 3;
164163

165164
template <typename T>
166165
void SetOptionalField(nlohmann::json& json, std::string_view key,
@@ -935,10 +934,8 @@ nlohmann::json ToJson(const TableMetadata& table_metadata) {
935934
return snapshot->snapshot_id == table_metadata.current_snapshot_id;
936935
}) != table_metadata.snapshots.cend()) {
937936
json[kCurrentSnapshotId] = table_metadata.current_snapshot_id;
938-
} else if (table_metadata.format_version >= kMinNullCurrentSnapshotVersion) {
939-
json[kCurrentSnapshotId] = nullptr;
940937
} else {
941-
json[kCurrentSnapshotId] = TableMetadata::kInvalidSnapshotId;
938+
json[kCurrentSnapshotId] = nlohmann::json::value_t::null;
942939
}
943940

944941
if (table_metadata.format_version >= 3) {

0 commit comments

Comments
 (0)