Altering Column Families
Explains how to modify the permissions and properties of column families using either the Control System, the CLI, or the HBase shell.
About this task
Modifying a Column Family Using the Control System
Procedure
- Go to the table information page.
-
Click the Column Families tab.
The page displays the:
- Default Column Family Authorization pane
- All pane which lists the column families for the table
-
Click the name of the column family to modify.
The Edit Column Family page appears.
-
Make changes to the following properties (under the PROPERTIES
pane), as desired.
Field Name Field Description Column Family Name The name of the column family. Compression The compression setting to use for the column family. Valid options are off
,lzf
,lz4
, andzlib
. The default setting is the same as the compression setting for the directory where the table is located.In Memory Determines whether preference is given to values of this column family for storage with row keys. Because row keys are cached in memory in preference to row data, column-family data that is stored inline with the row keys is also cached in memory. For all column families in a table together, up to 200 bytes of row data will be stored inline with each row key. Storing data inline with a row key might speed retrieval of the data from a column family because disk access can often be avoided. For each column family, up to 32 bytes can be stored inline with each row key even if this is disabled (No), but preference will be given to column families where this is enabled (Yes). A column family can have more than 32 bytes stored inline if this is enabled.
If the total number of bytes for all column families together exceeds 200 for a row, then preference for inclusion within the inline storage for that row is given to column families that have this enabled.
By default, this is enabled.NOTEAll of the data for a column family will be stored in-line with the row key, or none will be. If the contents in a column family for a particular row are larger than the maximum number of bytes that are allowed to be stored for that column family, no data will be stored in-line for that column family.Field Name Field Description Column Family Name The name of the column family. Version - Minimum — The minimum number of versions of column values to keep. The default is zero.
- Maximum — Maximum number of versions of column values to keep. The default is one.
Compression The compression setting to use for the column family. Valid options are off
,lzf
,lz4
, andzlib
. The default setting is the same as the compression setting for the directory where the table is located.Time-to-Live Specifies whether to purge data when the age of the data in this column family exceeds the value specified here. Data can remain forever or can be purged after specified amount of time (in seconds). Setting the value to 0 is equivalent to allowing data to remain indefinitely or forever. In Memory Determines whether preference is given to values of this column family for storage with row keys. Because row keys are cached in memory in preference to row data, column-family data that is stored inline with the row keys is also cached in memory. For all column families in a table together, up to 200 bytes of row data will be stored inline with each row key. Storing data inline with a row key might speed retrieval of the data from a column family because disk access can often be avoided. For each column family, up to 32 bytes can be stored inline with each row key even if this is disabled (No), but preference will be given to column families where this is enabled (Yes). A column family can have more than 32 bytes stored inline if this is enabled.
If the total number of bytes for all column families together exceeds 200 for a row, then preference for inclusion within the inline storage for that row is given to column families that have this enabled.
By default, this is enabled.NOTEAll of the data for a column family will be stored in-line with the row key, or none will be. If the contents in a column family for a particular row are larger than the maximum number of bytes that are allowed to be stored for that column family, no data will be stored in-line for that column family. -
(JSON Tables) Add or remove a security policy, as appropriate:
- Add a Policy:
- Enter the first few characters of the name of an existing security policy in the Search for security policy field. A list of security policies matching your search criteria are listed below the Search for security policy field.
- Check the needed policy.
- click Add. The added security policy appears above the Search for security policy field. The policy settings for the selected security policy are now associated with the column family.
- Remove a Policy: Click (Delete) to the right of the displayed security name to remove disassociate the policy from the column family. The security policy is deleted immediately.
- Add a Policy:
-
Do one of the following:
- Delete a set of user access control permissions:
Click (Delete) to the right of a displayed set of permissions to delete the set of permissions. The set of user access control permissions are deleted immediately.
- Change or update one or more sets of existing user access control
permissions:
See the tables below for more information on user access control permission options.
Use the Basic or Advanced settings to update existing permissions:
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.To add Access Control Expression (ACE)s for another user, group, or role, click Add Another and repeat this step.TIPClick to create a copy of the associated access control setting. Click to remove the associated access control expression.
- 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.
()
, 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 Access Control Expression window to define access for public or users, group, and/or role. See Defining ACEs Using the Access Control Expression Builder for more information.
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.Modify or update the following user access control permissions for the column family:Option Option Permission 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 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.{ "_id" : "ID", "a" : { "b" : "value", "c" : "value" } }
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. Modify or set the following permissions for the column family:Option Option Permission 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. - 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.
- Delete a set of user access control permissions:
- Click Save Changes for the changes to take effect.
Modifying a Column Family Using the CLI or REST API
About this task
maprcli table cf edit -path <path> -cfname <name_of_column_family> options
For
the full list of options, see the table cf edit
command.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
undervolume1
in thesanfrancisco
cluster, specify the following path:/mapr/sanfrancisco/volume1/customer
To 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 '/"設備^=#;{}&()/'
Modifying a Column Family in a Binary Table 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.