全部产品
云市场

HBase 原生API

更新时间:2019-11-21 20:25:58

HBase API不同的版本有一些细微的差异,1.x系列的主要API基本未变。详细请参考:Apache hbase shell

数据定义

  • 创建表

    1. 语法:create '<table>', '<column_family>' [, '<column_family>', ...]
    2. 例子:新建一张包括f1f2列族的表名威test的表:create 'test', 'f1', 'f2'
  • 检测表模式
  1. hbase(main):002:0> list
  2. TABLE
  3. users
  4. 1 row(s) in 0.0180 seconds
  5. => ["users"]
  6. hbase(main):003:0> desc 'users'
  7. Table users is ENABLED
  8. users
  9. COLUMN FAMILIES DESCRIPTION
  10. {NAME => 'info', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL
  11. => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
  12. 1 row(s) in 0.0750 seconds