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 #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
|
# Conflicts: # src/Common/ProfileEvents.cpp # src/Databases/DataLake/ICatalog.cpp # src/Databases/DataLake/RestCatalog.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp
…te node runs them to completion Addresses 2 failing test(s) in Stateless tests (arm_binary, parallel) on #2146. Still-failing set shrank from 2 -> 1. RemoteQueryExecutor marked queries sent by remote()/cluster() table functions with a single shard as INITIAL_QUERY so the remote node can act as an initiator and distribute further (swarm). For intermediate processing stages the remote node returns a header made of internal column identifiers that the initiator matches by name; INITIAL_QUERY enables query tree optimizations there (they are skipped for SECONDARY_QUERY), which rewrote tupleElement(__table1.t, 1) into the subcolumn __table1.`t.1` and broke 04045_merge_function_missing_columns_remote with prefer_localhost_replica=0. Restrict the masquerade to stage == Complete, which is exactly the single-node proxy case the feature needs.
This comment was marked as outdated.
This comment was marked as outdated.
…st, <table function>) Addresses 3 failing test(s) in Integration tests (arm_binary, distributed plan, 3/4) on #2146. Still-failing set shrank from 3 -> 0. Commit 3c7a3ef restricted the 'remote node acts as initiator' masquerade in RemoteQueryExecutor to stage == Complete to fix 04045_merge_function_missing_columns_remote. That also disabled it for the object_storage_remote_initiator flow (remote(host, s3Cluster(...))) whose queries run at an intermediate stage, so the chosen remote initiator handled the query as a plain worker instead of distributing it over the swarm and the tests counted 2 instead of 4 (1 instead of 2) query_log entries. Restore the original condition in RemoteQueryExecutor and instead enable the masquerade only when remote() wraps a table function (table_func_ptr != nullptr), which is exactly the object_storage_remote_initiator case. For remote(host, db, table) - the shape used by 04045_merge_function_missing_columns_remote - the remote node stays a secondary query, so the header of internal column identifiers is not rewritten by query tree optimizations.
…luster in system.tables Addresses 3 failing test(s) in Integration tests (arm_binary, distributed plan, 4/4) on #2146. Still-failing set shrank from 3 -> 0. The cherry-picked 'Expose IcebergS3 partition_key and sorting_key in system.tables' feature looks up the data lake metadata with dynamic_cast<StorageObjectStorage *>. In this branch object storage table engines are instantiated as StorageObjectStorageCluster, which is not derived from StorageObjectStorage, so the cast always failed and system.tables reported empty partition_key/sorting_key for Iceberg tables (test_system_tables_partition_sorting_keys). Handle both storage types via a small helper. The other two failures of the shard (test_remote_initiator, test_writes_multiple_threads) are already fixed by da20658 and pass locally.
This comment was marked as outdated.
This comment was marked as outdated.
… skipping parquet schema conversion The test imported with the upstream reserved-field-id fix expects ICEBERG_SPECIFICATION_VIOLATION for an unmapped non-reserved field id, but the Antalya-only allow_experimental_iceberg_read_optimization (added by this PR, enabled by default) serves the single-row constant column from the manifest statistics, so the data file is never parsed and the check never runs. Disable that optimization in the two SELECTs of the test so it exercises the parquet schema converter as intended. Addresses 2 failing test(s) in Stateless tests (amd_debug, distributed plan, s3 storage, parallel) on #2146. Still-failing set shrank from 2 -> 1 (the other one is an unrelated flake that passes on rerun).
RelEasy
|
|
the only test that is related was fixed. this is a test-only fix (no code changes), so no other code was changed. good to be merged. |
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.