HADOOP-HIVE表-標准建表語句(外部表和內部表)- 學習筆記(5)


HIVE表-標准建表語句解析,內/外表 

REF: https://edu.hellobi.com/course/93/play/lesson/2035

 

 

hive> create external table test(id int);
OK
Time taken: 12.057 seconds
hive> desc formatted test
    > ;
OK
# col_name                data_type               comment             
          
id                      int                                         
          
# Detailed Table Information          
Database:               default                  
Owner:                  root                     
CreateTime:             Sun May 17 16:09:46 GMT+08:00 2020     
LastAccessTime:         UNKNOWN                  
Retention:              0                        
Location:               hdfs://bigdata:9000/user/hive/warehouse/test     
Table Type:             EXTERNAL_TABLE           

刪除例子:

分別創建外部表和內部表,然后刪除。

hive> create external table test_ext(id int);
OK
Time taken: 0.319 seconds
hive> create table test_int(id int);
OK
Time taken: 0.206 seconds

 

 

hive> drop table test_ext;
OK
Time taken: 0.258 seconds
hive> drop table test_int;
OK
Time taken: 0.345 seconds

可以看到test_int被刪除了,而外部表test_ext依然存在。

 

 

 

HIVE文件及數據格式

REF:https://edu.hellobi.com/course/93/play/lesson/2036

 

 

 SerDe 序列化和反序列化

 

 

 

序列化: 

1)持久化,

2)網絡傳輸

CSV/TSV 行中行 需要特殊處理,cast等。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM