Skip to content

Add support for SQL-defined named collections in BACKUP/RESTORE#94605

Merged
pamarcos merged 3 commits intoClickHouse:masterfrom
pamarcos:add-sql-named-collections-to-backup
Jan 21, 2026
Merged

Add support for SQL-defined named collections in BACKUP/RESTORE#94605
pamarcos merged 3 commits intoClickHouse:masterfrom
pamarcos:add-sql-named-collections-to-backup

Conversation

@pamarcos
Copy link
Member

@pamarcos pamarcos commented Jan 19, 2026

Add support for SQL-defined named collections in BACKUP/RESTORE for S3 and Azure Blob Storage

  • Add BackupInfo::getNamedCollection to consolidate named collection loading, access checking, and key-value override handling for both S3 and Azure backup engines.
  • Call NamedCollectionFactory::instance().loadIfNot() to load SQL-defined collections before lookup.
  • Refactor Azure backup to reuse getAzureConnectionParams instead of duplicating connection logic.
  • Add integration tests for SQL-defined named collections (with and without key-value overrides) for both S3 and Azure.

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add support for SQL-defined named collections in BACKUP/RESTORE for S3 and Azure Blob Storage. Closes #94604

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

…3 and AzureBlobStorage

- Add BackupInfo::getNamedCollection to consolidate named collection loading, access checking,
  and key-value override handling for both S3 and Azure backup engines.
- Call NamedCollectionFactory::instance().loadIfNot() to load SQL-defined collections before lookup.
- Refactor Azure backup to reuse getAzureConnectionParams instead of duplicating connection logic.
- Add integration tests for SQL-defined named collections (with and without key-value overrides)
  for both S3 and Azure.
@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Jan 19, 2026

Workflow [PR], commit [a51c785]

Summary:

job_name test_name status info comment
Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel) failure
03514_grace_hash_join_logical_error FAIL cidb, issue ISSUE CREATED
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting: the query: (STID: 1941-1bfa) FAIL cidb, issue ISSUE EXISTS

@clickhouse-gh clickhouse-gh bot added the pr-feature Pull request with new product feature label Jan 19, 2026
@pamarcos pamarcos requested a review from Copilot January 19, 2026 16:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for SQL-defined named collections in BACKUP/RESTORE operations for S3 and Azure Blob Storage, addressing issue #94604. Previously, only XML-configured named collections were supported.

Changes:

  • Introduced BackupInfo::getNamedCollection() to centralize named collection loading, access checking, and key-value override handling
  • Refactored S3 and Azure backup engines to use the new unified approach instead of directly reading from config
  • Added integration tests verifying SQL-defined named collections work with and without parameter overrides

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Backups/BackupInfo.h Added kv_args field and getNamedCollection() method declaration
src/Backups/BackupInfo.cpp Implemented getNamedCollection() with collection loading, access checks, and override support
src/Backups/registerBackupEngineS3.cpp Refactored to use getNamedCollection() instead of direct config access
src/Backups/registerBackupEngineAzureBlobStorage.cpp Refactored to use getNamedCollection() and getAzureConnectionParams()
src/Storages/ObjectStorage/Azure/Configuration.h Exported getAzureConnectionParams() for reuse in backup engine
src/Storages/ObjectStorage/Azure/Configuration.cpp Changed getConnectionParams() to getAzureConnectionParams() with public visibility
tests/integration/test_backup_restore_s3/test.py Added tests for SQL-defined named collections with and without overrides
tests/integration/test_backup_restore_azure_blob_storage/test.py Added tests for SQL-defined named collections with and without overrides; removed unused imports

@kssenii kssenii self-assigned this Jan 19, 2026
@pamarcos pamarcos marked this pull request as ready for review January 19, 2026 17:31
@pamarcos pamarcos added pr-improvement Pull request with some product improvements and removed pr-feature Pull request with new product feature labels Jan 20, 2026
@pamarcos pamarcos added this pull request to the merge queue Jan 21, 2026
Merged via the queue into ClickHouse:master with commit 4227b39 Jan 21, 2026
190 of 260 checks passed
@pamarcos pamarcos deleted the add-sql-named-collections-to-backup branch January 21, 2026 10:43
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 21, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jan 21, 2026
robot-ch-test-poll4 added a commit that referenced this pull request Jan 21, 2026
Cherry pick #94605 to 25.12: Add support for SQL-defined named collections in BACKUP/RESTORE
robot-clickhouse added a commit that referenced this pull request Jan 21, 2026
pamarcos added a commit that referenced this pull request Jan 21, 2026
Cherry pick #94605 to 25.8: Add support for SQL-defined named collections in BACKUP/RESTORE
pamarcos added a commit that referenced this pull request Jan 21, 2026
Cherry pick #94605 to 25.10: Add support for SQL-defined named collections in BACKUP/RESTORE
pamarcos added a commit that referenced this pull request Jan 21, 2026
Cherry pick #94605 to 25.11: Add support for SQL-defined named collections in BACKUP/RESTORE
robot-clickhouse added a commit that referenced this pull request Jan 21, 2026
robot-clickhouse added a commit that referenced this pull request Jan 21, 2026
robot-clickhouse added a commit that referenced this pull request Jan 21, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jan 21, 2026
pamarcos added a commit that referenced this pull request Jan 22, 2026
Backport #94605 to 25.10: Add support for SQL-defined named collections in BACKUP/RESTORE
pamarcos added a commit that referenced this pull request Jan 22, 2026
Backport #94605 to 25.11: Add support for SQL-defined named collections in BACKUP/RESTORE
pamarcos added a commit that referenced this pull request Jan 22, 2026
Backport #94605 to 25.12: Add support for SQL-defined named collections in BACKUP/RESTORE
pamarcos added a commit that referenced this pull request Jan 22, 2026
Backport #94605 to 25.8: Add support for SQL-defined named collections in BACKUP/RESTORE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-improvement Pull request with some product improvements pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v25.8-must-backport v25.10-must-backport v25.11-must-backport v25.12-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BACKUP doesn't work with SQL-defined named collections

5 participants