def tabledefinehypercolumn(tabdesc, name, ndim, datacolumns, coordcolumns=
    False, idcolumns=False):
    """Add a hypercolumn to a table description.

    It defines a hypercolumn and adds it the given table description.
    A hypercolumn is an entity used by the Tiled Storage Managers (TSM). It
    defines which columns have to be stored together with a TSM.

    It should only be used by expert users who want to use a TSM to its
    full extent. For a basic TSM s hypercolumn definition is not needed.

    tabledesc
      A table description (result from :func:`maketabdesc`).
    name
      Name of hypercolumn
    ndim
      Dimensionality of hypercolumn; normally 1 more than the dimensionality
      of the arrays in the data columns to be stored with the TSM
    datacolumns
      Data columns to be stored with TSM
    coordcolumns
      Optional coordinate columns to be stored with TSM
    idcolumns
      Optional id columns to be stored with TSM

    For example::

      scd1 = makescacoldesc("col2", "aa")
      scd2 = makescacoldesc("col1", 1, "IncrementalStMan")
      scd3 = makescacoldesc("colrec1", {})
      acd1 = makearrcoldesc("arr1", 1, 0, [2,3,4])
      acd2 = makearrcoldesc("arr2", as_complex(0))
      td = maketabdesc([scd1, scd2, scd3, acd1, acd2])
      tabledefinehypercolumn(td, "TiledArray", 4, ["arr1"])
      tab = table("mytable", tabledesc=td, nrow=100)

    | This creates a table description `td` from five column descriptions
      and then creates a 100-row table called mytable from the table
      description.
    | The columns contain respectivily strings, integer scalars, records,
      3D integer arrays with fixed shape [2,3,4], and complex arrays with
      variable shape.
    | The first array is stored with the Tiled Storage Manager (in this case
      the TiledColumnStMan).

    """
    rec = {'HCndim': ndim, 'HCdatanames': datacolumns}
    if not isinstance(coordcolumns, bool):
        rec['HCcoordnames'] = coordcolumns
    if not isinstance(idcolumns, bool):
        rec['HCidnames'] = idcolumns
    if '_define_hypercolumn_' not in tabdesc:
        tabdesc['_define_hypercolumn_'] = {}
    tabdesc['_define_hypercolumn_'][name] = rec
