AgentSkillsCN

export-partition

在S3测试套件中运行导出分区测试。当用户希望运行导出分区测试、测试ALTER TABLE EXPORT PARTITION ID功能,或测试将MergeTree分区导出至S3时,可使用此功能。

SKILL.md
--- frontmatter
name: export-partition
description: Run export partition tests in the s3 test suite. Use when the user wants to run export partition tests, test ALTER TABLE EXPORT PARTITION ID functionality, or test exporting MergeTree partitions to S3.

Export Partition Test Suite

Run tests for the ALTER TABLE ... EXPORT PARTITION ID ... TO TABLE feature, which exports MergeTree partitions from local or replicated tables to S3 (or other destination) storage.

Working Directory

All commands must be run from the s3 directory:

code
cd clickhouse-regression/s3

Command Format

bash
./regression.py --storage minio --clickhouse <URL> --only "<test-path>"

Required Options

  • --clickhouse <URL> - URL to ClickHouse package (user must provide)
  • --storage minio - Storage backend to use
  • --only "<test-path>" - Test path pattern (must end with * to run all subtests)

Optional Options

  • -l test.log - Save test logs to a file

Test Path Structure

code
/s3/minio/export tests/export partition/<feature>/*

The * wildcard is required to run all scenarios under a feature.

Available Features

FeatureDescription
sanityBasic functionality (export setting, mismatched columns, schema compatibility)
error handlingInvalid cases: export to self, local table, pending mutations/patch parts
killKILL EXPORT PARTITION and cancellation behavior
clusters and nodesMulti-node exports to same S3 destination
shardsDistributed/sharded tables with Distributed engine
engines and volumesDifferent table engines and volume configurations
datatypesPartition key types (Int, UInt, Date, DateTime, String, etc.)
networkPacket delay, loss, corruption, MinIO/ClickHouse interruptions
concurrent actionsINSERT, SELECT, OPTIMIZE, KILL, DELETE during exports
system monitoringsystem.replicated_partition_exports, part_log, events
schema evolutionSource/destination schema compatibility over time
parallel export partitionMultiple EXPORT PARTITION operations in parallel
alter destination during exportALTER destination table during export
alter source timingALTER source table before/during/after export
replica failoverExport with replica failover scenarios
parallel inserts and selectsINSERT/SELECT concurrent with export
settingsEXPORT PARTITION settings and combinations
lightweight delete export partitionExport with lightweight deletes
lightweight update export partitionExport with lightweight updates
corrupted partitionsExport behavior with corrupted partition data

Examples

Run all sanity tests:

bash
./regression.py --storage minio --clickhouse https://example.com/clickhouse.deb --only "/s3/minio/export tests/export partition/sanity/*"

Run all export partition tests with logging:

bash
./regression.py --storage minio --clickhouse https://example.com/clickhouse.deb --only "/s3/minio/export tests/export partition/*" -l test.log

Run a specific feature (e.g., datatypes):

bash
./regression.py --storage minio --clickhouse https://example.com/clickhouse.deb --only "/s3/minio/export tests/export partition/datatypes/*"

Run a single scenario (e.g., one scenario under sanity):

bash
./regression.py --storage minio --clickhouse https://example.com/clickhouse.deb --only "/s3/minio/export tests/export partition/sanity/export setting"

Notes

  • Export partition tests require ClickHouse Antalya build (25.8+); older versions skip the suite via xfail in s3/regression.py.
  • The suite uses allow_experimental_export_merge_tree_part=1 (set in s3/tests/export_partition/feature.py).
  • Test code lives under s3/tests/export_partition/ with shared steps in s3/tests/export_partition/steps/.
  • Requirements are defined in s3/requirements/export_partition.py (SRS-016 ClickHouse Export Partition to S3).