forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redpanda-data#21574 from andrwng/iceberg-manifest-…
…avro iceberg: implement manifest serialization
- Loading branch information
Showing
15 changed files
with
879 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2024 Redpanda Data, Inc. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.md | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0 | ||
#pragma once | ||
|
||
#include "container/fragmented_vector.h" | ||
#include "iceberg/manifest_entry.h" | ||
#include "iceberg/partition.h" | ||
#include "iceberg/schema.h" | ||
|
||
namespace iceberg { | ||
|
||
enum class format_version : uint8_t { | ||
v1, | ||
v2, | ||
}; | ||
|
||
enum class manifest_content_type { | ||
data, | ||
deletes, | ||
}; | ||
|
||
struct manifest_metadata { | ||
schema schema; | ||
partition_spec partition_spec; | ||
format_version format_version; | ||
manifest_content_type manifest_content_type; | ||
|
||
friend bool operator==(const manifest_metadata&, const manifest_metadata&) | ||
= default; | ||
}; | ||
|
||
struct manifest { | ||
manifest_metadata metadata; | ||
|
||
// TODO: the manifest_entry is code-generated with avrogencpp, which is | ||
// restrictive for a few reasons: | ||
// - there is no built-in comparator | ||
// - comparators are difficult to implement since the generated code makes | ||
// heavy use of std::any in Avro union types | ||
// - the manifest_entry r102 (partition) field is incomplete, as it depends | ||
// on runtime partitioning and can't be statically generated | ||
// Rather than using these generated structs, write explicit structs to | ||
// represent the entries, and only use the Avro structs for serialization. | ||
chunked_vector<manifest_entry> entries; | ||
}; | ||
|
||
} // namespace iceberg |
Oops, something went wrong.