Open topic with navigation
MAP PARTITION — create an association between a table partition name and a storage group name
MAP PARTITION command creates an association between a table partition name and a storage group name. This establishes a storage group name for subsequent partitions that do not otherwise establish a storage group name. The
MAP PARTITION command has no effect on existing partitions. See Example 2 below.
For information on create storage groups see Managing Storage Groups.
To remove the mapping from a table partition name to a storage group, see
The name you are giving to this table partition.
The storage group to which this table partition will map.
p1to a previously created storage group
MAP PARTITION p1 STORE IN sg1;
MAP PARTITIONcommand has no effect on existing partitions.
# Create a table T1 with partition P1 that stores values in storage group S1
CREATE TABLE t1 (f1 INTEGER) PARTITION BY RANGE(f1) PARTITION p1 VALUES LESS THAN(100) STORE IN s1;# Map the partition name P1 to the storage group S2. This mapping doesn't affect # existing mapping for table T1.
MAP PARTITION p1 STORE IN s2;# Data in table T2 partition P1 will be stored in storage group S2.
CREATE TABLE t2 (str1 STRING) PARTITION BY LIST(str1) PARTITION p1 VALUES IN('a','b');