亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Pig讀寫HBase數據

發布時間:2020-03-04 09:21:46 來源:網絡 閱讀:3722 作者:luoyunnian 欄目:關系型數據庫

1、建一個文本

[root@sandbox ~]# vi /customers

4000001,Kristina,Chung,55,Pilot

4000002,Paige,Chen,74,Teacher

4000003,Sherri,Melton,34,Firefighter

4000004,Gretchen,Hill,66,Computerhardware engineer

4000005,Karen,Puckett,74,Lawyer

4000006,Patrick,Song,42,Veterinarian

4000007,Elsie,Hamilton,43,Pilot

4000008,Hazel,Bender,63,Carpenter

4000009,Malcolm,Wagner,39,Artist

4000010,Dolores,McLaughlin,60,Writer

4000011,Francis,McNamara,47,Therapist

4000012,Sandy,Raynor,26,Writer

4000013,Marion,Moon,41,Carpenter

4000014,Beth,Woodard,65,

4000015,Julia,Desai,49,Musician

4000016,Jerome,Wallace,52,Pharmacist

4000017,Neal,Lawrence,72,Computersupport specialist

4000018,Jean,Griffin,45,Childcareworker

4000019,Kristine,Dougherty,63,Financialanalyst

 

2、把數據文件讀入pig關系

grunt>copyfromlocal /customers/user/pig/

grunt>raw_data = LOAD'/user/pig/customers' USING PigStorage(',') AS (

>> custno:chararray,

>> firstname:chararray,

>> lastname:chararray,

>> age:int,

>> profession:chararray

>> );

grunt>dump raw_data;

(4000001,Kristina,Chung,55,Pilot)

(4000002,Paige,Chen,74,Teacher)

(4000003,Sherri,Melton,34,Firefighter)

(4000004,Gretchen,Hill,66,Computerhardware engineer)

(4000005,Karen,Puckett,74,Lawyer)

(4000006,Patrick,Song,42,Veterinarian)

(4000007,Elsie,Hamilton,43,Pilot)

(4000008,Hazel,Bender,63,Carpenter)

(4000009,Malcolm,Wagner,39,Artist)

(4000010,Dolores,McLaughlin,60,Writer)

(4000011,Francis,McNamara,47,Therapist)

(4000012,Sandy,Raynor,26,Writer)

(4000013,Marion,Moon,41,Carpenter)

(4000014,Beth,Woodard,65,)

(4000015,Julia,Desai,49,Musician)

(4000016,Jerome,Wallace,52,Pharmacist)

(4000017,Neal,Lawrence,72,Computersupport specialist)

(4000018,Jean,Griffin,45,Childcareworker)

(4000019,Kristine,Dougherty,63,Financialanalyst)

 

3 Pig把關系寫到HBase

Hbase建一個表

hbase(main):017:0> create'customers','customer_data'

0row(s) in 1.4870 seconds

=>Hbase::Table - customers

hbase(main):018:0> list

TABLE                                                        

customers                                                                   

iemployee                                                                         

student                                                                          

t1                                                                                 

tc                                                                                  

5row(s) in 0.0390 seconds

hbase(main):019:0>scan 'customers'

ROW                                   COLUMN+CELL                                                                                                    

0row(s) in 0.3840 seconds

grunt> STORE raw_data INTO'hbase://customers' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(

>> 'customer_data:custno

>> customer_data:firstname

>> customer_data:lastname

>> customer_data:age

>> customer_data:profession'

>> );

hbase(main):023:0>scan 'customers'

ROW                                   COLUMN+CELL                                                                                                    

 4000001                              column=customer_data:age, timestamp=1427249531913, value=Pilot                                                  

 4000001                              column=customer_data:custno, timestamp=1427249531913,value=Kristina                                           

 4000001                              column=customer_data:firstname, timestamp=1427249531913,value=Chung                                           

 4000001                              column=customer_data:lastname, timestamp=1427249531913, value=55                                               

 4000002                              column=customer_data:age, timestamp=1427249531927, value=Teacher                                               

 4000002                              column=customer_data:custno, timestamp=1427249531927, value=Paige                                               

 4000002                              column=customer_data:firstname, timestamp=1427249531927, value=Chen                                            

 4000002                              column=customer_data:lastname,

   

   

                                              

 4000019                              column=customer_data:age, timestamp=1427249531931, value=Financialanalyst                                     

 4000019                              column=customer_data:custno, timestamp=1427249531931,value=Kristine                                           

 4000019                              column=customer_data:firstname, timestamp=1427249531931,value=Dougherty                                       

 4000019                               column=customer_data:lastname,timestamp=1427249531931, value=63                                               

19row(s) in 0.2800 seconds

 

3 PigHBase

grunt>raw = LOAD  'hbase://customers' USINGorg.apache.pig.backend.hadoop.hbase.HBaseStorage(

>> 'customer_data:custno

>> customer_data:firstname

>> customer_data:lastname

>> customer_data:age

>> customer_data:profession'

>> );

 

grunt>dump raw;

(Kristina,Chung,55,Pilot,)

(Paige,Chen,74,Teacher,)

(Sherri,Melton,34,Firefighter,)

(Gretchen,Hill,66,Computerhardware engineer,)

(Karen,Puckett,74,Lawyer,)

(Patrick,Song,42,Veterinarian,)

(Elsie,Hamilton,43,Pilot,)

(Hazel,Bender,63,Carpenter,)

(Malcolm,Wagner,39,Artist,)

(Dolores,McLaughlin,60,Writer,)

(Francis,McNamara,47,Therapist,)

(Sandy,Raynor,26,Writer,)

(Marion,Moon,41,Carpenter,)

(Beth,Woodard,65,,)

(Julia,Desai,49,Musician,)

(Jerome,Wallace,52,Pharmacist,)

(Neal,Lawrence,72,Computersupport specialist,)

(Jean,Griffin,45,Childcareworker,)

(Kristine,Dougherty,63,Financial analyst,)


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

灵寿县| 内乡县| 衢州市| 阜阳市| 海原县| 囊谦县| 牙克石市| 平泉县| 鄂伦春自治旗| 仪征市| 岗巴县| 城口县| 福州市| 无为县| 巴青县| 濮阳市| 思南县| 花莲市| 闽清县| 海南省| 鹿泉市| 剑河县| 乌鲁木齐县| 肇东市| 漠河县| 辽中县| 崇文区| 凌源市| 新沂市| 区。| 耿马| 拉萨市| 双峰县| 无为县| 磴口县| 英吉沙县| 舟曲县| 嘉鱼县| 嫩江县| 贡觉县| 建平县|