Nosql HBase Shell命令问题

Nosql HBase Shell命令问题,nosql,hbase,hbase-shell,Nosql,Hbase,Hbase Shell,我对HBase外壳命令工具有一些疑问: 1: How to list all column family names (just names!) in a table? 2: How to count the number of rows in a column family? 1:如何在表中列出所有列族名称(仅列出名称!)? 不可能。但你可以这样做: echo "scan 'table'" | bin/hbase shell | awk -F'=' '{print $2}' | awk -F

我对HBase外壳命令工具有一些疑问:

1: How to list all column family names (just names!) in a table?
2: How to count the number of rows in a column family?

1:如何在表中列出所有列族名称(仅列出名称!)?

不可能。但你可以这样做:

echo "scan 'table'" | bin/hbase shell | awk -F'=' '{print $2}' | awk -F ':' '{print $1}'
2:如何计算列族中的行数?

你这是什么意思?是否要询问如何计算行中的列族数?如果这是您需要的,请尝试以下方法:

echo "scan 'table'" | bin/hbase shell | grep cf | wc -l

我有一个基于Tariq答案的listColumns脚本来限制扫描(因为我希望在有生之年完成)


显然,您会面临行具有不同列的风险。

使用
description
,它会将列族显示为
NAME=>“columnfamilyname”

对于Q2:我想计算一个列族包含多少行
echo "scan '$1', LIMIT => 1" | hbase shell | awk '{print $2}' | grep column | sort | uniq | awk -F = '{print $2} '