HBase Shell Command Tool についていくつか質問があります。
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?
HBase Shell Command Tool についていくつか質問があります。
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: テーブル内のすべての列ファミリ名 (名前だけ!) を一覧表示する方法は?
OOTB はできません。しかし、次のようなことができます:
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
を使用するdescribe
と、列ファミリーが次のように表示されますNAME=> 'columnfamilyname'
スキャンを制限する Tariq の回答に基づいた listColumns スクリプトがあります (生涯のうちに終了させたいため)。
echo "scan '$1', LIMIT => 1" | hbase shell | awk '{print $2}' | grep column | sort | uniq | awk -F = '{print $2} '
明らかに、行が異なる列を持つリスクがあります。