Antalya 26.6: Partition export + cluster functions - #2146
Conversation
…next commit) --- Original cherry-pick message follows: Merge pull request #1718 from Altinity/feature/antalya-26.3/apassos-3 Antalya 26.3: apassos-3: combined port of 12 PRs # Conflicts: # ci/jobs/scripts/integration_tests_configs.py # contrib/openssl # src/Common/ErrorCodes.cpp # src/Common/FailPoint.cpp # src/Common/ProfileEvents.cpp # src/Common/setThreadName.h # src/Core/Settings.cpp # src/Core/SettingsEnums.cpp # src/Core/SettingsEnums.h # src/Disks/DiskObjectStorage/ObjectStorages/IObjectStorage.h # src/Functions/generateSnowflakeID.cpp # src/Interpreters/DDLWorker.cpp # src/Parsers/ASTAlterQuery.cpp # src/Parsers/ASTSystemQuery.cpp # src/Parsers/ParserAlterQuery.cpp # src/Storages/IPartitionStrategy.cpp # src/Storages/IPartitionStrategy.h # src/Storages/MergeTree/IMergeTreeDataPart.cpp # src/Storages/MergeTree/MergeTreeData.cpp # src/Storages/MergeTree/MergeTreeData.h # src/Storages/ObjectStorage/DataLakes/IDataLakeMetadata.h # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.h # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.h # src/Storages/ObjectStorage/DataLakes/Iceberg/MultipleFileWriter.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/MultipleFileWriter.h # src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp # src/Storages/ObjectStorage/StorageObjectStorage.cpp # src/Storages/ObjectStorage/StorageObjectStorage.h # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp # src/Storages/ObjectStorage/StorageObjectStorageConfiguration.h # src/Storages/ObjectStorage/StorageObjectStorageSink.h # src/Storages/ObjectStorage/StorageObjectStorageSource.cpp # src/Storages/ObjectStorage/StorageObjectStorageSource.h # src/Storages/StorageMergeTree.cpp # src/Storages/StorageReplicatedMergeTree.cpp # src/Storages/StorageReplicatedMergeTree.h # src/Storages/System/StorageSystemMerges.cpp # src/Storages/System/attachSystemTables.cpp # tests/queries/0_stateless/03413_experimental_settings_cannot_be_enabled_by_default.sql # tests/queries/0_stateless/03745_system_background_schedule_pool.reference
Kept antalya-26.6 side for everything outside the source PR's scope and added the PR's new surfaces (export part/partition, list-objects cache, Iceberg export) on top. Adapted: PENDING_MUTATIONS_NOT_ALLOWED moved to error code 1009 (1005-1008 are taken on antalya-26.6) and END bumped accordingly Adapted: MergeTreeData::writePartLog keeps antalya-26.6's projections_duration_ms parameter and appends the PR's exports_entry; ExportPartTask call sites pass the extra argument Adapted: generateManifestFile keeps antalya-26.6's user_defined_sequence_number / per-file row+byte counts and appends the PR's per_file_stats; the export-commit call site boxes data file paths into Iceberg::IcebergPathFromMetadata Adapted: MultipleFileWriter::getDataFileEntries is implemented on antalya-26.6's existing per-file bookkeeping (data_file_names / data_file_row_counts / data_file_byte_counts / completed_file_stats) instead of the PR's duplicate vectors Source-PR: #1718 (#1718)
…next commit) --- Original cherry-pick message follows: Merge pull request #1646 from Altinity/frontport/antalya-26.3/fix_remote_calls 26.3 Antalya port - fixes for s3Cluster distributed calls # Conflicts: # src/Planner/Planner.cpp # src/Processors/QueryPlan/ObjectFilterStep.cpp # src/Processors/QueryPlan/ObjectFilterStep.h # src/Processors/QueryPlan/QueryPlanStepRegistry.cpp # src/Processors/QueryPlan/ReadFromRemote.cpp # src/QueryPipeline/RemoteQueryExecutor.h # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp # tests/integration/test_database_iceberg/test.py # tests/integration/test_s3_cluster/test.py
Kept antalya-26.6's already-present, evolved copies of the pieces this frontport re-adds (ObjectFilterStep, its registry entry, the snapshot-based virtuals list in StorageObjectStorageCluster and test_hive_partitioning in test_s3_cluster), and applied the source PR's genuinely new additions on top: the analyzer-side addObjectFilterStep in Planner.cpp, RemoteQueryExecutor::setRemoteFunction/setShardCount plus their ReadFromRemote call sites, and the new integration tests (test_remote_hedged, test_remote_no_hedged, test_joins, _test_cluster_joins). Context-only lines from the 26.3 source that antalya-26.6 no longer has (duplicated_part_uuids, threading/time/HeaderParseError and FloatType imports) were not re-introduced. SettingsChangesHistory: uncommented the existing object_storage_cluster_join_mode row in place and dropped the cherry-pick's duplicate (which had landed inside an unrelated version block). Source-PR: #1646 (#1646)
…next commit) --- Original cherry-pick message follows: Merge pull request #1640 from Altinity/frontport/antalya-26.3/alternative_syntax 26.3 Antalya port - Alternative syntax for cluster functions # Conflicts: # docs/en/sql-reference/table-functions/iceberg.md # src/Analyzer/FunctionNode.h # src/Common/ErrorCodes.cpp # src/Core/Settings.cpp # src/Databases/DataLake/DatabaseDataLake.cpp # src/Databases/DataLake/DatabaseDataLakeSettings.cpp # src/Databases/DataLake/GlueCatalog.cpp # src/Databases/DataLake/ICatalog.cpp # src/Databases/DataLake/RestCatalog.cpp # src/Databases/DataLake/UnityCatalog.cpp # src/Disks/DiskObjectStorage/ObjectStorages/S3/S3ObjectStorage.cpp # src/IO/S3/URI.cpp # src/IO/S3/URI.h # src/IO/S3/getObjectInfo.cpp # src/Interpreters/IcebergMetadataLog.cpp # src/Parsers/FunctionSecretArgumentsFinder.h # src/Server/TCPHandler.cpp # src/Storages/IStorageCluster.h # src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.h # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/PersistentTableComponents.h # src/Storages/ObjectStorage/DataLakes/Iceberg/SchemaProcessor.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/SchemaProcessor.h # src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp # src/Storages/ObjectStorage/S3/Configuration.cpp # src/Storages/ObjectStorage/StorageObjectStorage.cpp # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp # src/Storages/ObjectStorage/StorageObjectStorageConfiguration.h # src/Storages/ObjectStorage/StorageObjectStorageSource.cpp # src/Storages/ObjectStorage/registerStorageObjectStorage.cpp # src/Storages/System/StorageSystemTables.cpp # src/TableFunctions/TableFunctionObjectStorage.cpp # tests/integration/compose/docker_compose_iceberg_rest_catalog.yml # tests/integration/helpers/iceberg_utils.py # tests/integration/test_database_delta/test.py # tests/integration/test_database_glue/test.py # tests/integration/test_database_iceberg/test.py # tests/integration/test_mask_sensitive_info/test.py # tests/integration/test_s3_cluster/test.py
Removed the conflict markers left by the cherry-pick and kept the source PR's changes, translated to the shapes antalya-26.6 already has (private configuration members behind getters, renamed assertInitializedDL, ContextPtr threaded through IcebergSchemaProcessor, IcebergPathResolver, table UUIDs in DataLake StorageIDs). Source-PR: #1640 (#1640)
…next commit) --- Original cherry-pick message follows: Merge pull request #1741 from Altinity/export_partition_all Export partition all # Conflicts: # src/Common/ErrorCodes.cpp # src/Core/Settings.h
Renumbered the two new error codes (EXPORT_PARTITION_ALREADY_EXPORTED, PARTITION_EXPORT_FAILED) to the next free values on antalya-26.6, which already occupies 1005-1009, and bumped END accordingly. Adapted: error code numbering — antalya-26.6 already uses 1005..1009 (STALE_VERSION..PENDING_MUTATIONS_NOT_ALLOWED), so the PR's 1006/1007 became 1010/1011 and END 1007 became 1011 Source-PR: #1741 (#1741)
…next commit) --- Original cherry-pick message follows: Merge pull request #1728 from Altinity/export_part_respect_background_memory_limit Make export part and partition respect background tasks memory limit # Conflicts: # src/Storages/MergeTree/MergeTreeData.cpp
…next commit) --- Original cherry-pick message follows: Merge pull request #1782 from Altinity/frontport/antalya-26.3/json_part2 Antalya 26.3: Cluster Joins part 2 - global mode # Conflicts: # src/Storages/buildQueryTreeForShard.cpp # src/Storages/buildQueryTreeForShard.h # tests/integration/test_database_iceberg/test.py # tests/integration/test_s3_cluster/test.py
Kept antalya-26.6 additions outside the PR scope (transfer_overflow_mode setting declaration, forward-declared Block for buildShardCollapseFanOut, per-worker generated-data cleanup in test_s3_cluster, disabled _test_cluster_joins in test_database_iceberg) and applied the PR's changes on top; dropped the unchanged test_hive_partitioning context block the merge commit carried into the conflict region. Source-PR: #1782 (#1782)
…next commit) --- Original cherry-pick message follows: Merge pull request #1845 from Altinity/feature/antalya-26.3/no_useless_describe Do not make 'describe table' query when schema is known # Conflicts: # src/TableFunctions/TableFunctionRemote.cpp
…next commit) --- Original cherry-pick message follows: Merge pull request #1863 from Altinity/bugfix/antalya-26.3/1855_s3cluster_hive Fix cluster functions with hive partitioning # Conflicts: # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp # src/Storages/StorageFileCluster.cpp # src/Storages/StorageURLCluster.cpp # tests/integration/test_file_cluster/test.py
Kept antalya-26.6's metadata-snapshot based virtuals plumbing and applied the PR's switch to the filtered hive partition column list. Adapted: IStorageCluster::getHivePartitionColumnsWithoutVirtuals now takes the metadata snapshot, because IStorage::getVirtualsList() no longer exists on antalya-26.6 (virtuals live in StorageInMemoryMetadata::virtuals and are read via metadata->virtuals.getSampleBlock(VirtualsKind::All, VirtualsMaterializationPlace::Reader).getNamesAndTypesList()). Adapted: StorageFileCluster sets virtuals through storage_metadata.setVirtuals() instead of the removed IStorage::setVirtuals(), keeping the PR's new sample_path / PartitionStrategyFactory::StrategyType::NONE arguments. Source-PR: #1863 (#1863)
…next commit) --- Original cherry-pick message follows: Merge pull request #1872 from Altinity/bugfix/antalya-26.3/fix_aggregation_with_remote_initiator Fix aggregation flow with remote initiator # Conflicts: # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp
…next commit) --- Original cherry-pick message follows: Merge pull request #1917 from Altinity/do_not_evict_entries_from_replicated_partition_exports_table Turn system.replicated_partition_exports table into a history table by removing the TTL # Conflicts: # antalya/docs/design/alter-table-export-part-partition.md # src/Core/Settings.cpp
src/Core/Settings.cpp: - Removed the DECLARE of export_merge_tree_partition_manifest_ttl (source PR) while keeping antalya-26.6's export_merge_tree_partition_task_timeout_seconds default of 3600 (the 86400 on "theirs" is unrelated base-branch context). - Added the MAKE_OBSOLETE row for export_merge_tree_partition_manifest_ttl from the source PR, keeping the pre-existing allow_experimental_query_deduplication row that "ours" already had in that append-only list. antalya/docs/design/alter-table-export-part-partition.md does not exist on antalya-26.6 (introduced by the separate design-doc PR #1673, not ported); the cherry-pick recreated the whole 752-line file, of which only ~15 lines belong to #1917. Kept "ours" (file absent) instead of importing another PR's document. Source-PR: #1917 (#1917)
…next commit) --- Original cherry-pick message follows: Merge pull request #1984 from Altinity/export-partition-retry-backoff Partition export per part local backoff policy # Conflicts: # src/Core/Settings.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp
Settings.cpp: kept both obsolete-setting rows (base branch's allow_experimental_query_deduplication and the PR's export_merge_tree_partition_max_retries). IcebergMetadata.cpp: added only the PR's new error codes METADATA_MISMATCH and UNFINISHED; INCORRECT_DATA was context in the source PR's diff and is unused on antalya-26.6, so it was not imported. Source-PR: #1984 (#1984)
# Conflicts: # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.h # tests/integration/test_database_iceberg/test.py
# Conflicts: # docs/en/engines/database-engines/datalake.md # src/Common/ProfileEvents.cpp # src/Core/Settings.cpp # src/Parsers/FunctionSecretArgumentsFinder.h # src/Storages/ObjectStorage/DataLakes/Common/AvroForIcebergDeserializer.cpp # src/Storages/ObjectStorage/DataLakes/IDataLakeMetadata.h # src/Storages/ObjectStorage/DataLakes/Iceberg/SchemaProcessor.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/tests/gtest_iceberg_schema_processor.cpp # src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp # src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp # src/Storages/ObjectStorage/StorageObjectStorageSource.cpp # src/Storages/ObjectStorage/registerStorageObjectStorage.cpp # src/Storages/StorageFileCluster.cpp # src/Storages/StorageURLCluster.cpp # tests/integration/test_s3_cluster/test.py # tests/queries/0_stateless/03413_experimental_settings_cannot_be_enabled_by_default.sql
… new Antalya settings in the changes history The merge pushed ASTSystemQuery::Type past 127 values, so magic_enum silently dropped RESET_DDL_WORKER and SYSTEM RESET DDL WORKER became unparsable; and three Antalya settings were missing from SettingsChangesHistory.cpp. Addresses 2 failing test(s) in Fast test on #2146. Still-failing set shrank from 2 -> 0.
RelEasy
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add support for exporting MergeTree parts and partitions to object storage, including experimental exports to Apache Iceberg, with a command to schedule exports for all partitions at once, automatic type casting as in INSERT ... SELECT, retries with backoff for transient failures, and a persistent history of export tasks in system.replicated_partition_exports. Add alternative syntax for cluster table functions with distributed execution of JOINs on swarm nodes, and speed up object storage queries through caching of S3 ListObjects calls and pre-aggregation on remote nodes.
Add support for exporting MergeTree parts and partitions to object storage, including experimental exports to Apache Iceberg, with a command to schedule exports for all partitions at once, automatic type casting as in INSERT ... SELECT, retries with backoff for transient failures, and a persistent history of export tasks in system.replicated_partition_exports. Add alternative syntax for cluster table functions with distributed execution of JOINs on swarm nodes, and speed up object storage queries through caching of S3 ListObjects calls and pre-aggregation on remote nodes (#1718 by @zvonand, #1646 by @ianton-ru, #1640 by @ianton-ru, #1744 by @zvonand, #1713 by @arthurpassos, #1783 by @ianton-ru, #1741 by @arthurpassos, #1728 by @arthurpassos, #1730 by @arthurpassos, #1813 by @arthurpassos, #1836 by @arthurpassos, #1847 by @arthurpassos, #1782 by @ianton-ru, #1845 by @ianton-ru, #1856 by @ianton-ru, #1863 by @ianton-ru, #1872 by @ianton-ru, #1917 by @arthurpassos, #1779 by @arthurpassos, #1912 by @arthurpassos, #1990 by @arthurpassos, #2004 by @arthurpassos, #1984 by @arthurpassos).
CI/CD Options
Exclude tests:
Regression jobs to run:
Combined port of 23 PR(s) (group
auto-grp-pr-1718). Cherry-picked from #1718, #1646, #1640, #1744, #1713, #1783, #1741, #1728, #1730, #1813, #1836, #1847, #1782, #1845, #1856, #1863, #1872, #1917, #1779, #1912, #1990, #2004, #1984.