简体   繁体   English

如何描述 Hbase 列族?

[英]How describe Hbase column family?

I am looking for a command which describes the columnfamily inside the table from the HBase Shell.我正在寻找一个命令,它描述来自 HBase Shell 的表内的列族。 I could not get any command to try this.我无法获得任何命令来尝试此操作。

If you use the describe command from the hbase shell you'll get the information for each column family.如果您使用hbase shelldescribe命令,您将获得每个列族的信息。 Currently, there is no way to filter on a single family.目前,无法过滤单个家庭。

Example:例子:

hbase(main):003:0> describe 'TABLE_NAME'
 'TABLE_NAME',
 {NAME => 'FAMILY_NAME',
  DATA_BLOCK_ENCODING => 'NONE',
  BLOOMFILTER => 'ROW',
  REPLICATION_ true                                          
  SCOPE => '0',
  VERSIONS => '1',
  COMPRESSION => 'NONE',
  MIN_VERSIONS => '0', TTL => '2147483647',
  KEEP_DELETED_CELLS => 'false',
  BLOCKSIZE => '65536',
  IN_MEMORY => 'false',
  BLOCKCACHE => 'true'
 }   

There is no command to describe the Hbase column family (which can display the column qualifiers), but I used Hue Hbase Browser, it has a smartview, which can display column qualifiers of a column family.没有描述Hbase列族的命令(可以显示列限定符),但是我使用了Hue Hbase Browser,它有一个smartview,可以显示列族的列限定符。

(It can not show all the column qualifiers of column family( like describe), but it can show a record with all the column qualifiers, which is helpful for me to understand CF) (Something is better than nothing). (它不能显示列族的所有列限定符(如describe),但它可以显示包含所有列限定符的记录,这有助于我理解CF)(有总比没有好)。

You can refer this link for more information: http://gethue.com/the-web-ui-for-hbase-hbase-browser/ .您可以参考此链接了解更多信息: http : //gethue.com/the-web-ui-for-hbase-hbase-browser/

NOTE: Here is a sample page screenshot, showing column qualifiers of a Column Family ("p")注意:这是一个示例页面截图,显示了列族(“p”)的列限定符在此处输入图片说明

If this is not helpful, you can write a Happy Script to display all the column qualifiers of a given Column Family, or you can use this API .如果这没有帮助,您可以编写一个 Happy Script 来显示给定 Column Family 的所有列限定符,或者您可以使用此API

getFamilyMap public NavigableMap getFamilyMap(byte[] family) getFamilyMap public NavigableMap getFamilyMap(byte[] family)

Map of qualifiers to values.限定符到值的映射。 Returns a Map of the form: Map返回以下形式的 Map:Map

Parameters:参数:

family - column family to get family - 列族获取

Returns: map of qualifiers to values返回: 限定符到值的映射

UPDATE #1更新 #1

Recently I wrote a Java program to display the column family and column qualifiers of a hbase table.最近我写了一个Java程序来显示一个hbase表的列族和列限定符。 Remember, this program will do a full table scan and analyze every cell, to get the qualifier names.Might take very longer for larger tables.请记住,该程序将执行全表扫描并分析每个单元格,以获取限定符名称。对于较大的表,可能需要更长的时间。

Here is the link for the program .这是该程序链接

I found this answer and added some modifications to it:我找到了这个答案并对其进行了一些修改:

it list all column family for each Cqualifier
  echo "scan 'yourTable', {'LIMIT' => 1} " | $HBASE_HOME/bin/hbase shell | awk -F'=' '{print $2}' | awk -F ':' '{print $1}'|awk -F ',' '{print $1}'  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM