ALTER-COLOCATE-GROUP

Name

ALTER COLOCATE GROUP

SinceVersion dev

Description

This statement is used to modify the colocation group.

Syntax:

  1. ALTER COLOCATE GROUP [database.]group
  2. SET (
  3. property_list
  4. );

NOTE:

  1. If the colocate group is global, that is, its name starts with __global__, then it does not belong to any database;

  2. property_list is a colocation group attribute, currently only supports modifying replication_num and replication_allocation. After modifying these two attributes of the colocation group, at the same time, change the attribute default.replication_allocation, the attribute dynamic.replication_allocation of the table of the group, and the replication_allocation of the existing partition to be the same as it.

Example

  1. Modify the number of copies of a global group

    1. # Set "colocate_with" = "__global__foo" when creating the table
    2. ALTER COLOCATE GROUP __global__foo
    3. SET (
    4. "replication_num"="1"
    5. );
  2. Modify the number of copies of a non-global group

    1. # Set "colocate_with" = "bar" when creating the table, and the Database is "example_db"
    2. ALTER COLOCATE GROUP example_db.bar
    3. SET (
    4. "replication_num"="1"
    5. );

Keywords

  1. ALTER, COLOCATE, GROUP

Best Practice