Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
3662a9b
Merge branch 'antalya-26.3' into feature/iceberg-truncate-26.3
il9ue May 4, 2026
ee0f215
Merge pull request #1474 from Altinity/fix/antalya-26.1/delta-lake-test
zvonand Mar 4, 2026
b9809c6
Cherry-pick of https://github.com/Altinity/ClickHouse/pull/1631 with …
zvonand Apr 27, 2026
88c12d7
Resolve conflicts in cherry-pick of #1631
zvonand May 7, 2026
e277d0e
implement export partition all
arthurpassos May 6, 2026
ed9ef41
Delete tests/queries/0_stateless/03609_export_merge_tree_partition_al…
arthurpassos May 7, 2026
4a24375
Delete tests/queries/0_stateless/03609_export_merge_tree_partition_al…
arthurpassos May 7, 2026
2681daa
Update Settings.cpp
arthurpassos May 7, 2026
7845271
improve observability over exceptions
arthurpassos May 5, 2026
3120261
respect memory limit
arthurpassos May 4, 2026
779b1d8
remove lock inside the task export partition
arthurpassos Apr 30, 2026
be9859a
Iceberg type 'time' support
ianton-ru Mar 18, 2026
4aea94f
Fix tests
ianton-ru Mar 19, 2026
c776a9d
Fix
ianton-ru Mar 19, 2026
95768ac
Fix test
ianton-ru Apr 2, 2026
6a7922d
Write time to Iceberg
ianton-ru Apr 8, 2026
bf357d2
Proper write metadata to Avro
ianton-ru Apr 10, 2026
c5c9ea7
Small fixes
ianton-ru May 5, 2026
2ad3977
Fixes, AI assist (Cursor + ChatGPT 5.5)
ianton-ru May 5, 2026
6d579a4
Merge branch 'antalya-26.3' into export_partition_remove_lock_in_task
zvonand May 8, 2026
ac9e453
Merge branch 'antalya-26.3' into feature/antalya-26.3/pr-1631
zvonand May 8, 2026
10edb80
Merge pull request #102628 from groeneai/fix-parquet-reader-null-check
Avogar Apr 20, 2026
9291dc3
Merge pull request #99935 from alesapin/fix_weird_pathes_in_iceberg
alesapin Apr 8, 2026
96d81f0
Merge pull request #99521 from ivanmantova/feature/arrow-parquet-uuid
alexey-milovidov Mar 19, 2026
1441f6a
Merge pull request #100150 from ivanmantova/fix-arrow-parquet-builder
alexey-milovidov Mar 20, 2026
edcf20c
Merge pull request #100645 from ClickHouse/divanik/add_bytes_and_rows…
divanik Apr 7, 2026
79711c8
fix gtest to use string instead of IcebergPath
mkmkme May 9, 2026
20f7fab
Added test cases for s3 encoding fix
subkanthi May 11, 2026
c7fa981
fix the vN-<uuid>.metadata.json regression in getMetadataFileAndVersion
mkmkme May 12, 2026
432f4dc
Fix stuck 'cluster_name_in_settings'
ianton-ru May 12, 2026
e03cd8e
Fix object_storage_remote_initiator+object_storage_cluster_join_mode=…
ianton-ru May 12, 2026
8a1e9a3
Merge branch 'antalya-26.3' into export_part_respect_background_memor…
zvonand May 12, 2026
392163e
Merge branch 'antalya-26.3' into export_partition_refactor_exceptions…
zvonand May 12, 2026
9563398
Merge branch 'antalya-26.3' into export_partition_all
zvonand May 12, 2026
8caab1b
Fix conditional check for Parquet file format
arthurpassos May 13, 2026
40e329c
Merge branch 'antalya-26.3' into feature/antalya-26.3/pr-1631
ianton-ru May 13, 2026
f79c8c7
Merge branch 'antalya-26.3' into 1338_fix_3_decoding_antaly_26_3
subkanthi May 13, 2026
4bdd9dc
Merge branch 'antalya-26.3' into feature/iceberg-truncate-26.3
CarlosFelipeOR May 14, 2026
20dad73
Hybrid: added support for segment pruning
mkmkme May 14, 2026
06905aa
hybrid: added system.hybrid_watermarks to inspect the Hybrid table
mkmkme Apr 22, 2026
4a31253
try to fix fasttest
arthurpassos May 14, 2026
f7fc0c5
Merge branch 'antalya-26.3' into 1338_fix_3_decoding_antaly_26_3
subkanthi May 14, 2026
deb4e77
cross out all coverage suite fails
strtgbb May 11, 2026
2d2caf5
Regression tests: use release branch instead of commit hash
CarlosFelipeOR May 5, 2026
895fb8d
Fixed alter table operations(add, modify, drop, rename) for iceberg
subkanthi May 14, 2026
d29aec8
Fixed alter table operations(add, modify, drop, rename) for iceberg
subkanthi May 14, 2026
e829313
docs: explain how to get human-readable group names from entra
zvonand May 15, 2026
fdcb33b
doc: drop unnecessarily deep technical details
mkmkme May 15, 2026
14880ba
system.hybrid_watermarks: drop sorting, improve comments a bit
mkmkme May 15, 2026
d59077f
StorageDistributed: fix the comment (has_missing_objects -> build_log…
mkmkme May 15, 2026
0c0d328
StorageDistributed: replace getAll() with getAllPhysical()
mkmkme May 15, 2026
1449fe7
add RFC 7662 token introspection to the openid processor
zvonand May 15, 2026
105460d
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/100334 w…
scanhex12 Apr 8, 2026
ac0e84b
Resolve conflicts in cherry-pick of #100334
zvonand May 15, 2026
8ebf38b
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/102825 w…
grantholly-clickhouse Apr 17, 2026
0045a22
Resolve conflicts in cherry-pick of #102825
zvonand May 15, 2026
01237cf
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/102115 w…
scanhex12 May 7, 2026
c783d78
Resolve conflicts in cherry-pick of #102115
zvonand May 15, 2026
b94cc0c
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/104251 w…
alexey-milovidov May 7, 2026
72c10ea
Resolve conflicts in cherry-pick of #104251
zvonand May 15, 2026
94fb179
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/96802 wi…
zvonand May 12, 2026
dd79c20
Resolve conflicts in cherry-pick of #96802
zvonand May 15, 2026
57b0578
Merge branch 'antalya-26.3' into antalya_26_3_fix_alter_table_iceberg
subkanthi May 16, 2026
b69a888
Fix CI: do not call getCatalog with _table_function StorageID
zvonand May 17, 2026
e9c25e1
Merge pull request #1655 from Altinity/feature/iceberg-truncate-26.3
zvonand May 18, 2026
a0e4fdd
Merge pull request #1751 from Altinity/feature/antalya-26.3/pr-1631
zvonand May 18, 2026
3023406
Merge pull request #1769 from Altinity/backports/antalya-26.3/99935
zvonand May 18, 2026
4c22ccc
Merge pull request #1781 from Altinity/1338_fix_3_decoding_antaly_26_3
zvonand May 18, 2026
7e36979
Merge pull request #1788 from Altinity/mkmkme/antalya-26.3/hybrid-seg…
zvonand May 18, 2026
5ff45f0
Merge pull request #1789 from Altinity/mkmkme/antalya-26.3/hybrid-sys…
zvonand May 18, 2026
245c8e9
Merge pull request #1768 from Altinity/backports/antalya-26.3/102628
zvonand May 18, 2026
9b3b3bb
Merge pull request #1713 from Altinity/export_partition_remove_lock_i…
zvonand May 18, 2026
ba52e08
Merge pull request #1742 from Altinity/feature/antalya-26.3/pr-1474
zvonand May 18, 2026
a8f89a9
Merge pull request #1776 from Altinity/backports/antalya-26.3/100645
zvonand May 18, 2026
6269508
Merge pull request #1783 from Altinity/bugfix/antalya-26.3/frontports…
zvonand May 18, 2026
c93cae6
Fix tsan lock-order-inversion between TokenAccessStorage and AccessCh…
zvonand May 18, 2026
1398388
Merge pull request #1804 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 18, 2026
c794675
Merge pull request #1803 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 18, 2026
f8f931a
Merge pull request #1807 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 18, 2026
dafc225
Merge pull request #1806 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 18, 2026
5ff8096
Cherry-pick of https://github.com/ClickHouse/ClickHouse/pull/101272 w…
nihalzp Apr 15, 2026
32ec2c8
Resolve conflicts in cherry-pick of #101272
zvonand May 15, 2026
ecf46b0
Fix CI: support `Nullable(Tuple)` in `MsgPackRowInputFormat`
zvonand May 17, 2026
b239458
Merge branch 'antalya-26.3' into feature/antalya-26.3/ClickHouse-Clic…
zvonand May 18, 2026
cea8a2d
Merge pull request #1800 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 18, 2026
9466e61
Merge remote-tracking branch 'origin/antalya-26.3' into backports/ant…
mkmkme May 19, 2026
99ad855
Fix CI: support `Nullable(Tuple)` in `CHColumnToArrowColumn`
zvonand May 19, 2026
c1be814
Fix CI: support `Nullable(Tuple())` CSV roundtrip
zvonand May 19, 2026
7d8b25b
Merge branch 'antalya-26.3' into export_partition_all
arthurpassos May 19, 2026
0d80166
Merge branch 'antalya-26.3' into export_partition_refactor_exceptions…
arthurpassos May 19, 2026
4c6d918
fix SourceUpload job running when it shouldn't
strtgbb May 20, 2026
1769069
same patch for finish jobs
strtgbb May 20, 2026
e9155e7
fix fast_test in community workflow
strtgbb May 20, 2026
ae81ad2
don't created Targeter in community PR
strtgbb May 20, 2026
da39b8b
Merge pull request #1799 from Altinity/improvement/antalya-26.3/oauth…
zvonand May 21, 2026
836cc39
Merge pull request #1802 from Altinity/feature/antalya-26.3/ClickHous…
zvonand May 21, 2026
1e00b9c
Merge pull request #1741 from Altinity/export_partition_all
zvonand May 21, 2026
14640b5
Merge pull request #1728 from Altinity/export_part_respect_background…
zvonand May 21, 2026
48c56a0
Merge pull request #1761 from Altinity/bugfix/antalya-26.3/1535_time_…
zvonand May 21, 2026
4ac89c1
Merge pull request #1774 from Altinity/backports/antalya-26.3/99521
zvonand May 21, 2026
5ac2165
Merge branch 'antalya-26.3' into export_partition_refactor_exceptions…
arthurpassos May 21, 2026
29aae14
update broken_tests.yaml
strtgbb May 21, 2026
54c8df3
Merge pull request #1816 from strtgbb/fix_red_pr_wf_ext_contributor
strtgbb May 22, 2026
8524639
Merge pull request #1730 from Altinity/export_partition_refactor_exce…
zvonand May 22, 2026
478570f
remove personal cursor rule
strtgbb May 25, 2026
9ffbacf
Update md files for new main branch
strtgbb Apr 1, 2026
a799ae1
import sign_and_release.yml from 26.1
strtgbb May 25, 2026
6445986
Address audit report fixes
subkanthi May 26, 2026
53f6ed5
Merge branch 'antalya_26_3_fix_alter_table_iceberg' of https://github…
subkanthi May 26, 2026
503f9e4
Merge conflicts
subkanthi May 26, 2026
cb0fc35
Merge pull request #1834 from Altinity/move-docs-26.3
strtgbb May 26, 2026
52fb56c
Merge branch 'antalya-26.3' into antalya_26_3_fix_alter_table_iceberg
subkanthi May 26, 2026
2bf4158
Merge branch 'antalya-26.3' into antalya_26_3_fix_alter_table_iceberg
subkanthi May 26, 2026
373da96
Fixed compilation error
subkanthi May 26, 2026
5cacdbd
Fixed compilation error
subkanthi May 26, 2026
7a101c1
Merge branch 'antalya_26_3_fix_alter_table_iceberg' of https://github…
subkanthi May 26, 2026
a2ca771
Merge branch 'antalya_26_3_fix_alter_table_iceberg' of https://github…
subkanthi May 26, 2026
77bfd3d
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
8e8f4bc
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
b8e6a18
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
5163868
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
04148e8
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
ffd21db
DCO remediation commit for Kanthi Subramanian <subkanthi@gmail.com>
subkanthi May 26, 2026
08be5b6
Merge branch 'antalya_26_3_fix_alter_table_iceberg' of https://github…
subkanthi May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static struct InitFiu
ONCE(iceberg_writes_cleanup) \
ONCE(iceberg_writes_non_retry_cleanup) \
ONCE(iceberg_writes_post_publish_throw) \
ONCE(iceberg_alter_catalog_update_metadata_fail) \
ONCE(iceberg_export_after_commit_before_zk_completed) \
REGULAR(export_partition_commit_always_throw) \
ONCE(export_partition_status_change_throw) \
Expand Down
201 changes: 151 additions & 50 deletions src/Databases/DataLake/RestCatalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Poco/JSON/Stringifier.h>
#include <Poco/Net/HTTPRequest.h>
#include <Common/Exception.h>
#include <Common/FailPoint.h>
#include <Common/logger_useful.h>
#include <Common/setThreadName.h>
#include <Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.h>
Expand Down Expand Up @@ -31,6 +32,7 @@
#include <Interpreters/Context.h>
#include <filesystem>

#include <Storages/ObjectStorage/DataLakes/Iceberg/Constant.h>
#include <Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.h>
#include <Server/HTTP/HTMLForm.h>
#include <Formats/FormatFactory.h>
Expand All @@ -44,6 +46,8 @@
#include <Poco/Net/SSLManager.h>
#include <Poco/StreamCopier.h>

#include <sstream>


namespace DB::ErrorCodes
{
Expand All @@ -53,6 +57,11 @@ namespace DB::ErrorCodes
extern const int CATALOG_NAMESPACE_DISABLED;
}

namespace DB::FailPoints
{
extern const char iceberg_alter_catalog_update_metadata_fail[];
}

namespace DataLake
{

Expand Down Expand Up @@ -118,6 +127,139 @@ String encodeNamespaceForURI(const String & namespace_name)

}

namespace
{
Poco::JSON::Object::Ptr cloneJsonObject(const Poco::JSON::Object::Ptr & obj)
{
std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
obj->stringify(oss);

Poco::JSON::Parser parser;
return parser.parse(oss.str()).extract<Poco::JSON::Object::Ptr>();
}
}

Poco::JSON::Object::Ptr buildUpdateMetadataRequestBody(
const String & namespace_name, const String & table_name, Poco::JSON::Object::Ptr new_snapshot)
{
if (!new_snapshot)
return nullptr;

Poco::JSON::Object::Ptr request_body = new Poco::JSON::Object;
{
Poco::JSON::Object::Ptr identifier = new Poco::JSON::Object;
identifier->set("name", table_name);
Poco::JSON::Array::Ptr namespaces = new Poco::JSON::Array;
namespaces->add(namespace_name);
identifier->set("namespace", namespaces);

request_body->set("identifier", identifier);
}

// Schema-change commit path (ALTER TABLE add/drop/modify/rename column).
if (new_snapshot->has(DB::Iceberg::f_schemas))
{
if (!new_snapshot->has(DB::Iceberg::f_current_schema_id))
throw DB::Exception(
DB::ErrorCodes::DATALAKE_DATABASE_ERROR,
"Iceberg update-metadata for {}.{} is missing '{}' field",
namespace_name, table_name, DB::Iceberg::f_current_schema_id);

const Int32 new_schema_id = new_snapshot->getValue<Int32>(DB::Iceberg::f_current_schema_id);
const Int32 old_schema_id = new_schema_id - 1;

Poco::JSON::Object::Ptr new_schema_obj;
auto schemas = new_snapshot->getArray(DB::Iceberg::f_schemas);
for (UInt32 i = 0; i < schemas->size(); ++i)
{
auto s = schemas->getObject(i);
if (s->getValue<Int32>(DB::Iceberg::f_schema_id) == new_schema_id)
{
new_schema_obj = s;
break;
}
}
if (!new_schema_obj)
throw DB::Exception(
DB::ErrorCodes::DATALAKE_DATABASE_ERROR,
"Iceberg update-metadata for {}.{}: no schema object matching current-schema-id={}",
namespace_name, table_name, new_schema_id);

Poco::JSON::Object::Ptr schema_for_rest = cloneJsonObject(new_schema_obj);
if (!schema_for_rest->has("identifier-field-ids"))
{
Poco::JSON::Array::Ptr empty_identifier_field_ids = new Poco::JSON::Array;
schema_for_rest->set("identifier-field-ids", empty_identifier_field_ids);
}

if (old_schema_id >= 0)
{
Poco::JSON::Object::Ptr requirement = new Poco::JSON::Object;
requirement->set("type", "assert-current-schema-id");
requirement->set("current-schema-id", old_schema_id);

Poco::JSON::Array::Ptr requirements = new Poco::JSON::Array;
requirements->add(requirement);
request_body->set("requirements", requirements);
}

Poco::JSON::Array::Ptr updates = new Poco::JSON::Array;
{
Poco::JSON::Object::Ptr add_schema = new Poco::JSON::Object;
add_schema->set("action", "add-schema");
add_schema->set("schema", schema_for_rest);
if (new_snapshot->has(DB::Iceberg::f_last_column_id))
add_schema->set("last-column-id", new_snapshot->getValue<Int32>(DB::Iceberg::f_last_column_id));
updates->add(add_schema);
}
{
Poco::JSON::Object::Ptr set_current_schema = new Poco::JSON::Object;
set_current_schema->set("action", "set-current-schema");
set_current_schema->set("schema-id", new_schema_id);
updates->add(set_current_schema);
}
request_body->set("updates", updates);
}
else
{
// Snapshot-append commit path (INSERT / position-delete mutation).
if (new_snapshot->has("parent-snapshot-id"))
{
auto parent_snapshot_id = new_snapshot->getValue<Int64>("parent-snapshot-id");
if (parent_snapshot_id != -1)
{
Poco::JSON::Object::Ptr requirement = new Poco::JSON::Object;
requirement->set("type", "assert-ref-snapshot-id");
requirement->set("ref", "main");
requirement->set("snapshot-id", parent_snapshot_id);

Poco::JSON::Array::Ptr requirements = new Poco::JSON::Array;
requirements->add(requirement);
request_body->set("requirements", requirements);
}
}

Poco::JSON::Array::Ptr updates = new Poco::JSON::Array;
{
Poco::JSON::Object::Ptr add_snapshot = new Poco::JSON::Object;
add_snapshot->set("action", "add-snapshot");
add_snapshot->set("snapshot", new_snapshot);
updates->add(add_snapshot);
}
{
Poco::JSON::Object::Ptr set_snapshot = new Poco::JSON::Object;
set_snapshot->set("action", "set-snapshot-ref");
set_snapshot->set("ref-name", "main");
set_snapshot->set("type", "branch");
set_snapshot->set("snapshot-id", new_snapshot->getValue<Int64>("snapshot-id"));
updates->add(set_snapshot);
}
request_body->set("updates", updates);
}

return request_body;
}

std::string RestCatalog::Config::toString() const
{
DB::WriteBufferFromOwnString wb;
Expand Down Expand Up @@ -1086,64 +1228,23 @@ void RestCatalog::createTable(const String & namespace_name, const String & tabl

bool RestCatalog::updateMetadata(const String & namespace_name, const String & table_name, const String & /*new_metadata_path*/, Poco::JSON::Object::Ptr new_snapshot) const
{
const std::string endpoint = fmt::format("{}/namespaces/{}/tables/{}", base_url, namespace_name, table_name);

Poco::JSON::Object::Ptr request_body = new Poco::JSON::Object;
{
Poco::JSON::Object::Ptr identifier = new Poco::JSON::Object;
identifier->set("name", table_name);
Poco::JSON::Array::Ptr namespaces = new Poco::JSON::Array;
namespaces->add(namespace_name);
identifier->set("namespace", namespaces);

request_body->set("identifier", identifier);
}
fiu_do_on(DB::FailPoints::iceberg_alter_catalog_update_metadata_fail, { return false; });

if (new_snapshot->has("parent-snapshot-id"))
{
auto parent_snapshot_id = new_snapshot->getValue<Int64>("parent-snapshot-id");
if (parent_snapshot_id != -1)
{
Poco::JSON::Object::Ptr requirement = new Poco::JSON::Object;
requirement->set("type", "assert-ref-snapshot-id");
requirement->set("ref", "main");
requirement->set("snapshot-id", parent_snapshot_id);

Poco::JSON::Array::Ptr requirements = new Poco::JSON::Array;
requirements->add(requirement);

request_body->set("requirements", requirements);
}
}

{
Poco::JSON::Array::Ptr updates = new Poco::JSON::Array;

{
Poco::JSON::Object::Ptr add_snapshot = new Poco::JSON::Object;
add_snapshot->set("action", "add-snapshot");
add_snapshot->set("snapshot", new_snapshot);
updates->add(add_snapshot);
}

{
Poco::JSON::Object::Ptr set_snapshot = new Poco::JSON::Object;
set_snapshot->set("action", "set-snapshot-ref");
set_snapshot->set("ref-name", "main");
set_snapshot->set("type", "branch");
set_snapshot->set("snapshot-id", new_snapshot->getValue<Int64>("snapshot-id"));
const std::string endpoint = fmt::format("{}/namespaces/{}/tables/{}", base_url, namespace_name, table_name);

updates->add(set_snapshot);
}
request_body->set("updates", updates);
}
// Throws DB::Exception(DATALAKE_DATABASE_ERROR) on malformed metadata (programming error).
auto request_body = buildUpdateMetadataRequestBody(namespace_name, table_name, new_snapshot);
if (!request_body)
return true; // nothing to commit

try
{
sendRequest(endpoint, request_body);
}
catch (const DB::HTTPException &)
catch (const DB::HTTPException & ex)
{
LOG_WARNING(log, "Iceberg REST updateMetadata for {}.{} failed: {}",
namespace_name, table_name, ex.displayText());
return false;
}
return true;
Expand Down
10 changes: 10 additions & 0 deletions src/Databases/DataLake/RestCatalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ struct AccessToken
}
};

/// Builds the JSON body for `POST .../namespaces/{ns}/tables/{table}` (Iceberg REST update).
///
/// Returns `nullptr` when `new_snapshot` is null (nothing to commit). Throws
/// `DB::Exception(DATALAKE_DATABASE_ERROR)` with a specific message when the metadata
/// blob is malformed (e.g. missing `current-schema-id`, no schema object matching it).
Poco::JSON::Object::Ptr buildUpdateMetadataRequestBody(
const String & namespace_name,
const String & table_name,
Poco::JSON::Object::Ptr new_snapshot);

class RestCatalog : public ICatalog, public DB::WithContext
{
public:
Expand Down
Loading
Loading