Editing Tables

Use either the maprcli command table edit or the Control System to edit the attributes of a MapR Database binary or JSON table. You can also use the HBase shell to edit a binary table.

Editing Tables Using the Control System

About this task

To edit a (JSON or Binary) table using the Control System:

Procedure

  1. Go to the table information page.
  2. Click Edit Table to display the Edit Table page.
  3. Make changes (optional) to the following properties:
    Metrics Interval The interval of time for logging metrics.
    Auto Split Enable (Yes) or disable (No) auto-splitting of table. If enabled, the table will be split automatically into regions as the table grows. If disabled, the table can be split manually into regions. By default, this is enabled.
    Bulkload Enable (Yes) or disable (No) full bulk load of the table.
    Enable Auditing Enable (Yes) or disable (No) auditing of table operations. If auditing is enabled at the cluster and volume levels, enabling auditing will cause auditing to start for the table.
  4. Make changes (optional) to table administration control settings.
    1. Make changes to USER ACCESS CONTROLS under Table Setup and Authorization.
      Modify the list of users, groups, and/or roles that have and/or do not have the following types of access to the table:
      Admin Can view and edit the permissions for the table.
      Force Pack Can pack table regions.
      Split Merge Can take the following actions:
      • Split the table into regions or merge regions of the table together.
      • Change the size of the region.
      Bulkload Can load this table with bulk loads if the table was created with bulk load support.
      Replication Access Can set up replication either to or from a table.
      Create/Rename Column Family Can create column families for this table or rename existing column families.
      Delete Column Family Can delete column families associated with the table.
      To grant or block access to users, groups, and/or roles, from the:
      • Basic settings, select the type — public, (OR) user, group, or role — from the drop-down menu, specify the name of the user, group, or role, and select one or more checkbox to grant permissions.
        TIP Click to create a copy of the associated access control setting. Click to remove the associated access control expression.
        To add Access Control Expression (ACE)s for another user, group, or role, click Add Another and repeat this step.
      • Advanced settings, specify public (p) or user (u), group (g), and/or role (r) who have or do not have the type of access using the following boolean expressions and subexpressions:
        • ! — Negation operator.
        • & — AND operation.
        • | — OR operation.
        Use (), parentheses, for subexpressions.
        NOTE You cannot specify user, group, or role individually if access is granted to all users (public).

        Alternatively, click associated with the type of access to use the Access Control Expression window to define access for public or users, group, and/or role. See Defining ACEs for more information.

      NOTE If you switch from Basic to Advanced, the basic settings, if any, are carried over to the advanced settings. If you switch from Advanced to Basic, all the settings are lost because the subexpressions and AND (&) and negation (!) operations that are supported by advanced settings are not supported in the basic settings.
    2. Make changes to Default Column Family Authorization.
      Modify the list of users, groups, and/or roles that have and/or do not have the following types of access to the default column family:
      Read Data Can do column reads. Reads require permission both at the column-family level and at the field level. This permission is inherited by fields within the column family.
      Write Data Can do column writes. Writes require permission both at the column-family level and at the field level. This permission is inherited by fields within the column family.
      Traverse Data Can pass over fields in JSON documents. For example, suppose that a JSON table contains documents of this general structure:
      {
           "_id" : "ID",
           "a" :
                {
                     "b" : "value",
                     "c" : "value"
                }
      }
      Suppose further that the user sjohnson has read permission on a.b, but not on a. For sjohnson to read a.b, the user needs the traverse permission on a. The user can then pass over field a to a.b. This permission is inherited by fields within the column family.
      Set Version Can set or change the maximum and minimum number of versions of column values to keep.
      Set Compression Can set or change the compression setting for the column family.
      Modify the list of users, groups, and/or roles that have and/or do not have the following types of access to the default column family:
      Read Data Can do column reads. Reads require permission both at the column-family level and at the field level. This permission is inherited by fields within the column family.
      Write Data Can do column writes. Writes require permission both at the column-family level and at the field level. This permission is inherited by fields within the column family.
      Append Data Can do column appends. Column appends require permission both at the column-family level and at the column level.
      Set Version Can set or change the maximum and minimum number of versions of column values to keep.
      Set Compression Can set or change the compression setting for the column family.
      To grant or block access to users, groups, and/or roles, from the:
      • Basic settings, select the type — public, (OR) user, group, or role — from the drop-down menu, specify the name of the user, group, or role, and select one or more checkbox to grant permissions.
        TIP Click to create a copy of the associated access control setting. Click to remove the associated access control expression.
        To add ACEs for another user, group, or role, click Add Another and repeat this step.
      • Advanced settings, specify public (p) or user (u), group (g), and/or role (r) who have or do not have the type of access using the following boolean expressions and subexpressions:
        • ! — Negation operator.
        • & — AND operation.
        • | — OR operation.
        Use (), parentheses, for subexpressions.
        NOTE You cannot specify user, group, or role individually if access is granted to all users (public).

        Alternatively, click associated with the type of access to use the Access Control Expression window to define access for public or users, group, and/or role. See Defining ACEs for more information.

      NOTE If you switch from Basic to Advanced, the basic settings, if any, are carried over to the advanced settings. If you switch from Advanced to Basic, all the settings are lost because the subexpressions and AND (&) and negation (!) operations that are supported by advanced settings are not supported in the basic settings.
  5. Click Save Changes for the changes to take effect.

Editing Tables Using the CLI or the REST API

About this task

Run the command maprcli table edit -path <path> .

  • 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
    NOTE You cannot use the following characters in the table name:
     < > ? % \
    To use the following characters in the table name, enclose them either in single or double quotes:
    ; | ( ) / 
    For example:
    maprcli table create -path "/設備^=#;{}&()/"  (or)
    maprcli table create -path '/設備^=#;{}&()/'
    To use either the ' or the " character in the table name, enclose:
    • the ' character within double quotes (")
    • the " character within single quote (')
    For example:
    maprcli table create -path "/'設備^=#;{}&()/"  (or)
    maprcli table create -path '/"設備^=#;{}&()/'

When you edit a table with this command, you can change a number of properties.

  • Enable or disable auditing, autosplitting, and bulkloading
  • Set permissions on table
  • Set permissions for default column families

For full reference for this command, see the table edit command.

Editing Binary Tables Using HBase Shell

About this task

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