Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7131654
Added logic to merge small files into bins
subkanthi Sep 23, 2026
23e7a52
Fix compilation error in IcebergMetadata
subkanthi Sep 23, 2026
43c15c4
Explicitly specify SecondaryStorages in BinPackRewrite.h
subkanthi Sep 23, 2026
d10fcdd
Fix assert in gtest_bin_pack_rewrite
subkanthi Sep 24, 2026
0357f1f
Link Avro library to unit_tests_dbms so headers can be included in te…
subkanthi Sep 24, 2026
8210314
Merge branch 'antalya-26.6' into iceberg_rewrite_files_compaction
subkanthi Sep 28, 2026
850d3e9
Address PR comments
subkanthi Sep 28, 2026
1e415f2
Merge branch 'iceberg_rewrite_files_compaction' of https://github.com…
subkanthi Sep 28, 2026
03e7d98
Address LLM comments
subkanthi Sep 28, 2026
c4c4578
Address LLM comments
subkanthi Sep 28, 2026
14992f5
fix v3 guard for compaction
subkanthi Sep 28, 2026
ed57643
Fix undefined `CANNOT_WRITE_TO_FILE_BUFFER` error code in Iceberg bin…
subkanthi Sep 29, 2026
9c9df0c
Fix undefined `CANNOT_WRITE_TO_FILE_BUFFER` error code in Iceberg bin…
subkanthi Sep 29, 2026
efb67cd
Merge branch 'iceberg_rewrite_files_compaction' of https://github.com…
subkanthi Sep 29, 2026
277b8d7
Merge branch 'iceberg_rewrite_files_compaction' of https://github.com…
subkanthi Sep 29, 2026
7476ec4
Merge branch 'iceberg_rewrite_files_compaction' of https://github.com…
subkanthi Sep 29, 2026
40c5fc2
Fixed merge conflicts
subkanthi Oct 18, 2026
3606280
Added logic to collect source-id from spec_files in buildBinPackPlan
subkanthi Oct 21, 2026
f0fcbe7
Fix position-delete overwrite check
subkanthi Oct 22, 2026
01c25f9
Merged and refactored BinPackRewrite to split bigger function to smal…
subkanthi Oct 22, 2026
46d6e80
Fixed compiler error
subkanthi Oct 22, 2026
b5206fe
Fix medium defect with hash combiner
subkanthi Oct 22, 2026
7d547c2
Address empty bin must not crash optimize
subkanthi Oct 23, 2026
b1e6fd8
Address review comments
subkanthi Oct 23, 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
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,10 @@ if (ENABLE_TESTS)
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::parquet)
endif()

if (TARGET ch_contrib::avrocpp)
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::avrocpp)
endif()

