【问题标题】:how to add a column in hbase table without adding column family如何在不添加列族的情况下在 hbase 表中添加列
【发布时间】:2015-11-27 20:43:32
【问题描述】:

是否可以在不添加列族的情况下创建 hbase 表, 例如 创建'emp'、'个人数据'、'专业数据'

个人数据和专业数据是列族,我想在表格中添加字段而不添加列族

例如

        HTable hTable = new HTable(config, "TableName");
        Put p = new Put(Bytes.toBytes("ROW"));
        p.add(Bytes.toBytes("VALUES"); 
        //only the values need to be added to the column without column family. 

【问题讨论】:

    标签: hbase column-family


    【解决方案1】:

    每个 HBase 表必须至少有一个列族。 HBase 中的每条数据都在一个 Cell (KeyValue) 中,它有一个行、列族、列限定符、时间戳和一个值。列族是在创建表时静态定义的,并且在不禁用表的情况下无法更改。但是,您可以在列族中动态创建所需的任何列 - 实际上每一行都可以有自己的列。

    您可以在https://hbase.apache.org/book.html#datamodel阅读更多内容

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多