-
Notifications
You must be signed in to change notification settings - Fork 17
Export partition to apache iceberg #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: antalya-26.1
Are you sure you want to change the base?
Changes from all commits
be1fd1d
b82ce39
2687a20
4175e33
d9a27c7
fdf6bf7
bca4aeb
843961c
80753da
fc93f76
abbc77d
57f3a6a
1ee1b34
52a812a
da5b6be
3664749
a878a1e
b5bd0eb
5b0e833
998a992
1aa1b31
f21d66a
26827e2
6c61948
99ce30f
4259ec3
c9dd096
b180a3b
1f73187
2f5643d
6a19f92
569803b
20aa695
c80182c
763dec1
18eb4d0
d9564ac
498ed04
6750617
3e89a7b
c75576a
1cb9321
28b6695
7c2f69b
59f4134
cc850d6
3b12e1e
8143c67
f8bacec
d10e165
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include <base/types.h> | ||
| #include <Common/Exception.h> | ||
| #include <Interpreters/StorageID.h> | ||
| #include <Poco/JSON/Object.h> | ||
| #include <Poco/JSON/Array.h> | ||
|
|
@@ -118,6 +119,8 @@ struct ExportReplicatedMergeTreePartitionManifest | |
| MergeTreePartExportManifest::FileAlreadyExistsPolicy file_already_exists_policy; | ||
| String filename_pattern; | ||
| bool lock_inside_the_task; /// todo temporary | ||
| bool write_full_path_in_iceberg_metadata = false; | ||
| String iceberg_metadata_json; | ||
|
|
||
| std::string toJsonString() const | ||
| { | ||
|
|
@@ -129,7 +132,12 @@ struct ExportReplicatedMergeTreePartitionManifest | |
| json.set("destination_table", destination_table); | ||
| json.set("source_replica", source_replica); | ||
| json.set("number_of_parts", number_of_parts); | ||
|
|
||
|
|
||
| if (!iceberg_metadata_json.empty()) | ||
| { | ||
| json.set("iceberg_metadata_json", iceberg_metadata_json); | ||
| } | ||
|
|
||
| Poco::JSON::Array::Ptr parts_array = new Poco::JSON::Array(); | ||
| for (const auto & part : parts) | ||
| parts_array->add(part); | ||
|
|
@@ -145,6 +153,7 @@ struct ExportReplicatedMergeTreePartitionManifest | |
| json.set("max_retries", max_retries); | ||
| json.set("ttl_seconds", ttl_seconds); | ||
| json.set("lock_inside_the_task", lock_inside_the_task); | ||
| json.set("write_full_path_in_iceberg_metadata", write_full_path_in_iceberg_metadata); | ||
| std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM | ||
| oss.exceptions(std::ios::failbit); | ||
| Poco::JSON::Stringifier::stringify(json, oss); | ||
|
|
@@ -166,6 +175,12 @@ struct ExportReplicatedMergeTreePartitionManifest | |
| manifest.source_replica = json->getValue<String>("source_replica"); | ||
| manifest.number_of_parts = json->getValue<size_t>("number_of_parts"); | ||
| manifest.max_retries = json->getValue<size_t>("max_retries"); | ||
|
|
||
| if (json->has("iceberg_metadata_json")) | ||
| { | ||
| manifest.iceberg_metadata_json = json->getValue<String>("iceberg_metadata_json"); | ||
| } | ||
|
|
||
| auto parts_array = json->getArray("parts"); | ||
| for (size_t i = 0; i < parts_array->size(); ++i) | ||
| manifest.parts.push_back(parts_array->getElement<String>(static_cast<unsigned int>(i))); | ||
|
|
@@ -192,6 +207,8 @@ struct ExportReplicatedMergeTreePartitionManifest | |
|
|
||
| manifest.lock_inside_the_task = json->getValue<bool>("lock_inside_the_task"); | ||
|
|
||
| manifest.write_full_path_in_iceberg_metadata = json->getValue<bool>("write_full_path_in_iceberg_metadata"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Treating Useful? React with 👍 / 👎. |
||
|
|
||
| return manifest; | ||
| } | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.