if (TARGET ch_contrib::silk_fibers)
target_link_libraries(unit_tests_dbms PRIVATE ch_contrib::silk_fibers)
endif()
Expand Down
10 changes: 10 additions & 0 deletions src/Core/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8386,6 +8386,16 @@ Allow to explicitly use 'OPTIMIZE' for iceberg tables.
Minimum number of manifest files required to trigger manifest-only compaction via OPTIMIZE TABLE ... MANIFEST.
If the current number of manifest files is less than or equal to this threshold, compaction is skipped.
Requires allow_experimental_iceberg_compaction to be enabled.
)", EXPERIMENTAL) \
DECLARE(UInt64, iceberg_target_data_file_size_bytes, 536870912, R"(
Target data file size in bytes for Iceberg bin-packing compaction via OPTIMIZE TABLE.
Small files are merged until the result approaches this size. Default is 512 MiB.
Requires allow_experimental_iceberg_compaction to be enabled.
)", EXPERIMENTAL) \
DECLARE(UInt64, iceberg_min_data_file_size_bytes, 402653184, R"(
Data files smaller than this threshold are candidates for bin-packing compaction via OPTIMIZE TABLE.
Default is 384 MiB (75% of iceberg_target_data_file_size_bytes).
Requires allow_experimental_iceberg_compaction to be enabled.
)", EXPERIMENTAL) \
DECLARE(Bool, allow_iceberg_remove_orphan_files, false, R"(
Allow to use 'ALTER TABLE ... EXECUTE remove_orphan_files()' for iceberg tables.
Expand Down
6 changes: 6 additions & 0 deletions src/Core/SettingsChangesHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
/// controls new feature and it's 'true' by default, use 'false' as previous_value).
/// It's used to implement `compatibility` setting (see https://github.com/ClickHouse/ClickHouse/issues/35972)
/// Note: please check if the key already exists to prevent duplicate entries.
addSettingsChanges(settings_changes_history, "26.6.8.20003.altinityantalya",
{
{"iceberg_target_data_file_size_bytes", 536870912, 536870912, "Target file size for Iceberg bin-packing compaction (default 512 MiB)."},
{"iceberg_min_data_file_size_bytes", 402653184, 402653184, "Files below this size are candidates for Iceberg bin-packing compaction (default 384 MiB)."},
});

addSettingsChanges(settings_changes_history, "26.6.4.20001.altinityantalya",
{
{"input_format_parquet_footer_read_size", 65536, 0, "New setting to override the adaptive Parquet footer initial read size with a fixed number of bytes; 0 keeps the adaptive behavior. Before this setting the reader always read a fixed 64 KiB tail."},
Expand Down
20 changes: 16 additions & 4 deletions src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,16 @@ class DataLakeConfiguration : public BaseStorageConfiguration, public std::enabl
#endif
}

bool optimize(ObjectStoragePtr object_storage, const StorageMetadataPtr & metadata_snapshot, ContextPtr context, const std::optional<FormatSettings> & format_settings) override
bool optimize(
ObjectStoragePtr object_storage,
const StorageMetadataPtr & metadata_snapshot,
ContextPtr context,
const std::optional<FormatSettings> & format_settings,
std::shared_ptr<DataLake::ICatalog> catalog,
const StorageID & storage_id) override
{
lazyInitializeIfNeeded(object_storage, context);
return getMetadata()->optimize(metadata_snapshot, context, format_settings);
return getMetadata()->optimize(metadata_snapshot, context, format_settings, catalog, storage_id);
}

void addDeleteTransformers(ObjectInfoPtr object_info, QueryPipelineBuilder & builder, const std::optional<FormatSettings> & format_settings, FormatParserSharedResourcesPtr parser_shared_resources, ContextPtr local_context) const override
Expand Down Expand Up @@ -867,8 +873,14 @@ class StorageIcebergConfiguration : public StorageObjectStorageConfiguration, pu
std::shared_ptr<DataLake::ICatalog> getCatalog(ContextPtr context, const StorageID & table_id) const override
{ return getImpl().getCatalog(context, table_id); }

bool optimize(ObjectStoragePtr object_storage, const StorageMetadataPtr & metadata_snapshot, ContextPtr context, const std::optional<FormatSettings> & format_settings) override
{ return getImpl().optimize(object_storage, metadata_snapshot, context, format_settings); }
bool optimize(
ObjectStoragePtr object_storage,
const StorageMetadataPtr & metadata_snapshot,
ContextPtr context,
const std::optional<FormatSettings> & format_settings,
std::shared_ptr<DataLake::ICatalog> catalog,
const StorageID & storage_id) override
{ return getImpl().optimize(object_storage, metadata_snapshot, context, format_settings, catalog, storage_id); }

bool supportsPrewhere() const override { return getImpl().supportsPrewhere(); }

Expand Down
6 changes: 5 additions & 1 deletion src/Storages/ObjectStorage/DataLakes/IDataLakeMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ class IDataLakeMetadata : boost::noncopyable
}

virtual bool optimize(
const StorageMetadataPtr & /*metadata_snapshot*/, ContextPtr /*context*/, const std::optional<FormatSettings> & /*format_settings*/)
const StorageMetadataPtr & /*metadata_snapshot*/,
ContextPtr /*context*/,
const std::optional<FormatSettings> & /*format_settings*/,
std::shared_ptr<DataLake::ICatalog> /*catalog*/,
const StorageID & /*storage_id*/)
{
return false;
}
Expand Down
Loading
Loading