Edits a column family definition. You can alter a column family's name, minimum and maximum versions, time to live, compression, memory residence status, and permissions.

Syntax

CLI

maprcli table cf edit
    -path <path>
    -cfname <name>
  [ -appendperm Append Permissions ]
  [ -compression off|lzf|lz4|zlib ]
  [ -compressionperm Compression Permissions ]
  [ -inmemory true|false ]
  [ -maxversions <integer> ]
  [ -memoryperm Memory Permissions ]
  [ -minversions <integer> ]
  [ -newcfname <name> ]
  [ -readperm Read Permissions ]
  [ -ttl <value> ]
  [ -versionperm Version Permissions ]
  [ -writeperm Write Permissions ]

REST

http[s]://<host>:<port>/rest/table/cf/edit?path=<path>&cfname=<name>&<parameters>

Parameters

Parameter

Description

path

The path to the table.

  • For a path on the local cluster, start the path at the volume mount point. For example, for a table named test under volume1 which has 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 test under volume1 in the sanfrancisco cluster, specify the following path:/mapr/sanfrancisco/volume1/customer

cfname

The name of the column family to edit.

appendperm

The Access Control Expression for column appends. Use single quotation marks around the ACE. 

Column appends require permission both at the column-family level and at the column level. By default, permission is given to the value of defaultappendperm for the table.

compressionThe compression setting to use for the column family. Valid options are off, lzf, lz4, and zlib. The default setting is equal to the table's compression setting. For more information, see Compression.
inmemory

Boolean. 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 its inmemory parameter is set to false, but preference will be given to column families where this parameter is set to true. A column family can have more than 32 bytes stored inline if its inmemory parameter is set to true.

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 the inmemory parameter set to true.

All 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 at all will be stored in-line for that column family.

The default value for the inmemory parameter is false.

maxversions

Maximum number of versions to keep. The default is three.

memorypermThe Access Control Expression for changing the value of the inmemory parameter. Use single quotation marks around the ACE. By default, permission is given to the value of defaultmemoryperm for the table.
minversionsMinimum number of versions to keep. The default is zero.
newcfname

The new name of the column family.

readperm

The Access Control Expression for column reads. Use single quotation marks around the ACE. 

Column reads require permission both at the column-family level and at the column level. By default, permission is given to the value of defaultreadperm for the table.

ttl

Time to live in seconds. The default value is forever. When the age of the data in this column family exceeds the value of the ttl parameter, the data is purged. Setting the value of ttl to 0 is equivalent to the default value of forever.

versionperm

The Access Control Expression for changing the value of the maxversions and minversions parameters. By default, permission is given to the value of defaultversionperm for the table.
writeperm

The Access Control Expression for column writes (puts and deletes). Use single quotation marks around the ACE. 

Column writes require permission both at the column-family level and at the column level. By default, permission is given to the value of defaultwriteperm for the table.

 

Examples

Changing a column family's name and time to live

CLI

maprcli table cf edit -path /my.cluster.com/volume1/mytable -cfname mycf -newcfname mynewcfname -ttl 86400

REST

https://r1n1.sj.us:8443/rest/table/cf/edit?path=%2Fmy.cluster.com%2Fvolume1%2Fmytable&cfname=mycf&newcfname=mynewcfname&ttl=86400