大数据 HBase Shell

# 禁用表
disable 'table_name'
# 删除表
drop 'table_name'
# 查看表是否存在
exit 'table_name'
# 禁用符合条件的表
disable_all 'tab.*'
# 删除符合条件的表
drop_all 'tab.*'
# 创建表
create '表名', {NAME=>'列族1', 属性名=>值}, {NAME=>'列族2'}
# 添加列族
alter 'test', 'cf2'
# 修改列族属性
alter 'test',{NAME=>'cf', VERSIONS=>5}
alter '表名', 属性名=>值, 属性名=>值
alter '表名', NAME=>'列族', 属性名=>值, 属性名=>值
alter '表名', {NAME=>'列族', 属性名=>值, 属性名=>值},{NAME=>'列族', 属性名=>值, 属性名=>值}
alter '表名', 'delete' => '列族'
# 查看符合条件的表
list ['通配符']
# 查看表属性
describe '表名'
# 启动表
enable '表明'
# 添加数据
put 'test','row1','cf:name','iFan'
# 查询
get 'test','row1',{COLUMN=>'cf:name', VERSIONS=>3}
scan 'test',{STARTROW=>'row3', ENDROW=>'row4'}
scan 'test',{RAW=>true, VERSION>5} // 查询表未经过过滤的原始记录
scan '表名', {LIMIT=>行数量}
# 删除
delete 'test','row4','cf:name'
deleteall 'test','row5'
# 列出所有过滤器
show_filters
原文地址:https://www.cnblogs.com/iFanLiwei/p/13408803.html