当前位置:首页 > 开发 > 系统架构 > 架构 > 正文

hive建表

发表于: 2014-11-11   作者:blackproof   来源:转载   浏览:
摘要: hive分内部表和外部表    create table xxx( logtime string , traceid string , param string , result string , runtime string ) partitioned by (

hive分内部表和外部表

  

create table xxx(
        logtime string ,
        traceid string ,
        param string ,
        result string ,
        runtime string
        ) partitioned by (
        logday string 
) row format delimited fields terminated by '\t'
collection items terminated by ','
lines terminated by '\n'
stored as textfile 
location '/xxxxxxxx/xxxx';

 

 

 

CREATE EXTERNAL TABLE page_view(
     viewTime INT, 
     userid BIGINT,
     page_url STRING, 
     referrer_url STRING,
     ip STRING COMMENT 'IP Address of the User',
     country STRING COMMENT 'country of origination')
 COMMENT 'This is the staging page view table'
 ROW FORMAT DELIMITED FIELDS TERMINATED BY '\054'
 STORED AS TEXTFILE
 LOCATION '/user/hadoop/warehouse/page_view';




hive建表

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号