亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

HBASE 常用shell命令,增刪改查方法

 更新時間:2018年06月21日 10:03:16   作者:csdn俠  
今天小編就為大家分享一篇HBASE 常用shell命令,增刪改查方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

1、首先給出本次操作的數據

create 'student','info','address'
put 'student','1','info:age','20'
put 'student','1','info:name','wang'
put 'student','1','info:class','1'
put 'student','1','address:city','zhengzhou'
put 'student','1','address:area','High-tech zone'
put 'student','2','info:age','21'
put 'student','2','info:name','yang'
put 'student','2','info:class','1'
put 'student','2','address:city','beijing'
put 'student','2','address:area','CBD'
put 'student','3','info:age','22'
put 'student','3','info:name','zhao'
put 'student','3','info:class','2'
put 'student','3','address:city','shanghai'
put 'student','3','address:area','pudong'
scan 'student'

2、首先執(zhí)行,創(chuàng)建表,增加數據操作,執(zhí)行腳本 /bin/hbase shell ./student.txt,然后查看內容 scan ‘student'

hbase(main):001:0> scan 'student'
ROW      COLUMN+CELL
 1       column=address:area, timestamp=1491533426260, value=High-tech zone
 1       column=address:city, timestamp=1491533426239, value=zhengzhou
 1       column=info:age, timestamp=1491533426179, value=20
 1       column=info:class, timestamp=1491533426218, value=1
 1       column=info:name, timestamp=1491533426211, value=wang
 2       column=address:area, timestamp=1491533426297, value=CBD
 2       column=address:city, timestamp=1491533426292, value=beijing
 2       column=info:age, timestamp=1491533426269, value=21
 2       column=info:class, timestamp=1491533426287, value=1
 2       column=info:name, timestamp=1491533426277, value=yang
 3       column=address:area, timestamp=1491533426329, value=pudong
 3       column=address:city, timestamp=1491533426323, value=shanghai
 3       column=info:age, timestamp=1491533426305, value=22
 3       column=info:class, timestamp=1491533426317, value=2
 3       column=info:name, timestamp=1491533426311, value=zhao
3 row(s) in 0.1940 seconds

3、修改操作 也是用put命令,就是重新添加內容把,把以前的內容覆蓋。

格式 put 't1', 'r1', 'c1', 'value'
命令 put 'student','1','info:age','18'
結果
hbase(main):010:0> get 'student','1'
COLUMN      CELL
 address:area    timestamp=1491533426260, value=High-tech zone
 address:city    timestamp=1491533426239, value=zhengzhou
 info:age     timestamp=1491533823331, value=18
 info:class    timestamp=1491533426218, value=1
 info:name     timestamp=1491533426211, value=wang
5 row(s) in 0.0110 seconds

4、刪除操作,分為刪除單元格的內容,和整行刪除

單元格

hbase(main):012:0> delete 'student','1','info:name'
0 row(s) in 0.0800 seconds

hbase(main):014:0> get 'student','1'
COLUMN      CELL
 address:area    timestamp=1491533426260, value=High-tech zone
 address:city    timestamp=1491533426239, value=zhengzhou
 info:age     timestamp=1491533823331, value=18
 info:class    timestamp=1491533426218, value=1
4 row(s) in 0.0120 seconds

整行

hbase(main):023:0> deleteall 'student','1'
0 row(s) in 0.0260 seconds

hbase(main):024:0> get 'student','1'
COLUMN      CELL
0 row(s) in 0.0070 seconds

5、查詢

單行查詢

hbase(main):026:0> get 'student','2'
COLUMN      CELL
 address:area    timestamp=1491533426297, value=CBD
 address:city    timestamp=1491533426292, value=beijing
 info:age     timestamp=1491533426269, value=21
 info:class    timestamp=1491533426287, value=1
 info:name     timestamp=1491533426277, value=yang
5 row(s) in 0.0190 seconds

指定列族

hbase(main):028:0> get 'student', '2', {COLUMN => 'info'}
COLUMN      CELL
 info:age     timestamp=1491533426269, value=21
 info:class    timestamp=1491533426287, value=1
 info:name     timestamp=1491533426277, value=yang
