ITPub博客

首页 > 大数据 > Hadoop > hadoop 建表

hadoop 建表

Hadoop 作者:mcxiaoracle 时间:2022-07-13 00:48:19 0 删除 编辑

区别:在删除table的时候,内部表 删除Hadoop上的数据,外部表 不删除数据


$HIVE -e "use ${WIFI};                                                                                                      

CREATE TABLE if not exists new_feature (                                                                                 

    chl string,                                                                                                                                                                                                                                 

    info string)                                                                                                                   

PARTITIONED BY (                                                                                                                   

    dayid string,                                                                                                                  

    feature string                                                                                                                 

)                                                                                                                                

ROW FORMAT DELIMITED                                                                                                               

    FIELDS TERMINATED BY '\t';


$HIVE -e "use ${WIFI};                                                                                                      

CREATE EXTERNAL TABLE if not exists new_feature (                                                                                                                                                                                                      

    real int, 

    dis string                                                                                                                                                                                                                                   )                                                                                                                   

PARTITIONED BY (                                                     




推荐阅读:

https://blog.csdn.net/weixin_39183369/article/details/78743990?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-78743990-blog-118093099.pc_relevant_multi_platform_whitelistv2&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-78743990-blog-118093099.pc_relevant_multi_platform_whitelistv2&utm_relevant_index=1                                                                                                                                                                              

    feature string                                                                                                                 

)                                                                                                                                

ROW FORMAT DELIMITED                                                                                                               

    FIELDS TERMINATED BY '\t';

stored as textfile

location 'hdfs://namenode/tmp/lmj/tab/';




2 使用hadoop分区

show partitions  [表名]





来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69949806/viewspace-2905479/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
数据方向,了解oracle ,IBM DB2 730

注册时间:2019-09-30

  • 博文量
    286
  • 访问量
    226568