zoukankan      html  css  js  c++  java
  • 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等。

  • 相关阅读:
    合并区间
    编程团体赛
    寻找数组的中间位置
    翻转链表2
    链表翻转
    CF1237H. Balanced Reversals
    arc108E
    agc028D
    CF1446D. Frequency Problem
    CF1439D. INOI Final Contests
  • 原文地址:https://www.cnblogs.com/watermarks/p/12902027.html
Copyright © 2011-2022 走看看