3 row(s) in 0.0150 seconds

指定列名

hbase(main):029:0> get 'student', '2', {COLUMN => 'info:age'}
COLUMN      CELL
 info:age     timestamp=1491533426269, value=21
1 row(s) in 0.0080 seconds

使用scan,指定startrow

 hbase(main):031:0> scan 'student', {COLUMNS => ['info:age', 'address'], LIMIT => 10, STARTROW => '2'}
ROW      COLUMN+CELL
 2       column=address:area, timestamp=1491533426297, value=CBD
 2       column=address:city, timestamp=1491533426292, value=beijing
 2       column=info:age, timestamp=1491533426269, value=21
 3       column=address:area, timestamp=1491533426329, value=pudong
 3       column=address:city, timestamp=1491533426323, value=shanghai
 3       column=info:age, timestamp=1491533426305, value=22
2 row(s) in 0.0190 seconds

scan指定過濾

hbase(main):005:0> scan 'student',{FILTER=>"(TimestampsFilter (1491533426297))"}
ROW      COLUMN+CELL
 2       column=address:area, timestamp=1491533426297, value=CBD
1 row(s) in 0.0170 seconds

以上這篇HBASE 常用shell命令,增刪改查方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

  • Linux du命令查看文件夾大小并按降序排列

    Linux du命令查看文件夾大小并按降序排列

    這篇文章主要介紹了Linux du命令查看文件夾大小并按降序排列,需要的朋友可以參考下
    2015-11-11
  • shell 中數學計算總結

    shell 中數學計算總結

    shell中的賦值和操作默認都是字符串處理,在此記下shell中進行數學運算的幾個特殊方法,以后用到的時候可以來看,呵呵
    2012-09-09
  • Linux 中的通配符詳解及實例

    Linux 中的通配符詳解及實例

    這篇文章主要介紹了Linux 中的通配符詳解及實例的相關資料,希望通過本文能掌握Linux 通配符的知識,需要的朋友可以參考下
    2017-09-09
  • Linux find命令及實用示例詳解

    Linux find命令及實用示例詳解

    Linux系統(tǒng)中的find命令是用于搜索文件和執(zhí)行操作的強大工具,通過指定搜索路徑和條件,用戶可以查找特定文件名、類型、權限等,并執(zhí)行如打印路徑、刪除文件等操作,文章通過多個示例,展示了find命令在實際應用中的用法,感興趣的朋友一起看看吧
    2024-10-10
  • Linux中搭建FTP服務器的方法

    Linux中搭建FTP服務器的方法

    這篇文章主要介紹了Linux中搭建FTP服務器的方法 的相關資料,需要的朋友可以參考下
    2015-09-09
  • Apache使用 .htaccess 來實現強制https訪問的方法

    Apache使用 .htaccess 來實現強制https訪問的方法

    下面小編就為大家?guī)硪黄狝pache使用 .htaccess 來實現強制https訪問的方法。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-03-03
  • Log4j 日志文件Linux/Mac/Windows通用存放位置設置方法

    Log4j 日志文件Linux/Mac/Windows通用存放位置設置方法

    下面小編就為大家?guī)硪黄狶og4j 日志文件Linux/Mac/Windows通用存放位置設置方法。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-01-01
  • 使用Linux的alternatives命令替換選擇軟件的版本方法

    使用Linux的alternatives命令替換選擇軟件的版本方法

    下面小編就為大家?guī)硪黄褂肔inux的alternatives命令替換選擇軟件的版本方法。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-05-05
  • Shell腳本實現的陽歷轉農歷代碼分享

    Shell腳本實現的陽歷轉農歷代碼分享

    這篇文章主要介紹了Shell腳本實現的陽歷轉農歷代碼分享,本文是作者一個星期的工作成果,得來不易,需要的朋友可以參考下
    2014-09-09
  • 詳解Linux 操作系統(tǒng)下安裝rpm包的方法步驟

    詳解Linux 操作系統(tǒng)下安裝rpm包的方法步驟

    這篇文章主要介紹了詳解Linux 操作系統(tǒng)下安裝rpm包的方法步驟的相關資料,需要的朋友可以參考下
    2015-11-11

最新評論