Creating a New Table

Explains how to create both binary tables and JSON tables using either the Control System, the CLI, or the REST API.

About this task

Different methods can be used to create HPE Ezmeral Data Fabric Database tables, such as maprcli, hbase shell, mapr dbshell commands, and the Control System. The following procedures describe how to create tables using these methods.

Creating a Table Using the Control System

Procedure

  1. Log into the Control System using your login credentials. The Control System Overview page appears.
    NOTE
    This option is not available on the Kubernetes version of the Control System.
  2. Click Data > Tables from the top of the page. The Tables page appears.
  3. Click Create Table. The Create New Table page appears.
  4. From the Properties pane of the Create New Table page, choose the table type:
    • JSON
      NOTE
      You must select JSON for the table type to enable dynamic data masking.
    • Binary
  5. Specify values for fields displayed under Properties pane of the Create New Table page, as appropriate:
    1. Enter the path to or location for the table in the Table Path field.
      Tables are stored in the Data Fabric file system. When providing the path to a table, use these conventions:
      • 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 in volume1 in the sanfrancisco cluster, specify the following path: /mapr/sanfrancisco/volume1/customer
    2. Select the interval of time to apply for logging table metrics in the Metric Interval field.
      You can choose to log metrics every 10 seconds, 1 minute (default), or 10 minutes. For more information on visualizing the metrics, see Visualizing Table Metrics in the Control System.
    3. Enable (Yes) or disable (No) auto-splitting of table.
      If enabled, the table is split automatically into regions as the table grows. If disabled, the table can be split manually into regions. By default, this option is enabled.
    4. Choose whether to complete a full bulk load or incremental bulk load of the table.
      For more information, see Loading Documents into JSON Tables. The default value is incremental bulkload.
  6. (Optional) Configure the following Security settings:
    1. Click Security on the Create New Table page to open and display security options (if not already displayed). Fields and options for the Security Policy, Audit, and Default Data Access Control for Column Families appear.
    2. Enter the name or the first few characters of an existing security policy in the Search for security policy field until the needed policy appears below the search box. The selected security policy is associated with the current table being created.
      NOTE
      The Search for security policy field under the Security pane appears only if security policies have been previously created. If the Search for security policy field does not appear under the Security pane, then, using the appropriate privileges, go to the Security screen, and set up necessary security policies.
    3. Click the checkbox next to the name of the listed security policy you intend to use for this table.
    4. Click Add. The name of the security policy that you selected appears above the search box. The security policy selected (along with its current data masking setting) is then associated with this table.
  7. For the Enable Auditing field, either enable (Yes) or disable (No) auditing to audit table operations.
    If auditing is enabled at the cluster and volume levels, it causes auditing to start for the table operations.
  8. Define Default Data Access Control for Column Family settings:
    1. Select either Basic or Advanced:
      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.
      • If you select Basic from the Security pane of the Create New Table page, then select a user type, enter a name in the Name field, and check associated permissions for the settings, as needed.
        NOTE
        You cannot specify User, Group, or Role individually if access is granted to all users (Public).

        Selected permissions become the default table permissions after creating column families under this table and are displayed under the DEFAULT DATA ACCESS CONTROL FOR COLUMN FAMILIES pane of the Create New Table page.

        Permission Permission Description
        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 Compression Can set or change the compression setting for the column family.
        Unmasked Data Leaving the Unmask Data checkbox unchecked hides table column family data from the selected user. Checking the box allows the selected user to see all table data, based on and in coordination with other security and data access settings.
        Permission Permission Description
        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.
      • If you select Advanced from the Security pane of the Create New Table page, then specify public (p) or user (u), group (g), and/or role (r) and indicate, if required, user access options with 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).
        NOTE
        By default, all table permissions are given to the user creating the table.

        Alternatively, click associated with the type of access to use the selected Access Control Expression window to define access for Public or User, Group, and/or Role.

    2. Opt to:
      • Create a copy of permission settings for a listed public, user, group, or role type by clicking , which you can then modify.
      • Delete permission settings for a listed public, user, group, or role type by clicking .
  9. Optionally, repeat the above step to add another user type, as needed. Otherwise, proceed to the next step.
  10. Do one of the following to specify settings under the Table Administration Control pane of the Create New Table page:
    • Click Basic under the Table Administration Control pane, select Public (to grant access to all users) or User, Group, or Role. Then, enter a name for the current permission set in the Name field, and apply table permissions as described in the table below.
      Permission Permission Description
      Administration 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.
      Index Can create index for this table.
      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.
      Permission Permission Description
      Administration 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.
    • Click Advanced, and then apply user permissions.

      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 selected Access Control Expression window to define access for public or users, groups, and/or roles.

      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.
  11. Optionally, click Add Another from the Table Administration Control pane of the Create New Table page, and repeat the above step to assign security permissions for another user type. Otherwise, proceed to the next step.
  12. Review and update your selections, as needed.
  13. Click Create Table at the bottom of the Create New Table page to create the table.
  14. Opt to do the following:
    • Add column families to the table.
    • View the table information for the newly created table.

Creating a Table Using the CLI or the REST API

About this task

The basic command to create a binary table is:
maprcli table create -path <path>
To create a JSON table, include the -tabletype parameter and set it to json:
maprcli table create -path <path> -tabletype json
The -tabletype parameter is set to binary by default.
Send a request of type POST. For example, to create a:
  • Binary table:
    curl -X POST 'https://<hostname>:8443/rest/table/create?path=<path>' --user <username>:<password>
  • JSON table:
    curl -X POST 'https://<hostname>:8443/rest/table/create?path=<path>&tabletype=json' --user <username>:<password>

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
    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 '/"設備^=#;{}&()/'

If you create a table, you can set a number of properties. Refer to the table create command..

Creating Tables Using shell Command

About this task

The HPE Ezmeral Data Fabric Database shell command is used on JSON tables only. To run this command, execute the following:

mapr dbshell

After starting the shell, run the create command.

The HBase shell command is used on binary tables only. To run this command, execute the following:

hbase shell

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