In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the functions of HBase shell". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the functions of HBase shell"?
1. List: list all tables
2. Desc: view the attribute information of the table
3. Put: an insert statement similar to mysql. The example is as follows:
# add data to column C1 of table T1 with rowkey of R1 under namespace ns1 hbase > put 'ns1:t1',' R1,'C1, 'value'# to column C1 of rowkey of table T1 of default namespace hbase > put' T1,'R1,'C1, 'value'# add data to column C1 of rowkey of table T1 of default namespace T1 And set the timestamp to ts1 hbase > put'T1,'R1,'C1, 'value', ts1# to add data to column C1 whose rowkey is R1 in table T1 of the default namespace, and set the timestamp to ts1 And set the properties hbase > put 't1commands, 'r1regions,' c1neighbors, 'value', ts1, {ATTRIBUTES= > {' mykey'= > 'myvalue'}} # usage of reference objects t.put' r1references, 'c1examples,' value', ts1, {ATTRIBUTES= > {'mykey'= >' myvalue'}}
4. Scan: scan table information
# scan the meta table under the namespace hbase, show all the data of the meta table hbase > scan 'hbase:meta'# scan the column regioninfo of the column family info of the meta table under the namespace hbase, show all the data hbase > scan' hbase:meta', {COLUMNS = > 'info:regioninfo'} # scan the column families' C1 'and' c2' of table T1 under the namespace ns1. Shows all the data of the column families'C1 'and' c2' of table T1 under the namespace ns1 hbase > scan 'ns1:t1', {COLUMNS = > [' C1', 'c2']} # scan the column families' C1 'and' c2' of table T1 under namespace ns1. The column families'C1 'and' c2'of table T1 under the namespace ns1 are shown, and only the data for the first 10 rowkey are displayed. Hbase > scan 'ns1:t1', {COLUMNS = > [' C1', 'c2'], LIMIT = > 10} # scan the column families' c1' and 'c2' of table T1 under the namespace ns1. The column families'C1 'and' c2'of table T1 in the namespace ns1 are shown, and only the data of the first 10 rowkey starting with rowkey= "xyz" are displayed. Hbase > scan 'ns1:t1', {COLUMNS = > [' C1', 'c2'], LIMIT = > 10, STARTROW = >' xyz'} # scan the default namespace table T1 column family C1 timestamp from '1303668804' to' 1303668904' data hbase > scan'T1 timestamp, {COLUMNS = > 'c1belt, TIMERANGE = > [1303668804, 1303668904]} # reverse display table T1 data hbase > scan' T1, {REVERSED = > true} # filter the data hbase > scan'T1 of table T1 {FILTER = > "(PrefixFilter ('row2') AND (QualifierFilter (> =,' binary:xyz')) AND (TimestampsFilter (123,456))"} # RAW is true Shows all the data in table T1, including deleted hbase > scan 't1entries, {RAW = > true, VERSIONS = > 10} # scan hbase > T11 = get_table 't1' hbase > t11.scan for references to table T1
5 、 get
# get the data hbase > get 'ns1:t1',' R1 data of table T1 in the namespace ns1, get the data hbase > get'T1 data of the default namespace table T1 whose rowkey is R1, and get the rowkey of table T1 of the default namespace table T1 is R1 Data with timestamp range between ts1 and ts2 hbase > get 't1regions, 'r1regions, {TIMERANGE = > [ts1, ts2]} # get the data hbase > get 't1columns of C1 column of default namespace table T1 whose rowkey is R1,' R1 namespaces, {COLUMN = > 'c1'} # get the data hbase > get 't1columns of C1 rowkey of R1 of table T1 in the default namespace, {COLUMN = > [' C1'],'c2' 'c3']} # get the C1 column of default namespace table T1 whose rowkey is R1 The data with timestamp ts1 hbase > get 't1regions, 'r1stamps, {COLUMN = >' c1frames, TIMESTAMP = > ts1} # gets the default namespace table T1 whose rowkey is R1 C1 column, with timestamps ranging from ts1 to ts2 Data with version 4: hbase > get 't1records, 'r1entries, {COLUMN = >' c1examples, TIMERANGE = > [ts1, ts2], VERSIONS = > 4} # usage of application objects hbase > t.get 'r1' hbase > t.get 'r1domains, {TIMERANGE = > [ts1, ts2]} hbase > t.get 'r1examples, {COLUMN = > 'c1'} hbase > t.get 'r1examples, {COLUMN = > [' c1examples, 'c2rels,' c3']} hbase > t.get 'r1' {COLUMN = >'C1, TIMESTAMP = > ts1} hbase > t.get 'r1regions, {COLUMN = >'C1, TIMERANGE = > [ts1, ts2], VERSIONS = > 4} hbase > t.get 'r1, {COLUMN = > C1, TIMESTAMP = > ts1, VERSIONS = > 4}
6. Count 'hubble_uid'
At this point, I believe that you have a deeper understanding of "what is the role of HBase shell", you might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.