尚矽谷hbaseshell練習

2021-10-05 08:09:20 字數 1706 閱讀 5917

3.1 基本操作

1.進入hbase客戶端命令列

[atguigu@hadoop102 hbase]$ bin/hbase shell

2.檢視幫助命令

hbase(main):001:0> help

3.檢視當前資料庫中有哪些表

hbase(main):002:0> list

3.2 表的操作

1.建立表

hbase(main):002:0> create 『student』,『info』

2.插入資料到表

hbase(main):003:0> put 『student』,『1001』,『info:***』,『male』

hbase(main):004:0> put 『student』,『1001』,『info:age』,『18』

hbase(main):005:0> put 『student』,『1002』,『info:name』,『janna』

hbase(main):006:0> put 『student』,『1002』,『info:***』,『female』

hbase(main):007:0> put 『student』,『1002』,『info:age』,『20』

3.掃瞄檢視表資料

hbase(main):008:0> scan 『student』

hbase(main):009:0> scan 『student』,

hbase(main):010:0> scan 『student』,

4.檢視表結構

hbase(main):011:0> describe 『student』

5.更新指定欄位的資料

hbase(main):012:0> put 『student』,『1001』,『info:name』,『nick』

hbase(main):013:0> put 『student』,『1001』,『info:age』,『100』

6.檢視「指定行」或「指定列族:列」的資料

hbase(main):014:0> get 『student』,『1001』

hbase(main):015:0> get 『student』,『1001』,『info:name』

7.統計表資料行數

hbase(main):021:0> count 『student』

8.刪除資料

刪除某rowkey的全部資料:

hbase(main):016:0> deleteall 『student』,『1001』

刪除某rowkey的某一列資料:

hbase(main):017:0> delete 『student』,『1002』,『info:***』

9.清空表資料

hbase(main):018:0> truncate 『student』

10.刪除表

首先需要先讓該錶為disable狀態:

hbase(main):019:0> disable 『student』

然後才能drop這個表:

hbase(main):020:0> drop 『student』

11.變更表資訊

將info列族中的資料存放3個版本:

hbase(main):022:0> alter 『student』,

hbase(main):022:0> get 『student』,『1001』,

*12.表操作 scan

scan 『stu』,

尚矽谷之JDBC

可以通過 drivermanager 類建立到資料庫的連線connection drivermanager 試圖從已註冊的 jdbc 驅動程式集中選擇乙個適當的驅動程式。public static connection getconnection string url public static c...

尚矽谷 Less 筆記

3.less中的混合 4.less的計算 5.less的繼承 5.避免編譯 less是一種動態樣式語言,屬於css預處理器的範疇,他擴充套件了css語言,增加了變數 mixin 函式的等特性,使css更易於維護和擴充套件 less既可以在客戶端執行,也可以借助node.js在服務端執行 less官網...

尚矽谷的Bank的練習心得和筆記

尚矽谷的bank的練習心得和筆記 銀行 public class bank public void addcustomer string firstname,string lastname 獲取客戶個數 public intgetnumberofcustomer 獲取指定位置上的客戶 public ...