Deleting Column Families

There are several methods that you can use to delete column families in MapR-DB tables.

Behavior When Deleting Column Families from JSON Tables

Note: You cannot delete the default column family from a JSON table.

The data that is in the specified column family is deleted. If the column family is followed by one or more column families in a hierarchy, the other column families in the hierarchy are unaffected and still accessible. For example, if column family CF1 at path a.c is followed by column family CF2 at path a.c.f, CF2 remains accessible and only the data in CF1 is deleted.

Before deleting the column family CF1 at a.c After deleting the column family CF1 at a.c
{
 "a" : {
         "b" : "value_b",
         "c" : {
                 "d" : "value_d",
                 "e" : "value_e",
                 "f" : {
                         "g" : "value_g",
                         "h" : "value_h"
                       }
                }
       }
}
{
 "a" : {
         "b" : "value_b",
         "c" : {
                 "d" : "",
                 "e" : "",
                 "f" : {
                         "g" : "value_g",
                         "h" : "value_h"
                       }
                }
       }
}

Methods Common to Both Table Types

maprcli command

The command to delete a column family is:
maprcli table cf delete -path <path> -cfname <name_of_column_family>

The format of the value of the -path parameter depends on whether you are creating a table on a local cluster or a remote cluster:

  • For a path on the local cluster, start the path at the volume mount point. For example, for a table named test under a volume with a mount point at /volume1, specify the following path: /volume1/test
  • For a path on a remote cluster, you must also specify the cluster name in the path. For example, for a table named customer under volume1 in the sanfrancisco cluster, specify the following path:/mapr/sanfrancisco/volume1/customer

MCS

  1. Open the table from which you want to delete the column family.
  2. Click the Column Families tab.

    Figure: Where to find the Column Families tab

  3. Select the column family and click the Delete Column Family button.

Method for Binary Tables Only

HBase Shell

After starting the HBase shell, run the alter command. Type help to see a list of commands and their syntax.