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 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
-
Log into the Control System using your login credentials. The Control
System Overview page appears.
NOTEThis option is not available on the Kubernetes version of the Control System.
- Click Data > Tables from the top of the page. The Tables page appears.
- Click Create Table. The Create New Table page appears.
-
From the Properties pane of the Create
New Table page, choose the table type:
- JSONNOTEYou must select JSON for the table type to enable dynamic data masking.
- Binary
- JSON
-
Specify values for fields displayed under Properties
pane of the Create New Table page, as
appropriate:
-
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
testunder 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
customerinvolume1in thesanfranciscocluster, specify the following path:/mapr/sanfrancisco/volume1/customer
- For a path on the local cluster, start the path at the
volume mount point. For example, for a table named
-
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.
-
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.
-
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.
-
Enter the path to or location for the table in the Table
Path field.
-
(Optional) Configure the following Security
settings:
- 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.
-
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.
NOTEThe 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.
- Click the checkbox next to the name of the listed security policy you intend to use for this table.
- 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.
-
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.
-
Define Default Data Access Control for Column Family
settings:
-
Select either Basic or
Advanced:
NOTEIf 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. NOTEYou 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.
- JSON Table Security Permission Options
- Binary Table Security Permission Options
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:
Suppose further that the user sjohnson has read permission on{ "_id" : "ID", "a" : { "b" : "value", "c" : "value" } }a.b, but not ona. For sjohnson to reada.b, the user needs the traverse permission ona. The user can then pass over fieldatoa.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.
(), parentheses, for subexpressions.NOTEYou cannot specify User, Group, or Role individually if access is granted to all users (Public).NOTEBy 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.
- 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.
-
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
.
- Create a copy of permission settings for a listed public,
user, group, or role type by clicking
-
Select either Basic or
Advanced:
- Optionally, repeat the above step to add another user type, as needed. Otherwise, proceed to the next step.
-
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.
- Table Administration Control Permission Options for JSON Tables
- Table Administration Control Permission Options for Binary Tables
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.
(), parentheses, for subexpressions.NOTEYou 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. NOTEIf 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.
- 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.
- 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.
- Review and update your selections, as needed.
- Click Create Table at the bottom of the Create New Table page to create the table.
- Opt to do the following:
Creating a Table Using the CLI or the REST API
About this task
- CLI
- REST
maprcli table create -path <path>-tabletype parameter and set it to
json:maprcli table create -path <path> -tabletype jsonThe
-tabletype parameter is set to binary by default.- 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
testunder 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
customerundervolume1in thesanfranciscocluster, specify the following path:/mapr/sanfrancisco/volume1/customerTo use the following characters in the table name, enclose them either in single or double quotes:NOTEYou cannot use the following characters in the table name:< > ? % \
For example:; | ( ) /maprcli table create -path "/設備^=#;{}&()/" (or) maprcli table create -path '/設備^=#;{}&()/'To use either the ' or the " character in the table name, enclose:For example:- the ' character within double quotes (")
- the " character within single quote (')
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
- JSON Tables
- Binary Tables
The HPE 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.