matrixorigin / matrixorigin/matrixone

Feature Not Supported: ALTER TABLE EXCHANGE PARTITION Not Supported

Open
#23,097 0 comments 0 reactions 1 assignee Assigned to @XuPeng-SH View on GitHub
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

# Issue: ALTER TABLE EXCHANGE PARTITION Not Supported

## Description

MatrixOne does not support exchanging partitions with regular tables using `ALTER TABLE EXCHANGE PARTITION`. This is a standard MySQL feature for swapping a partition with a non-partitioned table, which is useful for data migration and maintenance.

## Error Statement

```sql
CREATE TABLE test_exchange (
id INT,
name VARCHAR(100),
created_date DATE
);

ALTER TABLE test_partition_range EXCHANGE PARTITION p2022 WITH TABLE test_exchange;
```

## Error Message

```
ERROR 1050 (HY000) at line 1: table test_exchange already exists
```

Note: While the immediate error is about table existence (from a previous test run), the underlying issue is that MatrixOne does not support the EXCHANGE PARTITION operation. Even if the table didn't exist, the operation would likely fail with a syntax error or "not supported" error.

## Expected Behavior

The statement should exchange the `p2022` partition with the `test_exchange` table, effectively swapping their data and structure.

## Actual Behavior

MatrixOne does not recognize or support the `EXCHANGE PARTITION` syntax. The operation would fail even if the table didn't exist.

## Impact

- Users cannot exchange partitions with regular tables
- Data migration between partitioned and non-partitioned tables is more difficult
- Partition maintenance operations are limited
- Migration from MySQL may require different data migration strategies

## Test Case

**Case ID**: 615
**Test File**: `test_batch_62_partition.sql`
**Test Type**: Partition - EXCHANGE PARTITION operation

## Related Information

- MatrixOne supports creating partitioned tables (RANGE, HASH, KEY)
- Other partition management operations (ADD, TRUNCATE, REORGANIZE, COALESCE) are also not supported
- This is part of comprehensive partition functionality testing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.